📄 stationmanage.cpp
字号:
// StationManage.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "StationManage.h"
#include "MainFrm.h"
#include "ChildFrm.h"
#include "StationManageDoc.h"
#include "StationManageView.h"
#include "LoginDlg.h"
#include "RouteSetingView.h"
#include "UserManageView.h"
#include "SeattypesetView.h"
#include "PricesettingView.h"
#include "BussettingView.h"
#include "DriversetView.h"
#include "BustypesetView.h"
#include "TickettypesetView.h"
#include "ShouPiaoMingXi.h"
#include "ShouPiaoTongJi.h"
#include "JieSuanMingXi.h"
#include "JieSuanTongJi.h"
#include "RiBaoBiao.h"
#include "TuiPiaoXinXI.h"
#include "SaleTicketView.h"
#include "DispatchView.h"
#include "BackTicketView.h"
#include "TicketSearchView.h"
#include "RouteSearchView.h"
#include "SaleSearchView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStationManageApp
BEGIN_MESSAGE_MAP(CStationManageApp, CWinApp)
//{{AFX_MSG_MAP(CStationManageApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStationManageApp construction
CStationManageApp::CStationManageApp()
{
control=false;
curusername="";
m_changepassword=1;
m_routesetting=1;
m_routesettingcontrol=false;
m_usermanage=1;
m_usermanagecontrol=false;
m_seattypesetting=1;
m_seattypesettingcontrol=false;
m_pricesetting=1;
m_pricesettingcontrol=false;
m_bussetting=1;
m_bussettingcontrol=false;
m_driversetting=1;
m_driversettingcontrol=false;
m_bustypesetting=1;
m_bustypesettingcontrol=false;
m_tickettypesetting = 1;
m_tickettypesettingcontrol = false;
m_ShouPiaoMingXiViews = 1;
m_ShouPiaoMingXiViewscontrol = false;
m_ShouPiaoTongJiViews = 1;
m_ShouPiaoTongJiViewscontrol = false;
m_JieSuanMingXiViews = 1;
m_JieSuanMingXiViewscontrol = false;
m_JieSuanTongJiViews = 1;
m_JieSuanTongJiViewscontrol = false;
m_RiBaoBiaoViews = 1;
m_RiBaoBiaoViewscontrol = false;
m_TuiPiaoXinXiViews = 1;
m_TuiPiaoXinXiViewscontrol = false;
m_SaleTicketViews = 1;
m_SaleTicketViewscontrol = false;
m_DispatchViews = 1;
m_DispatchViewscontrol = false;
m_BackTicketViews = 1;
m_BackTicketViewscontrol = false;
m_RouteSearchViews = 0;
m_TicketSearchViews = 0;
m_SaleSearchViews = 0;
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CStationManageApp object
CStationManageApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CStationManageApp initialization
BOOL CStationManageApp::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
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such s the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_STATIOTYPE,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CStationManageView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(/*IDR_STATIOTYPE*/IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Parse command line for standard shell commands, DDE, file open
CLoginDlg login;
login.DoModal();
if (control)
{
exit(0);
}
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (CCommandLineInfo::FileNew==cmdInfo.m_nShellCommand)
{
cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
}
m_pTemplateRoutesetting=new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CRouteSetingView));
AddDocTemplate(m_pTemplateRoutesetting);
m_pTemplateUserManage=new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CUserManageView));
AddDocTemplate(m_pTemplateUserManage);
m_pTemplateSeattypesetting=new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CSeattypesetView));
AddDocTemplate(m_pTemplateSeattypesetting);
m_pTemplatePricesetting=new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CPricesettingView));
AddDocTemplate(m_pTemplatePricesetting);
m_pTemplateBussetting=new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CBussettingView));
AddDocTemplate(m_pTemplateBussetting);
m_pTemplateDriversetting=new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CDriversetView));
AddDocTemplate(m_pTemplateDriversetting);
m_pTemplateBustypesetting=new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CBustypesetView));
AddDocTemplate(m_pTemplateBustypesetting);
m_pTemplateTickettypesetting=new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CTickettypesetView));
AddDocTemplate(m_pTemplateTickettypesetting);
m_pTemplateShouPiaoMingXi = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CShouPiaoMingXi));
AddDocTemplate(m_pTemplateShouPiaoMingXi);
m_pTemplateShouPiaoTongJi = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CShouPiaoTongJi));
AddDocTemplate(m_pTemplateShouPiaoTongJi);
m_pTemplateJieSuanMingXi = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CJieSuanMingXi));
AddDocTemplate(m_pTemplateJieSuanMingXi);
m_pTemplateJieSuanTongJi = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CJieSuanTongJi));
AddDocTemplate(m_pTemplateJieSuanTongJi);
m_pTemplateRiBaoBiao = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CRiBaoBiao));
AddDocTemplate(m_pTemplateRiBaoBiao);
m_pTemplateTuiPiaoXinXi = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTuiPiaoXinXI));
AddDocTemplate(m_pTemplateTuiPiaoXinXi);
m_pTemplateSaleTicket = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CSaleTicketView));
AddDocTemplate(m_pTemplateSaleTicket);
m_pTemplateDispatch = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CDispatchView));
AddDocTemplate(m_pTemplateDispatch);
m_pTemplateBackTicket= new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CBackTicketView));
AddDocTemplate(m_pTemplateBackTicket);
m_pTemplateRouteSearch= new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CRouteSearchView));
AddDocTemplate(m_pTemplateRouteSearch);
m_pTemplateSaleSearch= new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CSaleSearchView));
AddDocTemplate(m_pTemplateSaleSearch);
m_pTemplateTicketSearch= new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CStationManageDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTicketSearchView));
AddDocTemplate(m_pTemplateTicketSearch);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// 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)
// No message handlers
//}}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()
// App command to run the dialog
void CStationManageApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CStationManageApp message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -