?? 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 + -