📄 takeoutmandlg.cpp
字号:
// TakeOutManDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Stock.h"
#include "TakeOutManDlg.h"
#include "TakeOutEditDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTakeOutManDlg dialog
CTakeOutManDlg::CTakeOutManDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTakeOutManDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTakeOutManDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTakeOutManDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTakeOutManDlg)
DDX_Control(pDX, IDC_YEAR_COMBO, m_year);
DDX_Control(pDX, IDC_MONTH_COMBO, m_month);
DDX_Control(pDX, IDC_ADODC1, m_adodc);
DDX_Control(pDX, IDC_DATAGRID1, m_datagrid);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTakeOutManDlg, CDialog)
//{{AFX_MSG_MAP(CTakeOutManDlg)
ON_BN_CLICKED(IDC_ADD_BUTTON, OnAddButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTakeOutManDlg message handlers
void CTakeOutManDlg::Refresh_Data()
{
//读取月份信息
CString cYear, cMonth;
int index;
index = m_year.GetCurSel();
m_year.GetLBText(index, cYear);
index = m_month.GetCurSel();
m_month.GetLBText(index, cMonth);
//设置SELECT语句
CString cSource;
cSource = "SELECT t.Ttype AS 出库类型, p.Pname AS 产品名称,";
cSource += " t.Pprice AS 单价, t.Pnum AS 数量, t.Pprice * t.Pnum AS 总价格,";
cSource += " c.Cname AS 客户单位, s.Sname AS 出库仓库, t.EmpName AS 经办用户,";
cSource += " t.OptDate AS 出库日期 FROM TakeOut t, Product p, Client c, Storehouse s";
cSource += " WHERE t.Pid*=p.Pid AND t.Cid*=c.Cid AND t.Sid*=s.Sid";
cSource += " AND t.OptDate LIKE '%" + cYear + "-" + cMonth + "%'";
//设置记录源
m_adodc.SetRecordSource(cSource);
m_adodc.Refresh();
}
BOOL CTakeOutManDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CTime t = CTime::GetCurrentTime(); //读取当前系统日期
int iYear, iMonth;
iYear = t.GetYear();
iMonth = t.GetMonth();
m_year.SetCurSel(iYear - 2000);
m_month.SetCurSel(iMonth - 1);
Refresh_Data();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CTakeOutManDlg::OnAddButton()
{
// TODO: Add your control notification handler code here
CTakeOutEditDlg dlg;
if (dlg.DoModal() == IDOK)
Refresh_Data();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -