ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSalesManagementSystemApp construction
CSalesManagementSystemApp::CSalesManagementSystemApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CSalesManagementSystemApp object
CSalesManagementSystemApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CSalesManagementSystemApp initialization
BOOL CSalesManagementSystemApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
//SetDialogBkColor(RGB(64, 207, 196), RGB(0, 0, 0));
CDiagLog dlgLog;
CSalesManagementSystemDlg mainDlg;
CSalesBill salesDlg;
CString strSQL;
CADOConn adoMain;
if (dlgLog.DoModal() != IDOK)
{
exit(1);
}
strSQL = "SELECT * FROM UserInfo WHERE UserInfo.code = '";
strSQL = strSQL + dlgLog.strCode + "'";
adoMain.Open(strSQL);
if (!adoMain.adoEOF())
{
int authority = adoMain.GetItemInt(2);
if (authority == 1)
{
m_pMainWnd = &salesDlg;
salesDlg.m_strBiller = dlgLog.strName;
salesDlg.DoModal();
}
else
{
mainDlg.strCode = dlgLog.strCode;
mainDlg.strName = dlgLog.strName;
m_pMainWnd = &mainDlg;
mainDlg.DoModal();
}
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}