GZGLXTDLG.CPP
资源名称:gongzi.rar [点击查看]
上传用户:ghostdhl
上传日期:2018-06-14
资源大小:9728k
文件大小:7k
源码类别:
数据库编程
开发平台:
Visual C++
- // GZGLXTDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "GZGLXT.h"
- #include "GZGLXTDlg.h"
- #include "Ygjctjdlg.h"
- #include "Ygjcscdlg.h"
- #include "Ygjbgzdlg.h"
- #include "Ygfdgzdlg.h"
- #include "Ygjbxjdlg.h"
- #include "Login.h"
- #include "Czyxxb.h"
- #include "GzffDlg.h"
- #include "Xinjyhdlg.h"
- #include "Xiugmmdlg.h"
- #include "Gzffmxb.h"
- #include "Zongtcxdlg.h"
- #include "Fdgztjdlg.h"
- #include "Jbgztjdlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern CCzyxxb ffxxb;
- /////////////////////////////////////////////////////////////////////////////
- // CAboutDlg dialog used for App About
- class CAboutDlg : public CDialog
- {
- public:
- CAboutDlg();
- // Dialog Data
- //{{AFX_DATA(CAboutDlg)
- enum { IDD = IDD_ABOUTBOX };
- //}}AFX_DATA
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAboutDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- //{{AFX_MSG(CAboutDlg)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
- {
- //{{AFX_DATA_INIT(CAboutDlg)
- //}}AFX_DATA_INIT
- }
- void CAboutDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAboutDlg)
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- //{{AFX_MSG_MAP(CAboutDlg)
- // No message handlers
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CGZGLXTDlg dialog
- CGZGLXTDlg::CGZGLXTDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CGZGLXTDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CGZGLXTDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
- m_hIcon = AfxGetApp()->LoadIcon(IDI_MENUICON);
- }
- void CGZGLXTDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CGZGLXTDlg)
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CGZGLXTDlg, CDialog)
- //{{AFX_MSG_MAP(CGZGLXTDlg)
- ON_WM_SYSCOMMAND()
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- ON_COMMAND(ID_EXIT, OnExit)
- ON_COMMAND(ID_MENUFDGZ, OnMenufdgz)
- ON_COMMAND(ID_MENUGZFF, OnMenugzff)
- ON_COMMAND(ID_MENUJBGZ, OnMenujbgz)
- ON_COMMAND(ID_MENUJBSJ, OnMenujbsj)
- ON_COMMAND(ID_MENUXGMM, OnMenuxgmm)
- ON_COMMAND(ID_MENUYGLR, OnMenuyglr)
- ON_COMMAND(ID_MENUYGSC, OnMenuygsc)
- ON_COMMAND(ID_MENUYHGL, OnMenuyhgl)
- ON_COMMAND(ID_MENUZTCX, OnMenuztcx)
- ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
- ON_COMMAND(ID_MENUJBGZTJ, OnMenujbgztj)
- ON_COMMAND(ID_MENUFDGZTJ, OnMenufdgztj)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CGZGLXTDlg message handlers
- BOOL CGZGLXTDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // Add "About..." menu item to system menu.
- // IDM_ABOUTBOX must be in the system command range.
- ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
- ASSERT(IDM_ABOUTBOX < 0xF000);
- CMenu* pSysMenu = GetSystemMenu(FALSE);
- if (pSysMenu != NULL)
- {
- CString strAboutMenu;
- strAboutMenu.LoadString(IDS_ABOUTBOX);
- if (!strAboutMenu.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_SEPARATOR);
- pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
- }
- }
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
- // TODO: Add extra initialization here
- CLogin gin;
- if(gin.DoModal()!=IDOK)
- OnOK();
- t=CTime::GetCurrentTime();
- m_StatusBar.EnableAutomation();
- m_StatusBar.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,0);//ID_STATUSBAR);
- int width[]={200,370,500};
- m_StatusBar.SetParts(3, &width[0]);
- m_StatusBar.SetText("吉林省明日科技有限公司",0,0);
- CString StatusText;
- StatusText.Format("当前用户:%s",ffxxb.GetCzyName());
- m_StatusBar.SetText(StatusText,0,1);
- CString strdate;
- strdate.Format("当前时间:%s",t.Format("%y-%m-%d"));
- m_StatusBar.SetText(strdate,0,2);
- return TRUE; // return TRUE unless you set the focus to a control
- }
- void CGZGLXTDlg::OnSysCommand(UINT nID, LPARAM lParam)
- {
- if ((nID & 0xFFF0) == IDM_ABOUTBOX)
- {
- CAboutDlg dlgAbout;
- dlgAbout.DoModal();
- }
- else
- {
- CDialog::OnSysCommand(nID, lParam);
- }
- }
- // If you add a minimize button to your dialog, you will need the code below
- // to draw the icon. For MFC applications using the document/view model,
- // this is automatically done for you by the framework.
- void CGZGLXTDlg::OnPaint()
- {
- if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
- SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
- }
- // The system calls this to obtain the cursor to display while the user drags
- // the minimized window.
- HCURSOR CGZGLXTDlg::OnQueryDragIcon()
- {
- return (HCURSOR) m_hIcon;
- }
- void CGZGLXTDlg::OnExit()
- {
- // TODO: Add your command handler code here
- OnOK();
- }
- void CGZGLXTDlg::OnMenufdgz()
- {
- // TODO: Add your command handler code here
- CYgfdgzdlg dlg;
- dlg.DoModal();
- }
- void CGZGLXTDlg::OnMenugzff()
- {
- // TODO: Add your command handler code here
- CGzffDlg dlg;
- dlg.DoModal();
- }
- void CGZGLXTDlg::OnMenujbgz()
- {
- // TODO: Add your command handler code here
- CYgjbgzdlg dlg;
- dlg.DoModal();
- }
- void CGZGLXTDlg::OnMenujbsj()
- {
- // TODO: Add your command handler code here
- CYgjbxjdlg dlg;
- dlg.DoModal();
- }
- void CGZGLXTDlg::OnMenuxgmm()
- {
- // TODO: Add your command handler code here
- CXiugmmdlg dlg;
- dlg.DoModal();
- }
- void CGZGLXTDlg::OnMenuyglr()
- {
- // TODO: Add your command handler code here
- CYgjctjdlg dlg;
- dlg.DoModal();
- }
- void CGZGLXTDlg::OnMenuygsc()
- {
- // TODO: Add your command handler code here
- CYgjcscdlg dlg;
- dlg.DoModal();
- }
- void CGZGLXTDlg::OnMenuyhgl()
- {
- // TODO: Add your command handler code here
- if(ffxxb.GetCzyjb()=="1")
- {
- CXinjyhdlg dlg;
- dlg.DoModal();
- }
- else
- {
- MessageBox("没有权限","工资管理系统");
- return;
- }
- }
- void CGZGLXTDlg::OnMenuztcx()
- {
- // TODO: Add your command handler code here
- CZongtcxdlg dlg;
- dlg.DoModal();
- }
- void CGZGLXTDlg::OnAppAbout()
- {
- // TODO: Add your command handler code here
- CAboutDlg aboutDlg;
- aboutDlg.DoModal();
- }
- void CGZGLXTDlg::OnMenujbgztj()
- {
- // TODO: Add your command handler code here
- if(ffxxb.GetCzyjb()=="1")
- {
- CJbgztjdlg dlg;
- dlg.DoModal();
- }
- else
- {
- MessageBox("没有权限","工资管理系统");
- return;
- }
- }
- void CGZGLXTDlg::OnMenufdgztj()
- {
- // TODO: Add your command handler code here
- if(ffxxb.GetCzyjb()=="1")
- {
- CFdgztjdlg dlg;
- dlg.DoModal();
- }
- else
- {
- MessageBox("没有权限","工资管理系统");
- return;
- }
- }