[Cpp]
// SalesManagementSystem. h: main header file for the SALESMANAGEMENTSYSTEM application
//
# If! Defined (afx_salesmanagementsystem_h1_6eb4b2a4_c21a_4ddb_971b_d9bd457ccbd61_included _)
# Define afx_salesmanagementsystem_h1_6eb4b2a4_c21a_4ddb_971b_d9bd457ccbd61_included _
# If _ MSC_VER> 1000
# Pragma once
# Endif // _ MSC_VER> 1000
# Ifndef _ AFXWIN_H __
# Error include 'stdafx. H' before including this file for PCH
# Endif
# Include "resource. h" // main symbols
//////////////////////////////////////// /////////////////////////////////////
// CSalesManagementSystemApp:
// See SalesManagementSystem. cpp for the implementation of this class
//
Class CSalesManagementSystemApp: public CWinApp
{
Public:
CSalesManagementSystemApp ();
// Overrides
// ClassWizard generated virtual function overrides
// {AFX_VIRTUAL (CSalesManagementSystemApp)
Public:
Virtual BOOL InitInstance ();
//} AFX_VIRTUAL
// Implementation
// {AFX_MSG (CSalesManagementSystemApp)
// NOTE-the ClassWizard will add and remove member functions here.
// Do not edit what you see in these blocks of generated code!
//} AFX_MSG
DECLARE_MESSAGE_MAP ()
};
//////////////////////////////////////// /////////////////////////////////////
// {AFX_INSERT_LOCATION }}
// Microsoft Visual C ++ will insert additional declarations immediately before the previous line.
# Endif //! Defined (afx_salesmanagementsystem_h1_6eb4b2a4_c21a_4ddb_971b_d9bd457ccbd61_included _)
// SalesManagementSystem. cpp: Defines the class behaviors for the application.
//
# Include "stdafx. h"
# Include "SalesManagementSystem. h"
# Include "SalesManagementSystemDlg. h"
# Include "DiagLog. h"
# Include "SalesBill. h"
# Include "ADOConn. h"
# Ifdef _ DEBUG
# Define new DEBUG_NEW
# Undef THIS_FILE
Static char THIS_FILE [] = _ FILE __;
# Endif
//////////////////////////////////////// /////////////////////////////////////
// CSalesManagementSystemApp
BEGIN_MESSAGE_MAP (CSalesManagementSystemApp, CWinApp)
// {AFX_MSG_MAP (CSalesManagementSystemApp)
// NOTE-the ClassWizard will add and remove mapping macros here.
// Do not edit what you see in these blocks of generated code!
//} AFX_MSG
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
// Application, rather than start the application's message pump.
Return FALSE;
}
// SalesManagementSystem. h: main header file for the SALESMANAGEMENTSYSTEM application
//
# If! Defined (afx_salesmanagementsystem_h1_6eb4b2a4_c21a_4ddb_971b_d9bd457ccbd61_included _)
# Define afx_salesmanagementsystem_h1_6eb4b2a4_c21a_4ddb_971b_d9bd457ccbd61_included _
# If _ MSC_VER> 1000
# Pragma once
# Endif // _ MSC_VER> 1000
# Ifndef _ AFXWIN_H __
# Error include 'stdafx. H' before including this file for PCH
# Endif
# Include "resource. h" // main symbols
//////////////////////////////////////// /////////////////////////////////////
// CSalesManagementSystemApp:
// See SalesManagementSystem. cpp for the implementation of this class
//
Class CSalesManagementSystemApp: public CWinApp
{
Public:
CSalesManagementSystemApp ();
// Overrides
// ClassWizard generated virtual function overrides
// {AFX_VIRTUAL (CSalesManagementSystemApp)
Public:
Virtual BOOL InitInstance ();
//} AFX_VIRTUAL
// Implementation
// {AFX_MSG (CSalesManagementSystemApp)
// NOTE-the ClassWizard will add and remove member functions here.
// Do not edit what you see in these blocks of generated code!
//} AFX_MSG
DECLARE_MESSAGE_MAP ()
};
//////////////////////////////////////// /////////////////////////////////////
// {AFX_INSERT_LOCATION }}
// Microsoft Visual C ++ will insert additional declarations immediately before the previous line.
# Endif //! Defined (afx_salesmanagementsystem_h1_6eb4b2a4_c21a_4ddb_971b_d9bd457ccbd61_included _)
// SalesManagementSystem. cpp: Defines the class behaviors for the application.
//
# Include "stdafx. h"
# Include "SalesManagementSystem. h"
# Include "SalesManagementSystemDlg. h"
# Include "DiagLog. h"
# Include "SalesBill. h"
# Include "ADOConn. h"
# Ifdef _ DEBUG
# Define new DEBUG_NEW
# Undef THIS_FILE
Static char THIS_FILE [] = _ FILE __;
# Endif
//////////////////////////////////////// /////////////////////////////////////
// CSalesManagementSystemApp
BEGIN_MESSAGE_MAP (CSalesManagementSystemApp, CWinApp)
// {AFX_MSG_MAP (CSalesManagementSystemApp)
// NOTE-the ClassWizard will add and remove mapping macros here.
// Do not edit what you see in these blocks of generated code!
//} AFX_MSG
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
// Application, rather than start the application's message pump.
Return FALSE;
}