【VC开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VC开源代码-DMain.cpp的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
// DMain.cpp : implementation file
//
#include "stdafx.h"
#include "wzglxt.h"
#include "DMain.h"
#include "DBaseQuery.h"
#include "DMerchandise.h"
#include "DPersonnel.h"
#include "DComAndGo.h"
#include "DStore.h"
#include "DUnit.h"
#include "DInput.h"
#include "DCheck.h"
#include "DSellQuery.h"
#include "DStoreQuwery.h"
#include "DSetup.h"
#include "DTotal.h"
#include "DBAK.h"
#include "DResume.h"
#include "DOP.h"
#include "externDllHeader.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDMain dialog
extern CQpglxtApp theApp;
CDMain::CDMain(CWnd* pParent /*=NULL*/)
: CDialog(CDMain::IDD, pParent)
{
//{{AFX_DATA_INIT(CDMain)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDMain::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDMain)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDMain, CDialog)
//{{AFX_MSG_MAP(CDMain)
ON_WM_PAINT()
//}}AFX_MSG_MAP
ON_COMMAND(IDM_RCYW_JHDJ, OnJHDJ)
ON_COMMAND(IDM_RCYW_THFC,OnTHFC)
ON_COMMAND(IDM_RCYW_XSDJ, OnXSDJ)
ON_COMMAND(IDM_RCYW_XSTH,OnXSTH)
ON_COMMAND(IDM_KCGL_KCCX, OnKCCX)
ON_COMMAND(IDM_KCGL_KCPD,OnKCPD)
ON_COMMAND(IDM_KCGL_THGL, OnTHGL)
ON_COMMAND(IDM_CXTJ_XSCX,OnXSCX)
ON_COMMAND(IDM_CXTJ_XSTHCX, OnXSTHCX)
ON_COMMAND(IDM_CXTJ_JHCX,OnJHCX)
ON_COMMAND(IDM_CXTJ_THFCCX, OnTHFCCX)
ON_COMMAND(IDM_CXTJ_XSTJ,OnXSTJ)
ON_COMMAND(IDM_JCXX_SPXXGL,OnSPXXGL)
ON_COMMAND(IDM_JCXX_WLDWGL, OnWLDWGL)
ON_COMMAND(IDM_JCXX_YGXXGL,OnYGXXGL)
ON_COMMAND(IDM_JCXX_CKXXGL, OnCKXXGL)
// ON_COMMAND(IDM_JCXX_DYXXSZ,OnDYXXSZ)
ON_COMMAND(IDM_JCXX_JLDWSZ, OnJLDWSZ)
ON_COMMAND(IDM_JCXX_YHXXSZ,OnYHXXSZ)
ON_COMMAND(IDM_XTGL_SJBF,OnSJBF)
ON_COMMAND(IDM_XTGL_SJHF, OnSJHF)
ON_COMMAND(IDM_XTGL_XTSZ,OnXTSZ)
ON_COMMAND(IDM_XTGL_CZYGL,OnCZYGL)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDMain message handlers
void CDMain::OnOK()
{
// TODO: Add extra validation here
//CDialog::OnOK();
}
BOOL CDMain::OnInitDialog()
{
CDialog::OnInitDialog();
int nICO[16]={IDI_ICON1,IDI_ICON1,IDI_ICON2,IDI_ICON3,IDI_ICON3,IDI_ICON4,IDI_ICON5,IDI_ICON6,IDI_ICON6,IDI_ICON7,IDI_ICON8,IDI_ICON9,IDI_ICON9,IDI_ICON10,IDI_ICON10,IDI_ICON11};
this->ShowWindow(SW_SHOWMAXIMIZED);
TBBUTTON button[16];
int i=0,nStringLength;
CString string;
TCHAR * pString;
//建立ImageList对象及ToolBar对象
m_ImageList.Create(32,32,ILC_COLOR32|ILC_MASK,0,0); //创建一个图象列表框
m_ToolBar.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,ID_TOOLBAR);
//向ImageList对象中添加资源图标
for(i=0;i<16;i++)
{
m_ImageList.Add(::LoadIcon(::AfxGetResourceHandle(),MAKEINTRESOURCE(nICO[i]))); //向图像列表框中添加图片
}
m_ToolBar.SetImageList(&m_ImageList);
m_ToolBar.EnableAutomation();
for(i=0;i<16;i++)
{
button[i].dwData=0;
button[i].fsState=TBSTATE_ENABLED;
if(i!=1 && i!=4&&i!=8&&i!=12&&i!=14)
button[i].fsStyle=TBSTYLE_BUTTON ;
else
button[i].fsStyle=TBSTYLE_SEP;
button[i].iBitmap=i;
string.LoadString(i + IDS_STR_TOOLBAR1);//装载字符串资源
//为每一个字符串再加一个'\0',用于向工具栏里加字符串
nStringLength= string.GetLength() + 1;
pString = string.GetBufferSetLength(nStringLength);
//pString[nStringLength] = 0;
//返回刚加的字符串的编号
button[i].iString =m_ToolBar.AddStrings(pString);
string.ReleaseBuffer();
}
button[0].idCommand=IDM_XTGL_XTSZ;
button[2].idCommand=IDM_JCXX_SPXXGL;
button[3].idCommand=IDM_JCXX_CKXXGL;
button[5].idCommand=IDM_RCYW_JHDJ;
button[6].idCommand=IDM_RCYW_XSDJ;
button[7].idCommand=IDM_RCYW_XSTH;
button[9].idCommand=IDM_KCGL_KCCX;
button[10].idCommand=IDM_KCGL_KCPD;
button[11].idCommand=IDM_KCGL_THGL;
button[13].idCommand=IDM_CXTJ_XSTJ;
button[15].idCommand=IDM_XTGL_SJBF;
m_ToolBar.AddButtons(16,button);
m_ToolBar.AutoSize();
m_ToolBar.SetStyle(TBSTYLE_FLAT|CCS_TOP);
this->UpdateWindow();
m_StatusBar.EnableAutomation();
m_StatusBar.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,ID_STATUSBAR);
int xpos=::GetSystemMetrics(SM_CXSCREEN);
int width[4];
width[1]=xpos*0.2;
width[2]=xpos*0.74;
width[3]=xpos*0.86;
width[4]=xpos;
CString sText;
sText="操作员:【"+OP+"】";
m_StatusBar.SetParts(4,&width[1]);
RxRecordset NameStr;
NameStr.Open("系统设置表");
if(NameStr.GetRecordCount()<1)
m_StatusBar.SetText("吉林省明日科技有限公司",0,SBT_NOBORDERS);
else
m_StatusBar.SetText(NameStr.GetFieldValue("公司名称"),0,SBT_NOBORDERS);
m_StatusBar.SetText(sText,3,SBT_NOBORDERS);
this->SetWindowText("物资管理系统V1.0版--"+sText);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDMain::OnJHDJ()
{
//进货登记
CDInput dlg;
dlg.m_Caption="进货管理";
dlg.DoModal();
}
void CDMain::OnTHFC()
{
//退货返厂
CDInput dlg;
dlg.m_Caption="退货返厂管理";
dlg.DoModal();
}
void CDMain::OnXSDJ()
{
CDInput dlg;
dlg.m_Caption="销售管理";
dlg.DoModal();
//销售登记
}
void CDMain::OnXSTH()
{
CDInput dlg;
dlg.m_Caption="销售退货管理";
dlg.DoModal();
//销售退货
}
void CDMain::OnKCCX()
{
RxRecordset brst;
CString sName,stime;
CTime ttime;
brst.Open("系统设置表");
sName=brst.GetFieldValue("公司名称");
sName=sName+"库存查询报表";
m_ps.MainCaption=sName;
m_ps.DeckCaptionNumber=2;
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.DeckCaptions[0]="日期:"+stime;
m_ps.DeckCaptions[1]="操作员:"+OP;
CDStoreQuwery dlg;
dlg.DoModal();
//库存查询
}
void CDMain::OnKCPD()
{
CDCheck dlg;
dlg.DoModal();
//库存盘点
}
void CDMain::OnTHGL()
{
CDInput dlg;
dlg.m_Caption="商品调拨管理";
dlg.DoModal();
//调货管理
}
void CDMain::OnXSCX()
{
//销售查询
CDSellQuery dlg;
dlg.SetDateBase("销售查询");
dlg.SetCaption("销售查询");
dlg.DoModal();
}
void CDMain::OnXSTHCX()
{
//销售退货查询
CDSellQuery dlg;
dlg.SetDateBase("销售退货查询");
dlg.SetCaption("销售退货查询");
dlg.DoModal();
}
void CDMain::OnJHCX()
{
CDSel
上一篇:
Client_info_U.pas
下一篇:
白色姜花,略微开了