⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 抄表系统dlg.cpp

📁 此程序为EVC编写的MIS系统
💻 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 + -