NCShopDlg.cpp
上传用户:jzscgs158
上传日期:2022-05-25
资源大小:8709k
文件大小:38k
- // NCShopDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "NCShop.h"
- #include "NCShopDlg.h"
- #include "DlgQuit.h"
- #include "FileOperate.h"
- #include "MyButton.h"
- #include "MyTime.h"
- #include "DlgLogo.h"
- #include "DlgChaoShiBase.h"
- #include "DlgFenJiBase.h"
- #include "DlgFenLeiBase.h"
- #include "DlgDanganBase.h"
- #include "DlgGongYingShangBase.h"
- #include "ADOConn.h"
- #include "DlgJiaGeSheZhi.h"
- #include "DLgReport.h"
- #include "DlgJinHuoKanDan.h"
- #include "DlgJinHuoTuiDan.h"
- #include "DlgXiaoShouKanDan.h"
- #include "DlgXiaoShouTuiDan.h"
- #include "DlgRuKuKaiDan.h"
- #include "DlgChuKuKanDan.h"
- #include "DlgPwd.h"
- #include "DlgYongHuGuanLi.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CAboutDlg dialog used for App About
- // Download by http://www.codefans.net
- class CAboutDlg : public CDialog
- {
- public:
- CAboutDlg();
- // Dialog Data
- //{{AFX_DATA(CAboutDlg)
- enum { IDD = IDD_ABOUTBOX };
- CMyButton m_Btn1;
- CMyButton m_Btn2;
- //}}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)
- afx_msg void OnOk();
- virtual BOOL OnInitDialog();
- //}}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)
- DDX_Control(pDX, IDCANCEL, m_Btn1);
- DDX_Control(pDX, IDOK, m_Btn2);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- //{{AFX_MSG_MAP(CAboutDlg)
- ON_BN_CLICKED(IDOK, OnOk)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CNCShopDlg dialog
- CNCShopDlg::CNCShopDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CNCShopDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CNCShopDlg)
- ss = NULL;
- //}}AFX_DATA_INIT
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- }
- void CNCShopDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CNCShopDlg)
- DDX_Control(pDX, IDC_STATICTIME, m_StaticTime);
- DDX_Control(pDX, IDC_STATICHEAD4, m_BtnHead4);
- DDX_Control(pDX, IDC_BTNHEAD3, m_BtnHead3);
- DDX_Control(pDX, IDC_BTNBOTTOM2, m_BtnBottom2);
- DDX_Control(pDX, IDC_BTNBOTTOM1, m_BtnBottom1);
- DDX_Control(pDX, IDC_BTNHEAD, m_BtnHead);
- DDX_Control(pDX, IDC_BTNRESRESOUT, m_BtnResOut);
- DDX_Control(pDX, IDC_BTNRESIN, m_BtnResIn);
- DDX_Control(pDX, IDC_BTNRESALL, m_BtnResAll);
- DDX_Control(pDX, IDC_BTNRESFENLEI, m_BtnResFeiLei);
- DDX_Control(pDX, IDC_BTNRESZILIAO, m_BtnResZiliao);
- DDX_Control(pDX, IDC_BTNGONGYINGSHANG, m_BtnGongYingShang);
- DDX_Control(pDX, IDC_STATICADMINFENLEI, m_StaticAdminFenLei);
- DDX_Control(pDX, IDC_STATICADMINNAME, m_StaticAdminName);
- DDX_Control(pDX, IDC_BTNRESREPORT1, m_BtnReport1);
- DDX_Control(pDX, IDC_BTNRESREPORT2, m_BtnReport2);
- DDX_Control(pDX, IDC_BTNRESREPORT3, m_BtnReport3);
- DDX_Control(pDX, IDC_BTNRESREPORT4, m_BtnReport4);
- DDX_Control(pDX, IDC_BTNRESREPORT5, m_BtnReport5);
- DDX_Control(pDX, IDC_BTNRESREPORT6, m_BtnReport6);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CNCShopDlg, CDialog)
- //{{AFX_MSG_MAP(CNCShopDlg)
- ON_WM_SYSCOMMAND()
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- ON_WM_CTLCOLOR()
- ON_WM_SIZE()
- ON_WM_DRAWITEM()
- ON_WM_MEASUREITEM()
- ON_COMMAND(ID_MENU_MAIN_SYSTEM_RELOAD, OnMenuMainSystemReload)
- ON_COMMAND(ID_MENU_MAIN_SYSTEM_QUIT, OnMenuMainSystemQuit)
- ON_BN_CLICKED(IDC_BTNRESIN, OnBtnresin)
- ON_BN_CLICKED(IDC_BTNRESREPORT1, OnBtnresreport1)
- ON_COMMAND(ID_MENU_ABOUT_ABOUT, OnMenuAboutAbout)
- ON_COMMAND(ID_MENU_TOOLS_CALS, OnMenuToolsCals)
- ON_WM_TIMER()
- ON_COMMAND(ID_MENUITEM_B001, OnMenuitemB001)
- ON_COMMAND(ID_MENUITEM_B002, OnMenuitemB002)
- ON_COMMAND(ID_MENUITEM_B003, OnMenuitemB003)
- ON_COMMAND(ID_MENUITEM_B004, OnMenuitemB004)
- ON_COMMAND(ID_MENUITEM_B006, OnMenuitemB006)
- ON_COMMAND(ID_MENUITEM_B007, OnMenuitemB007)
- ON_COMMAND(ID_MENUITEM_B005, OnMenuitemB005)
- ON_COMMAND(ID_MENUITEM_B008, OnMenuitemB008)
- ON_COMMAND(ID_MENUITEM_B009, OnMenuitemB009)
- ON_COMMAND(ID_MENUITEM_B010, OnMenuitemB010)
- ON_COMMAND(ID_MENUITEM_C001, OnMenuitemC001)
- ON_COMMAND(ID_MENUITEM_C002, OnMenuitemC002)
- ON_COMMAND(ID_MENUITEM_C003, OnMenuitemC003)
- ON_COMMAND(ID_MENUITEM_C004, OnMenuitemC004)
- ON_COMMAND(ID_MENUITEM_C005, OnMenuitemC005)
- ON_COMMAND(ID_MENUITEM_C006, OnMenuitemC006)
- ON_COMMAND(ID_MENUITEM_C007, OnMenuitemC007)
- ON_COMMAND(ID_MENUITEM_C008, OnMenuitemC008)
- ON_COMMAND(ID_MENUITEM_D001, OnMenuitemD001)
- ON_COMMAND(ID_MENUITEM_D002, OnMenuitemD002)
- ON_COMMAND(ID_MENUITEM_D004, OnMenuitemD004)
- ON_COMMAND(ID_MENUITEM_D005, OnMenuitemD005)
- ON_COMMAND(ID_MENUITEM_D006, OnMenuitemD006)
- ON_COMMAND(ID_MENUITEM_D007, OnMenuitemD007)
- ON_COMMAND(ID_MENUITEM_D008, OnMenuitemD008)
- ON_COMMAND(ID_MENUITEM_D009, OnMenuitemD009)
- ON_COMMAND(ID_MENUITEM_E001, OnMenuitemE001)
- ON_COMMAND(ID_MENUITEM_E002, OnMenuitemE002)
- ON_COMMAND(ID_MENUITEM_E003, OnMenuitemE003)
- ON_COMMAND(ID_MENUITEM_E004, OnMenuitemE004)
- ON_COMMAND(ID_MENUITEM_E005, OnMenuitemE005)
- ON_COMMAND(ID_MENUITEM_E006, OnMenuitemE006)
- ON_COMMAND(ID_MENUITEM_E007, OnMenuitemE007)
- ON_COMMAND(ID_MENUITEM_E008, OnMenuitemE008)
- ON_COMMAND(ID_MENUITEM_E009, OnMenuitemE009)
- ON_COMMAND(ID_MENUITEM_E010, OnMenuitemE010)
- ON_COMMAND(ID_MENUITEM_E011, OnMenuitemE011)
- ON_COMMAND(ID_MENU_MAIN_SYSTEM_PASSWORD, OnMenuMainSystemPassword)
- ON_COMMAND(ID_MENUITEM_A003, OnMenuitemA003)
- ON_COMMAND(ID_MENUITEM_A002, OnMenuitemA002)
- ON_COMMAND(ID_MENUITEM_F001, OnMenuitemF001)
- ON_COMMAND(ID_MENUITEM_F002, OnMenuitemF002)
- ON_COMMAND(ID_MENUITEM_F003, OnMenuitemF003)
- ON_COMMAND(ID_MENUITEM_F004, OnMenuitemF004)
- ON_COMMAND(ID_MENUITEM_F005, OnMenuitemF005)
- ON_COMMAND(ID_MENUITEM_F006, OnMenuitemF006)
- ON_COMMAND(ID_MENUITEM_F007, OnMenuitemF007)
- ON_COMMAND(ID_MENUITEM_F008, OnMenuitemF008)
- ON_COMMAND(ID_MENUITEM_H001, OnMenuitemH001)
- ON_COMMAND(ID_MENUITEM_H002, OnMenuitemH002)
- ON_COMMAND(ID_MENUITEM_H003, OnMenuitemH003)
- ON_COMMAND(ID_MENUITEM_H004, OnMenuitemH004)
- ON_COMMAND(ID_MENUITEM_H005, OnMenuitemH005)
- ON_BN_CLICKED(IDC_BTNRESRESOUT, OnBtnresresout)
- ON_BN_CLICKED(IDC_BTNRESFENLEI, OnBtnresfenlei)
- ON_BN_CLICKED(IDC_BTNRESZILIAO, OnBtnresziliao)
- ON_BN_CLICKED(IDC_BTNGONGYINGSHANG, OnBtngongyingshang)
- ON_BN_CLICKED(IDC_BTNRESREPORT2, OnBtnresreport2)
- ON_BN_CLICKED(IDC_BTNRESREPORT3, OnBtnresreport3)
- ON_BN_CLICKED(IDC_BTNRESREPORT4, OnBtnresreport4)
- ON_BN_CLICKED(IDC_BTNRESREPORT5, OnBtnresreport5)
- ON_BN_CLICKED(IDC_BTNRESREPORT6, OnBtnresreport6)
- ON_COMMAND(ID_MENUITEM_A004, OnMenuitemA004)
- ON_WM_CLOSE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CNCShopDlg message handlers
- BOOL CNCShopDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // Add "About..." menu item to system menu.
- // IDM_ABOUTBOX must be in the system command range.
- ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
- ASSERT(IDM_ABOUTBOX < 0xF000);
- CMenu* pSysMenu = GetSystemMenu(FALSE);
- if (pSysMenu != NULL)
- {
- CString strAboutMenu;
- strAboutMenu.LoadString(IDS_ABOUTBOX);
- if (!strAboutMenu.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_SEPARATOR);
- pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
- }
- }
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
- // TODO: Add extra initialization here
- //菜单初始化
- m_menu.AttachMenu(GetMenu()->GetSafeHmenu(),NULL,CSize(16,16));
- //初始化最大窗体
- SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, NULL);
- //加载快捷键
- m_hAccelTable = LoadAccelerators(AfxGetInstanceHandle(),
- MAKEINTRESOURCE(IDR_ACCELERATORMAIN));
- ASSERT(m_hAccelTable);
- //开始控件按钮的设置
- //仓库
- m_BtnResAll.SetXAlign(1);
- m_BtnResAll.SetFlatBack(RGB(255,255,247));
- m_BtnResAll.SetBackColor(RGB(255,255,247));
- m_BtnResAll.SetFont(&ftButton,TRUE);
- m_BtnResAll.SetForeImage(IDB_BITMAPRESALL,CSize(64,64));
- //进货
- m_BtnResIn.SetXAlign(1);
- m_BtnResIn.SetFlatBack(RGB(255,255,247));
- m_BtnResIn.SetBackColor(RGB(255,255,247));
- m_BtnResIn.SetFont(&ftButton,TRUE);
- m_BtnResIn.SetForeImage(IDB_BITMAPRESIN,CSize(64,64));
- //销售
- m_BtnResOut.SetXAlign(1);
- m_BtnResOut.SetFlatBack(RGB(255,255,247));
- m_BtnResOut.SetBackColor(RGB(255,255,247));
- m_BtnResOut.SetFont(&ftButton,TRUE);
- m_BtnResOut.SetForeImage(IDB_BITMAPRESOUT,CSize(64,64));
- //分类
- m_BtnResFeiLei.SetXAlign(1);
- m_BtnResFeiLei.SetFlatBack(RGB(255,255,247));
- m_BtnResFeiLei.SetBackColor(RGB(255,255,247));
- m_BtnResFeiLei.SetFont(&ftButton,TRUE);
- m_BtnResFeiLei.SetForeImage(IDB_BITMAPSHANGPINFENLEI,CSize(64,64));
- //资料
- m_BtnResZiliao.SetXAlign(1);
- m_BtnResZiliao.SetFlatBack(RGB(255,255,247));
- m_BtnResZiliao.SetBackColor(RGB(255,255,247));
- m_BtnResZiliao.SetFont(&ftButton,TRUE);
- m_BtnResZiliao.SetForeImage(IDB_BITMAPSHANGPINDANGAN,CSize(64,64));
- //供应商
- m_BtnGongYingShang.SetXAlign(1);
- m_BtnGongYingShang.SetFlatBack(RGB(255,255,247));
- m_BtnGongYingShang.SetBackColor(RGB(255,255,247));
- m_BtnGongYingShang.SetFont(&ftButton,TRUE);
- m_BtnGongYingShang.SetForeImage(IDB_BITMAPGONGYINGSHANG,CSize(64,64));
- //管理员分类
- m_StaticAdminFenLei.SetFlatBack(RGB(255,255,247));
- m_StaticAdminFenLei.SetBackColor(RGB(255,255,247));
- m_StaticAdminFenLei.SetFont(&ftPart,TRUE);
- m_StaticAdminFenLei.SetTextColor(RGB(255,0,0));
- m_StaticAdminFenLei.SetXIcon(IDI_ICONMAN);
- //管理员名字
- m_StaticAdminName.SetFlatBack(RGB(255,255,247));
- m_StaticAdminName.SetBackColor(RGB(255,255,247));
- m_StaticAdminName.SetFont(&ftPart,TRUE);
- m_StaticAdminName.SetTextColor(RGB(255,0,0));
- //报表查询按钮
- m_BtnReport1.SetFlatBack(RGB(255,255,247));
- m_BtnReport1.SetBackColor(RGB(255,255,247));
- m_BtnReport1.SetXIcon(IDI_ICONREPORT);
- m_BtnReport1.SetFont(&ftReport,TRUE);
-
- m_BtnReport2.SetFlatBack(RGB(255,255,247));
- m_BtnReport2.SetBackColor(RGB(255,255,247));
- m_BtnReport2.SetXIcon(IDI_ICONREPORT);
- m_BtnReport2.SetFont(&ftReport,TRUE);
- m_BtnReport3.SetFlatBack(RGB(255,255,247));
- m_BtnReport3.SetBackColor(RGB(255,255,247));
- m_BtnReport3.SetXIcon(IDI_ICONREPORT);
- m_BtnReport3.SetFont(&ftReport,TRUE);
- m_BtnReport4.SetFlatBack(RGB(255,255,247));
- m_BtnReport4.SetBackColor(RGB(255,255,247));
- m_BtnReport4.SetXIcon(IDI_ICONREPORT);
- m_BtnReport4.SetFont(&ftReport,TRUE);
- m_BtnReport5.SetFlatBack(RGB(255,255,247));
- m_BtnReport5.SetBackColor(RGB(255,255,247));
- m_BtnReport5.SetXIcon(IDI_ICONREPORT);
- m_BtnReport5.SetFont(&ftReport,TRUE);
- m_BtnReport6.SetFlatBack(RGB(255,255,247));
- m_BtnReport6.SetBackColor(RGB(255,255,247));
- m_BtnReport6.SetXIcon(IDI_ICONREPORT);
- m_BtnReport6.SetFont(&ftReport,TRUE);
- //超市姓名按钮
- m_BtnHead.SetBackImage(IDB_BITMAPHEADER);
- m_BtnHead.SetXAlign(0);
- m_BtnHead.SetTextColor(RGB(255,255,255));
- m_BtnHead.SetFont(&ftHeader);
- //超市网站
- m_BtnHead3.SetBackImage(IDB_BITMAPHEADER3);
- m_BtnHead3.SetXAlign(0);
- m_BtnHead3.SetTextColor(RGB(255,255,255));
- m_BtnHead3.SetFont(&ftHeader);
- //超市联系方式
- m_BtnHead4.SetBackImage(IDB_BITMAPHEADER4);
- m_BtnHead4.SetXAlign(1);
- m_BtnHead4.SetTextColor(RGB(255,255,255));
- m_BtnHead4.SetFont(&ftHeader);
- //时间显示按钮
- m_StaticTime.SetFlatBack(RGB(255,255,247));
- m_StaticTime.SetBackColor(RGB(255,255,247));
- m_StaticTime.SetFont(&ftPart,TRUE);
- m_StaticTime.SetTextColor(RGB(0,0,0));
- //结尾标注
- m_BtnBottom1.SetXAlign(1);
- m_BtnBottom1.SetFont(&ftBottom);
- m_BtnBottom2.SetXAlign(1);
- m_BtnBottom2.SetFont(&ftBottom);
- //超市名称的显示
- CADOConn adoMain;
- CString strSql,str1;
- int intS;
- strSql="select * from 超市基本信息表";
- adoMain.Open(strSql);
- if(!adoMain.adoEOF())
- {
- if(adoMain.MoveFirst())
- {
- str1=adoMain.GetValueString(1,1);
- m_BtnHead.SetWindowText(str1);
- str1=adoMain.GetValueString(3,1);
- m_BtnHead4.SetWindowText(str1);
- UpdateData(FALSE);
- }
- }
- strSql="select * from 管理员基本信息表 where 编号='";
- strSql=strSql+strNo+"'";
- adoMain.Open(strSql);
- if(!adoMain.adoEOF())
- {
- if(adoMain.MoveFirst())
- {
- intS=adoMain.GetValueInt(2);
- if(intS==1)
- {
- m_menu.EnableMenuItem(ID_MENUITEM_A002,MF_GRAYED);
- m_menu.EnableMenuItem(ID_MENUITEM_A003,MF_GRAYED);
- m_menu.EnableMenuItem(ID_MENUITEM_A004,MF_GRAYED);
- }
- }
- }
- adoMain.ExitConnect();
- m_BtnHead3.SetWindowText("欢迎你的到来!");
- //设置管理员分类和管理员的名字显示
- m_StaticAdminFenLei.SetWindowText(strNo);
- m_StaticAdminName.SetWindowText(strName);
- //时间的显示
- CMyTime tm;
- tm.SetNow();
- CString strTime;
- strTime=tm.GetDateString(FALSE)+" "+tm.GetWeek()+" "+tm.GetTimeString(FALSE);
- GetDlgItem(IDC_STATICTIME)->SetWindowText(strTime);
- SetTimer(1,1000,NULL);
- return TRUE; // return TRUE unless you set the focus to a control
- }
- void CNCShopDlg::OnSysCommand(UINT nID, LPARAM lParam)
- {
- if ((nID & 0xFFF0) == IDM_ABOUTBOX)
- {
- CAboutDlg dlgAbout;
- dlgAbout.DoModal();
- }
- else
- {
- CDialog::OnSysCommand(nID, lParam);
- }
- }
- // If you add a minimize button to your dialog, you will need the code below
- // to draw the icon. For MFC applications using the document/view model,
- // this is automatically done for you by the framework.
- void CNCShopDlg::OnPaint()
- {
- if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
- SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
- }
- // The system calls this to obtain the cursor to display while the user drags
- // the minimized window.
- HCURSOR CNCShopDlg::OnQueryDragIcon()
- {
- return (HCURSOR) m_hIcon;
- }
- HBRUSH CNCShopDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
-
- // TODO: Change any attributes of the DC here
- HBRUSH hbr1;
- switch(nCtlColor)
- {
- case CTLCOLOR_DLG:
- hbr1=CreateSolidBrush(RGB(255,255,247));
- return hbr1;
- case CTLCOLOR_STATIC:
- pDC->SetBkMode(TRANSPARENT);
- hbr1=CreateSolidBrush(RGB(255,255,247));
- return hbr1;
- default:
- return hbr;
- }
- // TODO: Return a different brush if the default is not desired
- }
- void CNCShopDlg::OnSize(UINT nType, int cx, int cy)
- {
- CDialog::OnSize(nType, cx, cy);
- m_menu.rcMain.right=cx+3;
- // TODO: Add your message handler code here
-
- }
- void CNCShopDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
- {
- // TODO: Add your message handler code here and/or call default
- m_menu.DrawItem(lpDrawItemStruct);
- CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
- }
- void CNCShopDlg::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
- {
- // TODO: Add your message handler code here and/or call default
- m_menu.MeasureItem(lpMeasureItemStruct);
- CDialog::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
- }
- void CNCShopDlg::OnMenuMainSystemReload()
- {
- // TODO: Add your command handler code here
- CDlgLogo dlgLog;
- CDlgXiaoShouKanDan dlgXiao;
- CString strSql;
- CADOConn adoMain;
- int intS;
- if(dlgLog.DoModal()!=IDOK) ::exit(0);
- strNo=dlgLog.strNo;
- strName=dlgLog.strName;
- strSql="select * from 管理员基本信息表 where 编号='";
- strSql=strSql+strNo+"'";
- adoMain.Open(strSql);
- if(!adoMain.adoEOF())
- {
- if(adoMain.MoveFirst())
- {
- intS=adoMain.GetValueInt(2);
- if(intS==1)
- {
- m_menu.EnableMenuItem(ID_MENUITEM_A002,MF_GRAYED);
- m_menu.EnableMenuItem(ID_MENUITEM_A003,MF_GRAYED);
- m_menu.EnableMenuItem(ID_MENUITEM_A004,MF_GRAYED);
- }
- if(intS==2)
- {
- dlgXiao.DoModal();
- ::exit(0);
- }
- }
- }
- m_StaticAdminFenLei.SetWindowText(strNo);
- m_StaticAdminName.SetWindowText(strName);
- }
- BOOL CNCShopDlg::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- if (m_hAccelTable)
- {
- if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg))
- return(TRUE);
- }
- return CDialog::PreTranslateMessage(pMsg);
- }
- void CNCShopDlg::OnMenuMainSystemQuit()
- {
- // TODO: Add your command handler code here
- CDlgQuit dlg;
- CADOConn adoMain;
- CString str;
- if(dlg.DoModal()==IDOK)
- {
- if(dlg.m_intStyle==0) OnMenuitemH001();
- str=strNo+" "+"退出系统";
- adoMain.WriteLog(str);
- CDialog::OnOK();
- }
- }
- void CNCShopDlg::OnBtnresin()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemC001();
- }
- void CNCShopDlg::OnBtnresreport1()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemC007();
- }
- void CNCShopDlg::OnMenuAboutAbout()
- {
- // TODO: Add your command handler code here
- CAboutDlg dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuToolsCals()
- {
- // TODO: Add your command handler code here
- CFileOperate fileMain;
- CString strPath=fileMain.GetAppPath();
- strPath="C:\WINDOWS\system32\calc.exe";
- ShellExecute(NULL,"open",strPath,"","",SW_SHOW);
- }
- void CNCShopDlg::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- CMyTime tm;
- tm.SetNow();
- CString strTime;
- strTime=tm.GetDateString(FALSE)+" "+tm.GetWeek()+" "+tm.GetTimeString(FALSE);
- switch(nIDEvent)
- {
- case 1://时间显示
- m_StaticTime.SetWindowText(strTime);
- break;
- default:
- break;
- }
- CDialog::OnTimer(nIDEvent);
- }
- void CAboutDlg::OnOk()
- {
- // TODO: Add your control notification handler code here
- CDialog::OnOK();
- }
- BOOL CAboutDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_Btn1.SetXAlign(1);
- m_Btn2.SetXAlign(1);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CNCShopDlg::OnMenuitemB001()
- {
- // TODO: Add your command handler code here
- CDlgChaoShiBase dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB002()
- {
- // TODO: Add your command handler code here
- CDlgFenJiBase dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB003()
- {
- // TODO: Add your command handler code here
- CDlgFenLeiBase dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB004()
- {
- // TODO: Add your command handler code here
- CDlgDanganBase dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB006()
- {
- // TODO: Add your command handler code here
- CDlgJiaGeSheZhi dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB007()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="商品分类报表";
- dlg.strSql="select * from 商品分类基本信息表";
- dlg.intOpen=3;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB005()
- {
- // TODO: Add your command handler code here
- CDlgGongYingShangBase dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB008()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="商品档案报表";
- dlg.strSql="select * from 商品档案基本信息表";
- dlg.intOpen=10;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB009()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="供应商档案统计报表";
- dlg.strSql="select * from 供应商基本信息表";
- dlg.intOpen=7;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemB010()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="分机信息报表";
- dlg.strSql="select * from 分机基本信息表";
- dlg.intOpen=3;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemC001()
- {
- // TODO: Add your command handler code here
- CDlgJinHuoKanDan dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemC002()
- {
- // TODO: Add your command handler code here
- CDlgJinHuoTuiDan dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemC003()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="进货单统计报表";
- dlg.strSql="select * from 进货单统计表";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemC004()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="进货退货单统计表";
- dlg.strSql="select * from 进货退货单统计表";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemC005()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="进货商品统计表";
- dlg.strSql="select * from 进货商品管理表";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemC006()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="进货商品统计表";
- dlg.strSql="select 进货商品管理表.* from 进货商品管理表,进货退货单统计表 where 进货商品管理表.单编号=进货退货单统计表.单编号";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemC007()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="进货商品统计表";
- dlg.strSql="select 进货商品管理表.* from 进货商品管理表,进货退货单统计表 where 进货商品管理表.单编号 not like 进货退货单统计表.单编号";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemC008()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- CMyTime time1;
- CString str1,str2;
- time1.SetNow();
- str1=time1.GetSimpleString();
- str2=str1.Left(6);
- dlg.strTitle="进货商品统计表";
- dlg.strSql="select 进货商品管理表.* from 进货商品管理表,进货退货单统计表 ";
- dlg.strSql=dlg.strSql+"where 进货商品管理表.单编号 not like 进货退货单统计表.单编号 and ";
- dlg.strSql=dlg.strSql+"进货商品管理表.单编号 like '"+str2+"%'";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemD001()
- {
- // TODO: Add your command handler code here
- CDlgXiaoShouKanDan dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemD002()
- {
- // TODO: Add your command handler code here
- CDlgXiaoShouTuiDan dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemD004()
- {
- CDLgReport dlg;
- dlg.strTitle="销售单统计报表";
- dlg.strSql="select * from 销售单统计表";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemD005()
- {
- CDLgReport dlg;
- dlg.strTitle="销售退货单统计表";
- dlg.strSql="select * from 销售退货单统计表";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemD006()
- {
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="select * from 销售商品管理表";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemD007()
- {
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="select 销售商品管理表.* from 销售商品管理表,销售退货单统计表 where 销售商品管理表.单编号=销售退货单统计表.单编号";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemD008()
- {
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="select 销售商品管理表.* from 销售商品管理表,销售退货单统计表 where 销售商品管理表.单编号 not like 销售退货单统计表.单编号";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemD009()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- CMyTime time1;
- CString str1,str2;
- time1.SetNow();
- str1=time1.GetSimpleString();
- str2=str1.Left(6);
- dlg.strTitle="销售商品统计表";
- dlg.strSql="select 销售商品管理表.*,商品库存数量统计表.进货价 from 销售商品管理表,销售退货单统计表,";
- dlg.strSql=dlg.strSql+"商品库存数量统计表 where 销售商品管理表.单编号 not like 销售退货单统计表.单编号 ";
- dlg.strSql=dlg.strSql+"and 销售商品管理表.条形码=商品库存数量统计表.条形码 and ";
- dlg.strSql=dlg.strSql+"销售商品管理表.单编号 like '"+str2+"%'";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE001()
- {
- // TODO: Add your command handler code here
- CDlgRuKuKaiDan dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE002()
- {
- // TODO: Add your command handler code here
- CDlgChuKuKanDan dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE003()
- {
- // TODO: Add your command handler code here
- CString strSql;
- CDLgReport dlg;
- strSql="SELECT 商品档案基本信息表.*, 商品库存数量统计表.进货价, 商品库存数量统计表.零售价,";
- strSql=strSql+"商品库存数量统计表.会员价, 商品库存数量统计表.业务提成, " ;
- strSql=strSql+"商品库存数量统计表.库存 FROM 商品档案基本信息表 INNER JOIN 商品库存数量统计表 ON ";
- strSql=strSql+"商品档案基本信息表.条形码 = 商品库存数量统计表.条形码";
- dlg.strTitle="商品库存统计表";
- dlg.strSql=strSql;
- dlg.intOpen=16;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE004()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="非进货单统计报表";
- dlg.strSql="select * from 非进货单统计表";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE005()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="非销售单统计报表";
- dlg.strSql="select * from 非销售单统计表";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE006()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="非进货商品统计表";
- dlg.strSql="select * from 非进货商品管理表";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE007()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="非销售商品统计表";
- dlg.strSql="select * from 非销售商品管理表";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE008()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="过少报警商品统计表";
- dlg.strSql="select 商品档案基本信息表.*,商品库存数量统计表.库存";
- dlg.strSql=dlg.strSql+" from 商品档案基本信息表,商品库存数量统计表";
- dlg.strSql=dlg.strSql+" where 商品档案基本信息表.条形码=商品库存数量统计表.条形码 and ";
- dlg.strSql=dlg.strSql+" 商品档案基本信息表.库存下限>商品库存数量统计表.库存";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE009()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="过少报警商品统计表";
- dlg.strSql="select 商品档案基本信息表.*,商品库存数量统计表.库存";
- dlg.strSql=dlg.strSql+" from 商品档案基本信息表,商品库存数量统计表";
- dlg.strSql=dlg.strSql+" where 商品档案基本信息表.条形码=商品库存数量统计表.条形码 and ";
- dlg.strSql=dlg.strSql+" 商品档案基本信息表.库存上限<商品库存数量统计表.库存";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE010()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- CMyTime time1;
- CString str1,str2;
- time1.SetNow();
- str1=time1.GetSimpleString();
- str2=str1.Left(6);
- dlg.strTitle="非进货商品统计表";
- dlg.strSql="select * from 非进货商品管理表 ";
- dlg.strSql=dlg.strSql+"where ";
- dlg.strSql=dlg.strSql+"非进货商品管理表.单编号 like '"+str2+"%'";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemE011()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- CMyTime time1;
- CString str1,str2;
- time1.SetNow();
- str1=time1.GetSimpleString();
- str2=str1.Left(6);
- dlg.strTitle="非销售商品统计表";
- dlg.strSql="select * from 非销售商品管理表 ";
- dlg.strSql=dlg.strSql+"where ";
- dlg.strSql=dlg.strSql+"非销售商品管理表.单编号 like '"+str2+"%'";
- dlg.intOpen=4;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuMainSystemPassword()
- {
- // TODO: Add your command handler code here
- CDlgPwd dlg;
- dlg.strNo=strNo;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemA003()
- {
- // TODO: Add your command handler code here
- CFileOperate fileMain;
- CString strPath;
- strPath=fileMain.GetAppPath()+"\data\LOG\";
- ShellExecute(NULL,"open",strPath,"","",SW_SHOW);
- }
- void CNCShopDlg::OnMenuitemA002()
- {
- // TODO: Add your command handler code here
- CDlgYongHuGuanLi dlg;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemF001()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="SELECT 销售单统计表.*, 销售商品管理表.条形码, 商品档案基本信息表.名称,";
- dlg.strSql=dlg.strSql+"销售商品管理表.销售单价,商品库存数量统计表.业务提成,销售商品管理表.数量";
- dlg.strSql=dlg.strSql+" from ((销售单统计表 INNER JOIN 销售商品管理表 ON 销售单统计表.单编号 = 销售商品管理表.单编号)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品档案基本信息表 ON 销售商品管理表.条形码 = 商品档案基本信息表.条形码)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品库存数量统计表 ON 销售商品管理表.条形码 = 商品库存数量统计表.条形码";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemF002()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="SELECT 销售单统计表.*, 销售商品管理表.条形码, 商品档案基本信息表.名称,";
- dlg.strSql=dlg.strSql+"销售商品管理表.销售单价,销售商品管理表.数量";
- dlg.strSql=dlg.strSql+" from ((销售单统计表 INNER JOIN 销售商品管理表 ON 销售单统计表.单编号 = 销售商品管理表.单编号)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品档案基本信息表 ON 销售商品管理表.条形码 = 商品档案基本信息表.条形码)";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemF003()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- CMyTime time1;
- CString str1,str2;
- time1.SetNow();
- str1=time1.GetSimpleString();
- str2=str1.Left(6);
- dlg.strTitle="销售商品统计表";
- dlg.strSql="SELECT 销售单统计表.*, 销售商品管理表.条形码, 商品档案基本信息表.名称,";
- dlg.strSql=dlg.strSql+"销售商品管理表.销售单价,商品库存数量统计表.业务提成,销售商品管理表.数量";
- dlg.strSql=dlg.strSql+" from ((销售单统计表 INNER JOIN 销售商品管理表 ON 销售单统计表.单编号 = 销售商品管理表.单编号)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品档案基本信息表 ON 销售商品管理表.条形码 = 商品档案基本信息表.条形码)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品库存数量统计表 ON 销售商品管理表.条形码 = 商品库存数量统计表.条形码";
- dlg.strSql=dlg.strSql+" where 销售单统计表.单编号 like '"+str2+"%'";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemF004()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- CMyTime time1;
- CString str1,str2;
- time1.SetNow();
- str1=time1.GetSimpleString();
- str2=str1.Left(8);
- dlg.strTitle="销售商品统计表";
- dlg.strSql="SELECT 销售单统计表.*, 销售商品管理表.条形码, 商品档案基本信息表.名称,";
- dlg.strSql=dlg.strSql+"销售商品管理表.销售单价,商品库存数量统计表.业务提成,销售商品管理表.数量";
- dlg.strSql=dlg.strSql+" from ((销售单统计表 INNER JOIN 销售商品管理表 ON 销售单统计表.单编号 = 销售商品管理表.单编号)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品档案基本信息表 ON 销售商品管理表.条形码 = 商品档案基本信息表.条形码)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品库存数量统计表 ON 销售商品管理表.条形码 = 商品库存数量统计表.条形码";
- dlg.strSql=dlg.strSql+" where 销售单统计表.单编号 like '"+str2+"%'";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemF005()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="SELECT 销售单统计表.*, 销售商品管理表.条形码, 商品档案基本信息表.名称,";
- dlg.strSql=dlg.strSql+"销售商品管理表.销售单价,商品库存数量统计表.进货价,销售商品管理表.数量";
- dlg.strSql=dlg.strSql+" from ((销售单统计表 INNER JOIN 销售商品管理表 ON 销售单统计表.单编号 = 销售商品管理表.单编号)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品档案基本信息表 ON 销售商品管理表.条形码 = 商品档案基本信息表.条形码)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品库存数量统计表 ON 销售商品管理表.条形码 = 商品库存数量统计表.条形码";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemF006()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="SELECT 销售单统计表.*, 销售商品管理表.条形码, 商品档案基本信息表.名称,";
- dlg.strSql=dlg.strSql+"销售商品管理表.销售单价,商品库存数量统计表.进货价,销售商品管理表.数量";
- dlg.strSql=dlg.strSql+" from ((销售单统计表 INNER JOIN 销售商品管理表 ON 销售单统计表.单编号 = 销售商品管理表.单编号)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品档案基本信息表 ON 销售商品管理表.条形码 = 商品档案基本信息表.条形码)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品库存数量统计表 ON 销售商品管理表.条形码 = 商品库存数量统计表.条形码";
- dlg.strSql=dlg.strSql+" where 商品库存数量统计表.进货价<=销售商品管理表.销售单价";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemF007()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="SELECT 销售单统计表.*, 销售商品管理表.条形码, 商品档案基本信息表.名称,";
- dlg.strSql=dlg.strSql+"销售商品管理表.销售单价,商品库存数量统计表.进货价,销售商品管理表.数量";
- dlg.strSql=dlg.strSql+" from ((销售单统计表 INNER JOIN 销售商品管理表 ON 销售单统计表.单编号 = 销售商品管理表.单编号)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品档案基本信息表 ON 销售商品管理表.条形码 = 商品档案基本信息表.条形码)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品库存数量统计表 ON 销售商品管理表.条形码 = 商品库存数量统计表.条形码";
- dlg.strSql=dlg.strSql+" where 商品库存数量统计表.进货价>销售商品管理表.销售单价";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemF008()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="销售商品统计表";
- dlg.strSql="SELECT 销售单统计表.*, 销售商品管理表.条形码, 商品档案基本信息表.名称,";
- dlg.strSql=dlg.strSql+"销售商品管理表.销售单价,商品库存数量统计表.进货价,销售商品管理表.数量";
- dlg.strSql=dlg.strSql+" from ((销售单统计表 INNER JOIN 销售商品管理表 ON 销售单统计表.单编号 = 销售商品管理表.单编号)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品档案基本信息表 ON 销售商品管理表.条形码 = 商品档案基本信息表.条形码)";
- dlg.strSql=dlg.strSql+" INNER JOIN 商品库存数量统计表 ON 销售商品管理表.条形码 = 商品库存数量统计表.条形码";
- dlg.intOpen=5;
- dlg.DoModal();
- }
- void CNCShopDlg::OnMenuitemH001()
- {
- // TODO: Add your command handler code here
- CFileOperate fileMain;
- CMyTime time1;
- CADOConn adoMain;
- time1.SetNow();
- CString strOld=fileMain.GetAppPath()+"\data\data.mdb";
- CString strPath=fileMain.GetAppPath()+"\data\BACKUP\"+time1.GetSimpleString()+".mdb";
- if(CopyFile(strOld,strPath,FALSE))
- {
- MessageBox("备份成功!","提示",MB_OK|MB_ICONINFORMATION);
- strPath="数据库备份 "+strPath;
- adoMain.WriteLog(strPath);
- }
- else
- {
- MessageBox("备份失败!请重新启动程序予以备份!","提示",MB_OK|MB_ICONWARNING);
- }
- }
- void CNCShopDlg::OnMenuitemH002()
- {
- // TODO: Add your command handler code here
- CFileOperate fileMain;
- CADOConn adoMain;
- CFileDialog filedlg(TRUE,"mdb",fileMain.GetAppPath()+"\data\BACKUP\*.mdb",OFN_NOCHANGEDIR,"数据库文件(*.mdb)|*.mdb");
- CString strNew=fileMain.GetAppPath()+"\data\data.mdb";
- if(filedlg.DoModal()==IDOK)
- {
- if(MessageBox("确定恢复吗?此操作将会覆盖现有数据库!","",MB_OKCANCEL+MB_ICONQUESTION)!=IDOK) return;
- DeleteFile(strNew);
- CopyFile(filedlg.GetPathName(),strNew,FALSE);
- strNew="数据库恢复 "+filedlg.GetPathName();
- adoMain.WriteLog(strNew);
- }
- }
- void CNCShopDlg::OnMenuitemH003()
- {
- // TODO: Add your command handler code here
- if(MessageBox("确定数据清理吗?此操作将删除库中所有数据!","提示",MB_OKCANCEL|MB_ICONQUESTION)!=IDOK) return;
- CFileOperate fileMain;
- CADOConn adoMain;
- CString strNew=fileMain.GetAppPath()+"\data\data.mdb";
- CString strOld=fileMain.GetAppPath()+"\data\MAIN\data.mdb";
- DeleteFile(strNew);
- CopyFile(strOld,strNew,FALSE);
- strNew="数据库恢复 "+strOld;
- adoMain.WriteLog(strNew);
-
- }
- void CNCShopDlg::OnMenuitemH004()
- {
- // TODO: Add your command handler code here
- if(MessageBox("确定建账吗?此操作将删除库中所有数据!","提示",MB_OKCANCEL|MB_ICONQUESTION)!=IDOK) return;
- OnMenuitemH001();
- CString strSql;
- CADOConn adoMain;
- CString str[10]={"进货单统计表","进货商品管理表","进货退货单统计表",
- "销售单统计表","销售商品管理表","销售退货单统计表",
- "非进货单统计表","非进货商品管理表","非销售单统计表",
- "非销售商品管理表"};
- for(int i=0;i<10;i++)
- {
- strSql="delete from "+str[i];
- adoMain.ExecuteSQL(strSql);
- }
- strSql="update 商品库存数量统计表 set 零售价=0,会员价=0,业务提成=0";
- adoMain.ExecuteSQL(strSql);
- MessageBox("建账成功!","提示",MB_OK|MB_ICONINFORMATION);
- adoMain.ExitConnect();
- }
- void CNCShopDlg::OnMenuitemH005()
- {
- // TODO: Add your command handler code here
- if(MessageBox("确定建账吗?此操作将删除库中所有数据!","提示",MB_OKCANCEL|MB_ICONQUESTION)!=IDOK) return;
- OnMenuitemH001();
- CString strSql;
- CADOConn adoMain;
- CString str[10]={"进货单统计表","进货商品管理表","进货退货单统计表",
- "销售单统计表","销售商品管理表","销售退货单统计表",
- "非进货单统计表","非进货商品管理表","非销售单统计表",
- "非销售商品管理表"};
- for(int i=0;i<10;i++)
- {
- strSql="delete from "+str[i];
- adoMain.ExecuteSQL(strSql);
- }
- MessageBox("建账成功!","提示",MB_OK|MB_ICONINFORMATION);
- adoMain.ExitConnect();
- }
- void CNCShopDlg::OnBtnresresout()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemD001();
- }
- void CNCShopDlg::OnBtnresfenlei()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemB003();
- }
- void CNCShopDlg::OnBtnresziliao()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemB004();
- }
- void CNCShopDlg::OnBtngongyingshang()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemB005();
- }
- void CNCShopDlg::OnBtnresreport2()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemE003();
- }
- void CNCShopDlg::OnBtnresreport3()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemD008();
- }
- void CNCShopDlg::OnBtnresreport4()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemE008();
- }
- void CNCShopDlg::OnBtnresreport5()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemE009();
- }
- void CNCShopDlg::OnBtnresreport6()
- {
- // TODO: Add your control notification handler code here
- OnMenuitemF004();
- }
- void CNCShopDlg::OnMenuitemA004()
- {
- // TODO: Add your command handler code here
- CDLgReport dlg;
- dlg.strTitle="管理员统计报表";
- dlg.strSql="select * from 管理员基本信息表";
- dlg.intOpen=7;
- dlg.DoModal();
- }
- void CNCShopDlg::OnClose()
- {
- // TODO: Add your message handler code here and/or call default
- OnMenuMainSystemQuit();
- }