// outsourcingDlg.cpp : implementation file // #include "stdafx.h" #include "LYFZIPManage.h" #include "outsourcingDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // outsourcingDlg outsourcingDlg::outsourcingDlg(CWnd* pParent /*=NULL*/) : CDialog(outsourcingDlg::IDD) { //{{AFX_DATA_INIT(outsourcingDlg)IDC_COMBOid m_name1 = _T(""); m_name2 = _T(""); m_id = _T(""); m_money1 = _T(""); m_money2 = _T(""); m_money3 = _T(""); //}}AFX_DATA_INIT } void outsourcingDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(outsourcingDlg) DDX_Control(pDX, IDC_LIST1, m_List1); DDX_Text(pDX, IDC_EDITname1, m_name1); DDX_Text(pDX, IDC_EDITname2, m_name2); DDX_Text(pDX, IDC_EDITid2, m_id); DDX_Text(pDX, IDC_EDITmoney1, m_money1); DDX_Text(pDX, IDC_EDITmoney2, m_money2); DDX_Text(pDX, IDC_EDITmoney3, m_money3); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(outsourcingDlg, CDialog) //{{AFX_MSG_MAP(outsourcingDlg) ON_BN_CLICKED(IDC_BUTclose, OnBUTclose) ON_BN_CLICKED(IDC_BUTTON1, OnButton1) ON_WM_TIMER() ON_BN_CLICKED(IDC_BUTTON2, OnButton2) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // outsourcingDlg diagnostics ///////////////////////////////////////////////////////////////////////////// // outsourcingDlg message handlers BOOL outsourcingDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(0)//pMsg->message==WM_LBUTTONDBLCLK) { {//list1 CPoint pt; CRect rc,rc2; ::GetCursorPos (&pt); m_List1.GetWindowRect (rc2); if(rc2.PtInRect (pt)) return 1; } } return CDialog::PreTranslateMessage(pMsg); } void outsourcingDlg::OnBUTclose() { // TODO: Add your control notification handler code here CDialog::OnCancel (); } void outsourcingDlg::GetData() { // TODO: Add your control notification handler code here CString filter="id='"+m_id+"' and kind<>'5';id='"+m_id+"';"; g_sendhead.code[0]=56; g_sendhead.code[1]=11; g_sendhead.code[2]=9;//供应商信息 g_sendhead.tabcount=3; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return; CArrayList1array; DataToArray(&m_sparray,&List1array,&g_List1array); m_List1.DeleteAllItems (); int listpos[3]={0}; CComboBoxListCtrl *pList[1]={&m_List1}; int pos=0; for(int i=0; iInsertItem(listpos[pos], m_sparray.ElementAt (i).ElementAt (0)); pList[pos]->SetItemText(listpos[pos], 1, m_sparray.ElementAt (i).ElementAt (1)); pList[pos]->SetItemText(listpos[pos], 2, m_sparray.ElementAt (i).ElementAt (2)); pList[pos]->SetItemText(listpos[pos], 3, m_sparray.ElementAt (i).ElementAt (9)+"/"+m_sparray.ElementAt (i).ElementAt (10)); pList[pos]->SetItemText(listpos[pos], 4, m_sparray.ElementAt (i).ElementAt (3)); pList[pos]->SetItemText(listpos[pos], 5, m_sparray.ElementAt (i).ElementAt (11)+"/"+m_sparray.ElementAt (i).ElementAt (12)); pList[pos]->SetItemText(listpos[pos], 6, m_sparray.ElementAt (i).ElementAt (4)); pList[pos]->SetItemText(listpos[pos], 7, m_sparray.ElementAt (i).ElementAt (13)+"/"+m_sparray.ElementAt (i).ElementAt (14)); pList[pos]->SetItemText(listpos[pos], 8, m_sparray.ElementAt (i).ElementAt (5)); pList[pos]->SetItemText(listpos[pos], 9, m_sparray.ElementAt (i).ElementAt (15)+"/"+m_sparray.ElementAt (i).ElementAt (16)); listpos[pos]++; } if(List1array.GetSize ()) { CString m_taoxijiage = List1array.ElementAt (0).ElementAt (8); CString m_payed4 = List1array.ElementAt (0).ElementAt (19); CString m_payed5 = List1array.ElementAt (0).ElementAt (20); m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4)); m_money2.Format ("%f", atof(m_payed5)); m_money3.Format ("%f", atof(m_money1)-atof(m_money2)); ConvertToPrice(m_money1); ConvertToPrice(m_money2); ConvertToPrice(m_money3); UpdateData(false); } } extern BOOL CALLBACK EnumChildProc2(HWND hwnd,LPARAM lParam); BOOL outsourcingDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here // Here we create the outbar control using the splitter as its parent // and setting its id to the first pane. CRect rc2; GetWindowRect(rc2); ::MoveWindow(m_hWnd,0,g_rc.top,g_rc.left+g_rc.Width(),g_rc.Height(),TRUE); EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc2,0); m_List1.m_sparray=&m_sparray; m_List1.InitStyle(); m_List1.InsertColumn(0,_T("商品名称"),LVCFMT_LEFT,160); m_List1.InsertColumn(1,_T("数量"),LVCFMT_LEFT,50); m_List1.InsertColumn(2,_T("发出"),LVCFMT_LEFT,100); m_List1.InsertColumn(3,_T("发出日期"),LVCFMT_LEFT,140); m_List1.InsertColumn(4,_T("回来"),LVCFMT_LEFT,50); m_List1.InsertColumn(5,_T("回来日期"),LVCFMT_LEFT,140); m_List1.InsertColumn(6,_T("完成"),LVCFMT_LEFT,60); m_List1.InsertColumn(7,_T("完成日期"),LVCFMT_LEFT,140); m_List1.InsertColumn(8,_T("取走"),LVCFMT_LEFT,50); m_List1.InsertColumn(9,_T("取走日期"),LVCFMT_LEFT,140); GetData(); GetDlgItem(IDOK)->EnableWindow(IsHasRights2new(13)); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void outsourcingDlg::OnOK() { // TODO: Add extra validation here if(IsHasRights2new(13)==0)return; CString sql,str,m_status3; m_status3="OK"; for(int i=0; i0) if(AfxMessageBox("警告:此客人余款未清, 请向财务核对, 继续吗?", MB_YESNO|MB_ICONSTOP)!=IDYES)return; else if(atof(m_money3)<0) if(AfxMessageBox("警告:此客人账目不清, 请向财务核对, 继续吗?", MB_YESNO|MB_ICONSTOP)!=IDYES)return; if(m_sparray.GetSize ()==0) { return; } CMemFile memfile; CArchive ar(&memfile, CArchive::store); for(int ii=0; iiProcessChatMessageRequest2(pData2, length); g_nSendCode=0; delete []pData2; if(g_bSendOK==0)return; sql= "update dindan set [status3]='"+m_status3+"',[time5]='"+CTime::GetCurrentTime ().Format ("%Y-%m-%d")+"' where id='"+m_id+"'"; sql+=DINDAN_REF; g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0)return; AfxMessageBox("保存成功!", MB_ICONINFORMATION); CDialog::OnOK(); } void outsourcingDlg::OnButton1() { // TODO: Add your control notification handler code here for(int i=0; i