// TakeMoney.cpp : implementation file #include "stdafx.h" #include "LYFZIPManage.h" #include "TakeMoney.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // TakeMoney dialog TakeMoney::TakeMoney(CWnd* pParent /*=NULL*/) : CDialog(TakeMoney::IDD, pParent) { //{{AFX_DATA_INIT(TakeMoney) m_money = _T(""); m_time1 = CTime::GetCurrentTime ().Format ("%Y-%m-%d"); m_bz = _T(""); m_id = _T(""); m_name1 = _T(""); m_name2 = _T(""); m_mode=0; m_ren2 = _T(""); //}}AFX_DATA_INIT } void TakeMoney::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(TakeMoney) DDX_Control(pDX, IDC_LIST1, m_List1); DDX_Control(pDX, IDC_EDIT2, m_editdate1); DDX_Control(pDX, IDC_EDIT1, m_editctrl1); DDX_Control(pDX, IDC_COMBO1, m_comboren); DDX_Text(pDX, IDC_EDIT1, m_money); DDX_Text(pDX, IDC_EDIT2, m_time1); DDX_Text(pDX, IDC_EDIT3, m_bz); DDX_Text(pDX, IDC_EDITid, m_id); DDX_Text(pDX, IDC_EDITname1, m_name1); DDX_Text(pDX, IDC_EDITname2, m_name2); DDX_Text(pDX, IDC_EDITren2, m_ren2); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(TakeMoney, CDialog) //{{AFX_MSG_MAP(TakeMoney) ON_WM_LBUTTONDOWN() ON_BN_CLICKED(IDC_BUTTON1, OnButton1) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // TakeMoney message handlers BOOL TakeMoney::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here g_sendhead.bsql=0; g_sendhead.code[0]=38; g_sendhead.tabcount=1; CString filter="id='"+m_id+"'"; g_pMainWnd->ProcessChatMessageRequest2(filter); DataToArray( &m_List1array); if(m_mode==2 || m_mode==3) { m_comboren.AddString (m_ren); m_comboren.SetCurSel (0); m_comboren.EnableWindow (0); GetDlgItem(IDC_EDIT3)->EnableWindow (0); } else { for(int i=0; iProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; AfxMessageBox("保存成功!", MB_ICONINFORMATION); GetData(); // CDialog::OnOK(); } HBRUSH TakeMoney::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); // TODO: Change any attributes of the DC here if (nCtlColor==CTLCOLOR_STATIC) { pDC-> SetBkMode(TRANSPARENT); //设置字体背景为透明 return (HBRUSH)::GetStockObject(NULL_BRUSH); // 设置背景色 } // TODO: Return a different brush if the default is not desired return hbr; } void TakeMoney::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CDialog::OnLButtonDown(nFlags, point); } void TakeMoney::GetData() { g_sendhead.bsql=0; g_sendhead.code[0]=38; g_sendhead.tabcount=1; CString filter="id='"+m_id+"';"; g_pMainWnd->ProcessChatMessageRequest2(filter); DataToArray( &m_List1array); FillGrid(); } void TakeMoney::FillGrid() { m_List1.DeleteAllItems2 (); int ii=0; m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 ); int count=0; for(ii=0; iimessage==WM_KEYDOWN) { switch (pMsg->wParam) { case VK_RETURN: return 1; } } return CDialog::PreTranslateMessage(pMsg); } void TakeMoney::OnButton1() { // TODO: Add your control notification handler code here SPBox dlg; if(dlg.DoModal ()!=IDOK)return; SetDlgItemText(IDC_EDIT3, dlg.m_spname ); }