【VC开源代码栏目提醒】:网学会员为广大网友收集整理了,DlgStockApply.cpp,希望对大家有所帮助!
// DlgStockApply.cpp : implementation file
//
#include "stdafx.h"
#include "MerchandiseStore.h"
#include "DlgStockApply.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "Database.h"
//-------------global
extern CDatabase m_hDatabase ;
//------------end
/////////////////////////////////////////////////////////////////////////////
// CDlgStockApply dialog
CDlgStockApply::CDlgStockApply(CWnd* pParent /*=NULL*/)
: CDialog(CDlgStockApply::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgStockApply)
//}}AFX_DATA_INIT
}
void CDlgStockApply::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgStockApply)
DDX_Control(pDX, IDC_TAB_StockApply, m_hTabStockApply);
DDX_Control(pDX, IDC_LIST_StockApply, m_hListStockApply);
DDX_Control(pDX, IDOK, m_hBtnOk);
DDX_Control(pDX, IDC_EDIT_unitprice, m_hEditUnitprice);
DDX_Control(pDX, IDC_EDIT_SUM, m_hEditSum);
DDX_Control(pDX, IDC_EDIT_StockName, m_hEditStockname);
DDX_Control(pDX, IDC_EDIT_Rebate, m_hEditRebate);
DDX_Control(pDX, IDC_EDIT_purpose, m_hEditPurpose);
DDX_Control(pDX, IDC_EDIT_providerid, m_hEditProviderid);
DDX_Control(pDX, IDC_EDIT_proposer, m_hEditProposer);
DDX_Control(pDX, IDC_EDIT_Paymoney, m_hEditPaymoney);
DDX_Control(pDX, IDC_EDIT_orderform, m_hEditOrderform);
DDX_Control(pDX, IDC_EDIT_merchandiseID, m_hEditMerchandiseID);
DDX_Control(pDX, IDC_EDIT_MEMO, m_hEditMemo);
DDX_Control(pDX, IDC_EDIT_billmaker, m_hEditBillmaker);
DDX_Control(pDX, IDC_EDIT_APPID, m_hEditAppid);
DDX_Control(pDX, IDC_DTP_AppDate, m_hDtpAppdate);
DDX_Control(pDX, IDC_DTP_BestTime, m_hDtpBesttime);
DDX_Control(pDX, IDC_CMB_DEPARTMENT, m_hCmbDepartment);
DDX_Control(pDX, IDC_BTN_SAVE, m_hBtnSave);
DDX_Control(pDX, IDC_BTN_MOD, m_hBtnMod);
DDX_Control(pDX, IDC_BTN_DEL, m_hBtnDel);
DDX_Control(pDX, IDC_BTN_ADD, m_hBtnAdd);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgStockApply, CDialog)
//{{AFX_MSG_MAP(CDlgStockApply)
ON_BN_CLICKED(IDC_BTN_ADD, OnBtnAdd)
ON_BN_CLICKED(IDC_BTN_DEL, OnBtnDel)
ON_BN_CLICKED(IDC_BTN_MOD, OnBtnMod)
ON_BN_CLICKED(IDC_BTN_SAVE, OnBtnSave)
ON_NOTIFY(NM_CLICK, IDC_LIST_StockApply, OnClickLISTStockApply)
ON_NOTIFY(NM_DBLCLK, IDC_LIST_StockApply, OnDblclkLISTStockApply)
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_StockApply, OnSelchangeTABStockApply)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgStockApply message handlers
BOOL CDlgStockApply::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
InitCtrlData() ;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgStockApply::InitCtrlData()
{
//Init tab ctrl
m_hTabStockApply.InsertItem(0, "采购申请基本信息") ;
m_hTabStockApply.InsertItem(1, "采购申请信息列表") ;
m_hTabStockApply.ShowWindow(TRUE) ;
m_hListStockApply.InsertColumn(0, "申请单号", LVCFMT_CENTER, 50) ;
m_hListStockApply.InsertColumn(1, "使用部门", LVCFMT_CENTER, 100) ;
m_hListStockApply.InsertColumn(2, "申请人", LVCFMT_CENTER, 50) ;
m_hListStockApply.InsertColumn(3, "制表人", LVCFMT_CENTER, 50) ;
m_hListStockApply.InsertColumn(4, "备注", LVCFMT_CENTER, 60) ;
m_hListStockApply.InsertColumn(5, "商品编号", LVCFMT_CENTER, 50) ;
m_hListStockApply.InsertColumn(6, "单价", LVCFMT_CENTER, 50) ;
m_hListStockApply.InsertColumn(7, "数量", LVCFMT_CENTER, 50) ;