?? 抄表系統dlg.cpp
字號:
// 抄表系統Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "抄表系統.h"
#include "抄表系統Dlg.h"
#include "CreateDB.h"
#include "ControlTxt.h"
#include "LogDlg.h"
#include "Manage.h"
#include "WriteTB.h"
#include "Update.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////
CControlTxt convertor;
CCreateDB database;
extern CString LogName;
////////////////////////////////////
// CMyDlg dialog
CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyDlg)
// 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(IDR_MAINFRAME);
}
void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyDlg)
DDX_Control(pDX, IDC_BUTTON2, m_button2);
DDX_Control(pDX, IDC_BUTTON1, m_button1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
//{{AFX_MSG_MAP(CMyDlg)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyDlg message handlers
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
//
//
CLogDlg dlg1;
response=dlg1.DoModal(); //登陸界面顯示
if(response==IDCANCEL)
{
EndDialog(response);
exit(0);
}
//
CenterWindow(GetDesktopWindow());
//
::SetWindowPos(CWnd::GetSafeHwnd(),wndTopMost,0,1,0,0,SWP_NOSIZE);
//
if(LogName.Compare(L"抄表管理員")==0)
{
m_button1.EnableWindow(FALSE);
m_button2.EnableWindow(TRUE);
}
//
/*if(LogName.Compare(L"抄表管理員")!=0)
{
if(!convertor.Readtxtfile()) //把文本文件轉換成數據庫
::AfxMessageBox(L"文本文件讀入失敗!");
}*/
return TRUE;
}
void CMyDlg::OnButton1()
{
CWriteTB dlg4;
dlg4.DoModal();
}
void CMyDlg::OnButton2()
{
CManage dlg2;
CUpdate dlg3;
if(LogName.Compare(L"抄表管理員")==0)
{
dlg2.DoModal();
}
else
{
dlg3.DoModal();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -