【VC开源代码栏目提醒】:网学会员在VC开源代码频道为大家收集整理了DlgSell.cpp提供大家参考,希望对大家有所帮助!
// DlgSell.cpp : implementation file
//
#include "stdafx.h"
#include "merchandisesell.h"
#include "DlgSell.h"
#include "Database.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//-------------global
extern CDatabase m_hDatabase ;
//------------end
/////////////////////////////////////////////////////////////////////////////
// CDlgSell dialog
CDlgSell::CDlgSell(CWnd* pParent /*=NULL*/)
: CDialog(CDlgSell::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgSell)
//}}AFX_DATA_INIT
}
void CDlgSell::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgSell)
DDX_Control(pDX, IDC_BTN_FIND, m_hBtnFind);
DDX_Control(pDX, IDOK, m_hBtnOk);
DDX_Control(pDX, IDC_TAB_CANCELSELL, m_hTabCancelSell);
DDX_Control(pDX, IDC_LIST_CANCELSELL, m_hListCancelSell);
DDX_Control(pDX, IDC_EDIT_UNITPRICE, m_hEditUnitPrice);
DDX_Control(pDX, IDC_EDIT_SUMTOTAL, m_hEditSumTotal);
DDX_Control(pDX, IDC_EDIT_STOCKNAME, m_hEditStockName);
DDX_Control(pDX, IDC_EDIT_REBATE, m_hEditRebate);
DDX_Control(pDX, IDC_EDIT_PAYMONEY, m_hEditPayMoney);
DDX_Control(pDX, IDC_EDIT_OPERATOR, m_hEditOperator);
DDX_Control(pDX, IDC_EDIT_NUMBERS, m_hEditNumbers);
DDX_Control(pDX, IDC_EDIT_MERCHANDISEID, m_hEditMerchandiseID);
DDX_Control(pDX, IDC_EDIT_FACTMONEY, m_hEditFactMoney);
DDX_Control(pDX, IDC_EDIT_CUSTOMER, m_hEditCustomer);
DDX_Control(pDX, IDC_EDIT_CANCELID, m_hEditCancelID);
DDX_Control(pDX, IDC_DATETIMEPICKER2, m_hDtpTime);
DDX_Control(pDX, IDC_DATETIMEPICKER1, m_hDtpDate);
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(CDlgSell, CDialog)
//{{AFX_MSG_MAP(CDlgSell)
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_CANCELSELL, OnSelchangeTabCancelsell)
ON_NOTIFY(NM_CLICK, IDC_LIST_CANCELSELL, OnClickListCancelsell)
ON_NOTIFY(NM_DBLCLK, IDC_LIST_CANCELSELL, OnDblclkListCancelsell)
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_BN_CLICKED(IDC_BTN_FIND, OnBtnFind)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgSell message handlers
void CDlgSell::OnSelchangeTabCancelsell(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
switch(m_hTabCancelSell.GetCurSel())
{
case 0:
TabCtrlOfSelect(0) ;
break ;
case 1:
TabCtrlOfSelect(1) ;
break ;
}
*pResult = 0;
}
void CDlgSell::OnClickListCancelsell(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
char CancelID[30+1] ;
m_hListCancelSell.GetItemText(m_hListCancelSell.GetSelectionMark(), 0, CancelID, sizeof(CancelID)) ;
m_hDatabase.EditSellToCtrl(CancelID, &m_hEditCancelID, &m_hEditUnitPrice, &m_hEditSumTotal, &m_hEditStockName, &m_hEditRebate, &m_hEditPayMoney, &m_hEditOperator, &m_hEditNumbers, &m_hEditMerchandiseID, &m_hEditFactMoney, &m_hEditCustomer) ;
*pResult = 0;
}
void CDlgSell::OnDblclkListCancelsell(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
TabCtrlOfSelect(0) ;
*pResult = 0;
}
void CDlgSell::OnBtnAdd()
{
// TODO: Add your control notification handler co