// ChoosePhotoSkin3.cpp : implementation file // #include "stdafx.h" #include "ChoosePhotoSkin3.h" #include "YLGL.h" #include "./helper/ffsco.h" #include ".\MenuBarXP\MenuXP.h" #include "PrintRX.h" #include "LoadRect.h" #include "PrintPreview.h" #include "InputJT.h" #include "DesinCheck.h" #include "Login2.h" #include "SPLBDlg.h" #include "InputPrice.h" #include "ZZB.h" //extern void WriteClientLog(CString str); // Jeff写客户端日志; ///////////////////////////////////////////////////////////////////////////// // ChoosePhotoSkin3 dialog IDC_EDITbz3 ChoosePhotoSkin3::ChoosePhotoSkin3(CWnd* pParent /*=NULL*/) : CDialog(ChoosePhotoSkin3::IDD, pParent) { //{{AFX_DATA_INIT(ChoosePhotoSkin3) m_bz3 = _T(""); m_time5 = _T(""); m_urgent = _T(""); m_time6 = _T(""); m_bz4 = _T(""); //}}AFX_DATA_INIT m_name1 = _T(""); m_time4 = g_date; m_waiter3 = _T(""); m_takezs = _T(""); m_taoxizs = _T(""); m_choosezs = _T(""); m_id = _T(""); m_money3 = _T(""); //}}AFX_DATA_INIT m_bSave=0; m_bModify=0; m_bPushedSave=0; //m_delphotosMode = 0; //默认为选片模式;// 已使用GetParent()->m_mode2; } void ChoosePhotoSkin3::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(ChoosePhotoSkin3) DDX_Control(pDX, IDC_EDITtime6, m_datectrl2); DDX_Control(pDX, IDC_COMBO1, m_combo1); DDX_Control(pDX, IDC_EDITtime5, m_datenum); DDX_Control(pDX, IDC_COMBOurgent, m_combourgent); DDX_Control(pDX, IDC_EDITzs3, m_editnum4); DDX_Control(pDX, IDC_EDITzs2, m_editnum3); DDX_Control(pDX, IDC_EDITzs, m_editnum2); DDX_Control(pDX, IDC_EDITmoney3, m_editnum1); DDX_Control(pDX, IDC_LIST3, m_List3); DDX_Control(pDX, IDC_LIST2, m_List2); DDX_Control(pDX, IDC_LIST1, m_List1); DDX_Text(pDX, IDC_EDITname1, m_name1); DDX_Text(pDX, IDC_EDITtime4, m_time4); DDX_Text(pDX, IDC_EDITwaiter3, m_waiter3); DDX_Text(pDX, IDC_EDITzs, m_takezs); DDX_Text(pDX, IDC_EDITzs2, m_taoxizs); DDX_Text(pDX, IDC_EDITzs3, m_choosezs); DDX_Text(pDX, IDC_EDITmoney3, m_money3); DDX_Text(pDX, IDC_EDITbz3, m_bz3); DDV_MaxChars(pDX, m_bz3, 1000); DDX_Text(pDX, IDC_EDITtime5, m_time5); DDX_Text(pDX, IDC_EDITtime6, m_time6); DDX_Text(pDX, IDC_EDITid, m_id); DDX_Text(pDX, IDC_EDITbz4, m_bz4); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(ChoosePhotoSkin3, CDialog) //{{AFX_MSG_MAP(ChoosePhotoSkin3) ON_WM_CLOSE() ON_BN_CLICKED(IDC_BUTTON1, OnButton1) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) ON_BN_CLICKED(IDC_BUTTON3, OnButton3) ON_BN_CLICKED(IDC_BUTTON4, OnButton4) ON_WM_TIMER() ON_BN_CLICKED(IDC_BUTTON7, OnSpBox) ON_BN_CLICKED(IDC_BUTTON8, OnButton8) ON_BN_CLICKED(IDC_BUTTON5, OnButton5) ON_BN_CLICKED(IDC_BUTTON6, OnButton6) ON_BN_CLICKED(IDC_BTNprint, OnBTNprint) ON_BN_CLICKED(IDC_BUTTON9, OnButton9) ON_BN_CLICKED(IDC_BTNprint2, OnBTNprint2) ON_WM_PAINT() ON_WM_DESTROY() ON_BN_CLICKED(IDC_BUTTON12, OnButton12) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // ChoosePhotoSkin3 message handlers BOOL ChoosePhotoSkin3::OnInitDialog() { CDialog::OnInitDialog(); /* #ifdef CHILD_VERSION GetDlgItem(IDC_STATIC10)->SetWindowText("家长:"); GetDlgItem(IDC_STATIC20)->SetWindowText("宝宝:"); #endif*/ if(m_pParent->m_mode2) { GetDlgItem(IDC_STATIC2)->ShowWindow(0); GetDlgItem(IDC_STATIC4)->ShowWindow(0); GetDlgItem(IDC_STATIC6)->ShowWindow(0); GetDlgItem(IDC_EDITzs)->ShowWindow(0); GetDlgItem(IDC_EDITzs2)->ShowWindow(0); GetDlgItem(IDC_EDITzs3)->ShowWindow(0); m_combo1.AddString ("OK"); m_combo1.AddString ("修改中"); m_combo1.AddString ("未看"); CRect rc; GetDlgItem(IDC_STATIC8)->GetWindowRect(rc); ScreenToClient(rc); GetDlgItem(IDC_STATIC5)->MoveWindow(rc); GetDlgItem(IDC_EDITzs2)->GetWindowRect(rc); ScreenToClient(rc); GetDlgItem(IDC_EDITmoney3)->MoveWindow(rc); GetDlgItem(IDC_STATIC8)->ShowWindow(0); GetDlgItem(IDC_COMBO1)->ShowWindow(0); } else { GetDlgItem(IDC_STATIC8)->ShowWindow(0); GetDlgItem(IDC_COMBO1)->ShowWindow(0); } // TODO: Add extra initialization here CTime tm( atoi(g_date.Mid (0,4)), atoi(g_date.Mid (5,2)), atoi(g_date.Mid (8,2)), CTime::GetCurrentTime ().GetHour (), CTime::GetCurrentTime ().GetMinute (),CTime::GetCurrentTime ().GetSecond ()); #ifdef LKAY_VERSION CTimeSpan dt(31, 0, 0, 0); tm+=dt; m_datenum.SetDefaultValue(tm.Format ("%Y-%m-%d")); CTimeSpan dt2(4, 0, 0, 0); tm-=dt2; m_datectrl2.SetDefaultValue(tm.Format ("%Y-%m-%d")); #else CTimeSpan dt(61, 0, 0, 0); tm+=dt; m_datenum.SetDefaultValue(tm.Format ("%Y-%m-%d")); CTimeSpan dt2(31, 0, 0, 0); tm-=dt2; m_datectrl2.SetDefaultValue(tm.Format ("%Y-%m-%d")); #endif m_bPushedSave=0; m_bSaveFail=0; m_List2.InitStyle(); m_List2.InsertColumn(0,_T("编号"),LVCFMT_LEFT,55); m_List2.InsertColumn(1,_T("商品名称"),LVCFMT_LEFT,150); m_List2.InsertColumn(2,_T("数量"),LVCFMT_LEFT,55); m_List3.InitStyle(); m_List3.InsertColumn(0,_T("autuid"),LVCFMT_LEFT,0); m_List3.InsertColumn(1,_T("编号"),LVCFMT_LEFT,55); m_List3.InsertColumn(2,_T("商品名称"),LVCFMT_LEFT,150); m_List3.InsertColumn(3,_T("价格"),LVCFMT_LEFT,55); m_List3.InsertColumn(4,_T("数量"),LVCFMT_LEFT,55); #ifdef LKAY_VERSION m_List3.InsertColumn(5,_T("P数"),LVCFMT_LEFT,55); m_List3.InsertColumn(6,_T("张数"),LVCFMT_LEFT,55); m_List3.InsertColumn(7,_T("照片编号"),LVCFMT_LEFT,355); #else m_List3.InsertColumn(5,_T("照片编号"),LVCFMT_LEFT,355); #endif m_combourgent.AddString ("是"); m_combourgent.AddString ("否"); LoadData(1); // AnimateWindow(GetSafeHwnd(), 3000, AW_BLEND); return false; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void ChoosePhotoSkin3::OnOK() { // TODO: Add extra validation here } void ChoosePhotoSkin3::OnCancel() { // TODO: Add extra cleanup here m_bExit=0; LoadData(0); CDialog::OnCancel(); } void ChoosePhotoSkin3::OnClose() { // TODO: Add your message handler code here and/or call default m_bExit=0; SetSPName3(); SetSPName2(); LoadData(0); CDialog::OnCancel(); } BOOL ChoosePhotoSkin3::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(0)//pMsg->message==WM_LBUTTONDOWN) { {//list2 CPoint pt; CRect rc,rc2; ::GetCursorPos (&pt); m_List2.GetWindowRect (rc2); if(rc2.PtInRect (pt)==0) goto mm; SetTimer(2, 300, NULL); } mm: {//list3 CPoint pt; CRect rc,rc2; ::GetCursorPos (&pt); m_List3.GetWindowRect (rc2); if(rc2.PtInRect (pt)==0) return CDialog::PreTranslateMessage(pMsg); SetTimer(3, 300, NULL); } } else if(pMsg->message==WM_LBUTTONDBLCLK) { {//list2 CPoint pt; CRect rc,rc2; ::GetCursorPos (&pt); m_List2.GetWindowRect (rc2); if(rc2.PtInRect (pt)==0) goto ll; /* pt.x-=rc2.left ; pt.y-=rc2.top ; POSITION pos; pos=m_List2.GetFirstSelectedItemPosition(); if(pos==NULL)return 1; int iItem=m_List2.GetNextSelectedItem(pos); m_List2.GetSubItemRect( iItem,4, LVIR_BOUNDS, rc); if(rc.PtInRect (pt)) return CDialog::PreTranslateMessage(pMsg); else*/ return 1; } ll: {//list3 CPoint pt; CRect rc,rc2; ::GetCursorPos (&pt); m_List3.GetWindowRect (rc2); if(rc2.PtInRect (pt)==0) return CDialog::PreTranslateMessage(pMsg); pt.x-=rc2.left ; pt.y-=rc2.top ; POSITION pos; pos=m_List3.GetFirstSelectedItemPosition(); if(pos==NULL)return 1; int iItem=m_List3.GetNextSelectedItem(pos); m_List3.GetSubItemRect( iItem,4, LVIR_BOUNDS, rc); if(1)//rc.PtInRect (pt)) return CDialog::PreTranslateMessage(pMsg); else return 1; } } if(pMsg->message==WM_KEYDOWN) { switch (pMsg->wParam) { case VK_DELETE: { if(GetFocus()==GetDlgItem(IDC_EDITbz4)) { if(AfxMessageBox("删除后将无法恢复, 确认删除备注吗?", MB_YESNO)!=IDYES)return 1; m_bz4=""; SetDlgItemText(IDC_EDITbz4, ""); } } return 1; } } return CDialog::PreTranslateMessage(pMsg); } int ChoosePhotoSkin3::GetZS(CString str) { str.TrimLeft (","); str.TrimRight (","); if(str.IsEmpty ())return 0; int pos=str.Find (','); int count=1; while(pos!=-1) { str.Delete (pos); pos=str.Find (','); count++; } return count; } long ChoosePhotoSkin3::UpdateTakeZS(WPARAM inWParam, LPARAM inLParam) { return 1; } void ChoosePhotoSkin3::OnButton1() { // TODO: Add your control notification handler code here } void ChoosePhotoSkin3::UpdateChooseZS() { } void ChoosePhotoSkin3::OnButton2() { // TODO: Add your control notification handler code here POSITION pos; pos=m_List2.GetFirstSelectedItemPosition(); if(pos==NULL) { AfxMessageBox("请先选中您要重选的商品!", MB_ICONINFORMATION); return; } m_bModify=1; int iItem=m_List2.GetNextSelectedItem(pos); m_List2.SetItemText (iItem, 4, ""); m_noarray.SetAt (iItem, ""); UpdateChooseZS(); } void ChoosePhotoSkin3::OnButton9() { // TODO: Add your control notification handler code here POSITION pos; pos=m_List3.GetFirstSelectedItemPosition(); if(pos==NULL) { AfxMessageBox("请先选中您要升级的商品!", MB_ICONINFORMATION); return; } m_bModify=1; int iItem=m_List3.GetNextSelectedItem(pos); SPBox dlg; if(dlg.DoModal ()!=IDOK)return; m_List3.SetItemText(iItem,1, dlg.m_spid); m_List3.SetItemText(iItem,2, GetSPNameFromId(dlg.m_spid)); CString str; str.Format ("%f", GetSPPriceFromId(dlg.m_spid)); ConvertToPrice (str); m_List3.SetItemText(iItem,3, str); } void ChoosePhotoSkin3::OnButton3()// 删除; { //AfxMessageBox("保存"); // TODO: Add your control notification handler code here if(m_List2.GetItemCount())return; CString sql="gentakecontent:"+m_id; g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql);//printf("Jeff:sql=%s\n\n",sql);// Jeff Printf if(g_bSendOK==0) return; CString filter="id='"+m_id+"'"; g_sendhead.code[0]=182; g_sendhead.tabcount=1; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(filter);//printf("Jeff:filter=%s\n\n",filter);// Jeff Printf if(g_bSendOK==0)return; CArraysparray; DataToArray(&g_List1array); m_List2.DeleteAllItems (); for(int i=0; im_List2array.GetSize (); i++) { if(name==m_pParent->m_List2array.ElementAt (i).ElementAt (1)) return m_pParent->m_List2array.ElementAt (i).ElementAt (4); } return ""; } void ChoosePhotoSkin3::OnButton4() // 保存按钮; { // TODO: Add your control notification handler code here m_bPushedSave=1; SetSPName3(); SetSPName2(); UpdateData(); if(!CheckDateOK(m_time5))return; if(!CheckDateOK(m_time6))return; OnButton3(); CString m_authorize; CString m_discount; if(atoi(g_cominfoarray.ElementAt(0).ElementAt(113)))//计算折扣 { float m_saleprice1=GetMoney(); float m_saleprice2=GetMoney2(); if(m_saleprice1>m_saleprice2) m_discount.Format ("%0.3f", min(10.0, (atof(m_money3)*10)/(m_saleprice1-m_saleprice2)) ); else m_discount="10.0"; if(IsHasRights2new(26)==0 && atof(m_money3)>0.1)//无折扣权限 { if(m_discount!="10.0") { AfxMessageBox("价格太低,需授权!!", MB_ICONINFORMATION); Login2 dlg; dlg.m_mode=2; if(dlg.DoModal ()!=IDOK)return; if(IsHasRightsnew2(26, dlg.m_rights)==0)return; m_discount.Format ("%0.3f", min(10.0, (atof(m_money3)*10)/(m_saleprice1-m_saleprice2)) ); if(atof(m_discount)0.1 ) { AfxMessageBox("价格太低,需授权!!", MB_ICONINFORMATION); Login2 dlg; dlg.m_mode=2; if(dlg.DoModal ()!=IDOK)return; if(IsHasRightsnew2(26, dlg.m_rights)==0)return; m_discount.Format ("%0.3f", min(10.0, (atof(m_money3)*10)/(m_saleprice1-m_saleprice2)) ); if(atof(m_discount)m_mode2) { DesinCheck dlg; int pos=m_combo1.GetCurSel(); if(pos!=-1) m_combo1.GetLBText(pos, m_status8); dlg.m_status8=m_status8; dlg.DoModal(); m_status8=dlg.m_status8; m_combo1.SetCurSel(m_combo1.FindString(0, m_status8)); } CString str,sql; CArraysparray; sparray.SetSize(m_no2array.GetSize()); int i=0; BOOL bZZB=0; for( int j=0; jm_mode2) { sparray.ElementAt (i).Add ( m_status8 ); sparray.ElementAt (i).Add ( GetLB(m_List3.GetItemText (j, 2)) ); sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 4) ); sparray.ElementAt (i).Add (m_pParent->m_seltxname); } else sparray.ElementAt (i).Add (m_pParent->m_seltxname); i++; } if(sparray.GetSize ()==0) { sparray.SetSize(1); sparray.ElementAt (0).Add (m_id); } int realcount=sparray.GetSize (); sparray.SetSize(realcount+1, 1); sparray.ElementAt (realcount).Add (g_user.name); CMemFile memfile; CArchive ar(&memfile, CArchive::store); for(int ii=0; iim_mode2) savepath.Format ("%s\\%s-2.dat", g_mainpath, m_id); if(0) { CFile fp; fp.Open (savepath, CFile::modeCreate|CFile::modeWrite); fp.Write (pData2, length); fp.Close (); } g_nSendCode=6; if(m_pParent->m_mode2) { g_nSendCode=24; } g_pMainWnd->ProcessChatMessageRequest2(pData2, length); g_nSendCode=0; if(g_bSendOK==0) { delete []pData2; m_bSaveFail=1; return; } ::DeleteFile (savepath); delete []pData2; m_combourgent.GetLBText (m_combourgent.GetCurSel (), m_urgent); FilterBZ(m_bz3); CString delphotos; for( i=0; im_patharray4.GetSize (); i++) { if(delphotos.GetLength ()>4096)break; CString no=m_pParent->m_patharray4.ElementAt (i); no=no.Right (no.GetLength ()-no.ReverseFind ('\\')-1); no=no.Left (no.Find ('.')); delphotos+=no; delphotos+=";"; } if(!delphotos.IsEmpty ()) { delphotos.TrimLeft (";"); delphotos.TrimRight (";"); delphotos=";"+delphotos; delphotos+=";"; } sql="update dindan set status2='OK',waiter3='"+m_waiter3+"',taoxizs='"+m_taoxizs+"',takezs='"+m_takezs+"',choosezs='"+m_choosezs+"',time4='"+m_time4+"',time5='"+m_time5+"',time6='"+m_time6+"',urgent='"+m_urgent+"',money3='"+m_money3+"',bz3='"+m_bz3+"',bz4='"+m_bz4+"',delphotos='"+delphotos+"',authorize2='"+m_authorize+"',discount2='"+m_discount+"' where id='"+m_id+"'"; if(m_pParent->m_mode2) { if(m_status8!="OK") { sql= "update dindan set bz2='"+m_bz3+"',status8='"+m_status8+"',status5='设计中',time6='"+m_time6+"',time5='"+m_time5+"',waiter8='"+g_user.name+"',urgent='"+m_urgent+"',money3='"+m_money3+"',delphotos2='"+delphotos+"',authorize2='"+m_authorize+"',discount2='"+m_discount+"' where id='"+m_id+"'"; } else { sql= "update dindan set bz2='"+m_bz3+"',status8='"+m_status8+"',status5='OK',time6='"+m_time6+"',time5='"+m_time5+"',waiter8='"+g_user.name+"',urgent='"+m_urgent+"',money3='"+m_money3+"',delphotos2='"+delphotos+"',authorize2='"+m_authorize+"',discount2='"+m_discount+"' where id='"+m_id+"'"; } ///////////////////////// CString m_name1=m_pParent->m_name1; CString m_name2=m_pParent->m_name2; CString m_phone1=m_pParent->m_phone1; CString m_phone2=m_pParent->m_phone2; CString oldstatus=m_pParent->m_checkstatus; CString sql2; BOOL msgcheck = atoi(g_cominfoarray.ElementAt(0).ElementAt(103)); CString msgcontent = g_cominfoarray.ElementAt(0).ElementAt(107); if(oldstatus=="OK")msgcheck=0; if(m_status8!="OK")msgcheck=0; #ifdef CHILD_VERSION if(msgcheck ) { CString m_content3 = msgcontent; CString str,timestamp; timestamp="777888"; { CString name; if(!m_name1.IsEmpty ()) name=m_name1+","; name+=m_name2; name.TrimRight (","); if(name.IsEmpty ()==0 && CheckPhoneType(m_phone1)!=-1 && CheckBadWords(name,0) && CheckBadWords2(name,0) ) { str=name+m_content3; str.Replace ("xxx小朋友", ""); int count=GetLengthEx(str)/MSG_LENGTH; if(GetLengthEx(str)%MSG_LENGTH) count++; CString scount; scount.Format ("%d", count); sql2="***insert into sendregdelay([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone1+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')"; sql+=sql2; } } } #else if(msgcheck) { CString m_content3 = msgcontent; CString str,timestamp; timestamp="777888"; int pos=m_content3.Find("xxx先生/女士"); if(pos!=-1) { if(m_name1.IsEmpty ()==0 && CheckPhoneType(m_phone1)!=-1 && CheckBadWords(m_name1,0)&& CheckBadWords2(m_name1,0) ) { str=m_content3; str.Replace ("xxx先生/女士", m_name1+"先生"); int count=GetLengthEx(str)/MSG_LENGTH; if(GetLengthEx(str)%MSG_LENGTH) count++; CString scount; scount.Format ("%d", count); sql2="***insert into sendregdelay([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone1+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')"; sql+=sql2; } if(m_name2.IsEmpty ()==0 && CheckPhoneType(m_phone2)!=-1 && CheckBadWords(m_name2,0) && CheckBadWords2(m_name2,0) ) { str=m_content3; str.Replace ("xxx先生/女士", m_name2+"女士"); int count=GetLengthEx(str)/MSG_LENGTH; if(GetLengthEx(str)%MSG_LENGTH) count++; CString scount; scount.Format ("%d", count); CTime tm=CTime::GetCurrentTime (); tm+=CTimeSpan(0,0,0,3); timestamp="777888"; sql2="***insert into sendregdelay([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone2+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')"; sql+=sql2; } } } #endif ///////////////////////// } else { ///////////////////////// CString m_name1=m_pParent->m_name1; CString m_name2=m_pParent->m_name2; CString m_phone1=m_pParent->m_phone1; CString m_phone2=m_pParent->m_phone2; CString oldstatus=m_pParent->m_checkstatus; CString sql2; BOOL msgcheck = atoi(g_cominfoarray.ElementAt(0).ElementAt(102)); CString msgcontent = g_cominfoarray.ElementAt(0).ElementAt(106); if(oldstatus=="OK")msgcheck=0; #ifdef CHILD_VERSION if(msgcheck ) { CString m_content3 = msgcontent; CString str,timestamp; timestamp="777888"; { CString name; if(!m_name1.IsEmpty ()) name=m_name1+","; name+=m_name2; name.TrimRight (","); if(name.IsEmpty ()==0 && CheckPhoneType(m_phone1)!=-1 && CheckBadWords(name,0) && CheckBadWords2(name,0) ) { str=name+m_content3; str.Replace ("xxx小朋友", ""); int count=GetLengthEx(str)/MSG_LENGTH; if(GetLengthEx(str)%MSG_LENGTH) count++; CString scount; scount.Format ("%d", count); sql2="***insert into sendregdelay([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone1+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')"; sql+=sql2; } } } #else if(msgcheck) { CString m_content3 = msgcontent; CString str,timestamp; timestamp="777888"; int pos=m_content3.Find("xxx先生/女士"); if(pos!=-1) { if(m_name1.IsEmpty ()==0 && CheckPhoneType(m_phone1)!=-1 && CheckBadWords(m_name1,0)&& CheckBadWords2(m_name1,0) ) { str=m_content3; str.Replace ("xxx先生/女士", m_name1+"先生"); int count=GetLengthEx(str)/MSG_LENGTH; if(GetLengthEx(str)%MSG_LENGTH) count++; CString scount; scount.Format ("%d", count); sql2="***insert into sendregdelay([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone1+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')"; sql+=sql2; } if(m_name2.IsEmpty ()==0 && CheckPhoneType(m_phone2)!=-1 && CheckBadWords(m_name2,0) && CheckBadWords2(m_name2,0) ) { str=m_content3; str.Replace ("xxx先生/女士", m_name2+"女士"); int count=GetLengthEx(str)/MSG_LENGTH; if(GetLengthEx(str)%MSG_LENGTH) count++; CString scount; scount.Format ("%d", count); CTime tm=CTime::GetCurrentTime (); tm+=CTimeSpan(0,0,0,3); timestamp="777888"; sql2="***insert into sendregdelay([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone2+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')"; sql+=sql2; } } } #endif ///////////////////////// } if(atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))//新摄控本 { CString id=m_id; CString m_time5old=m_pParent->m_time5old; CString m_time6old=m_pParent->m_time6old; m_pParent->m_time5old=m_time5; m_pParent->m_time6old=m_time6; CString timestamp; CTime tm=CTime::GetCurrentTime (); CTimeSpan dt(0,0,0,1); timestamp=tm.Format ("%Y%m%d%H%M%S"); CString sql2,phone,clothescount; CString m_phone1=m_pParent->m_phone1; CString m_phone2=m_pParent->m_phone2; CString m_name1=m_pParent->m_name1; CString m_name2=m_pParent->m_name2; CString taoxiname=m_pParent->taoxiname; CString m_taoxijiage=m_pParent->m_taoxijiage; CString m_waiter1=m_pParent->m_waiter1; CString m_waiter2=m_pParent->m_waiter2; CString ren=m_pParent->ren; CString m_clothescount=m_pParent->m_clothescount; if(m_time6!="" && m_time6old!=m_time6) { tm+=dt; timestamp=tm.Format ("%Y%m%d%H%M%S"); phone=m_phone1+" "+m_phone2; phone.TrimLeft (); if(m_clothescount!="") clothescount="服装:"+m_clothescount; if(1)//m_time6old=="") sql2.Format ("***insert into [todaytake]([name],[phone],[time],[type],[price],[waiter1],[waiter2],[receptionist],[arrearage],[remark],[clerk],[timestamp],[date],[mode],[arrive],[id])values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%d','%s','%s')", m_name1+m_name2,phone,"",taoxiname,m_taoxijiage,m_waiter1,m_waiter2,ren,m_taoxijiage,clothescount,g_user.name,timestamp,m_time6,2,"未到",id); else sql2.Format ("***update [todaytake] set [date]='%s' where [id]='%s' and [mode]='%d'", m_time6, id, 2); sql+=sql2; } if(m_time5!="" && m_time5old!=m_time5) { tm+=dt; timestamp=tm.Format ("%Y%m%d%H%M%S"); phone=m_phone1+" "+m_phone2; phone.TrimLeft (); if(m_clothescount!="") clothescount="服装:"+m_clothescount; if(1)//m_time5old=="") sql2.Format ("***insert into [todaytake]([name],[phone],[time],[type],[price],[waiter1],[waiter2],[receptionist],[arrearage],[remark],[clerk],[timestamp],[date],[mode],[arrive],[id])values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%d','%s','%s')", m_name1+m_name2,phone,"",taoxiname,m_taoxijiage,m_waiter1,m_waiter2,ren,m_taoxijiage,clothescount,g_user.name,timestamp,m_time5,3,"未到",id); else sql2.Format ("***update [todaytake] set [date]='%s' where [id]='%s' and [mode]='%d'", m_time5, id, 3); sql+=sql2; } } g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0) { m_bSaveFail=1; return; } m_bSave=1; if(atof(m_oldmoney3)!=atof(m_money3)) { InputJT dlg; dlg.m_id=m_id; dlg.m_money.Format("%0.2f", atof(m_money3)-atof(m_oldmoney3)); dlg.DoModal (); } m_oldmoney3=m_money3; AfxMessageBox("保存成功!", MB_ICONINFORMATION); m_bExit=0; if(m_pParent->ReLoad()==0) { CDialog::OnCancel (); m_bExit=1; return; } LoadData(1); if(bZZB==0 && atoi(g_cominfoarray.ElementAt(0).ElementAt(130))==0) { ZZB dlg; dlg.SetLiaPath ("6.lia"); if(dlg.DoModal()==IDOK) { CString m_spname="掌中宝app"; CString m_spid; CString m_lb; GetSPInfoFromName(m_spname, m_spid, m_lb); if(m_spid=="") { sql="insert into shangpinlb (name)values('掌中宝app')***insert into shangpin(spid,spname,splb,hide)values('ZZB001','掌中宝app','掌中宝app','上架')"; g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0) { m_bSaveFail=1; return; } g_sendhead.code[0]=4; g_sendhead.tabcount=1; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(1); if(g_bSendOK==0) { m_bSaveFail=1; return; } DataToArray(&(m_pParent->m_sparray)); GetSPInfoFromName(m_spname, m_spid, m_lb); } int pos=m_List3.GetItemCount (); CString str; if(pos) { if(m_List3.GetItemText (pos-1, 1).IsEmpty ()&&m_List3.GetItemText (pos-1, 2).IsEmpty ()) { pos--; m_List3.SetItemText(pos,1, m_spid); m_List3.SetItemText(pos,2, GetSPNameFromId(m_spid)); str.Format ("%f", GetSPPriceFromId(m_spid)); ConvertToPrice (str); m_List3.SetItemText(pos,3, str); m_List3.SetItemText(pos,4, "1"); } else { m_List3.InsertItem(pos, ""); m_List3.SetItemText(pos,1, m_spid); m_List3.SetItemText(pos,2, GetSPNameFromId(m_spid)); str.Format ("%f", GetSPPriceFromId(m_spid)); ConvertToPrice (str); m_List3.SetItemText(pos,3, str); m_List3.SetItemText(pos,4, "1"); } } else { m_List3.InsertItem(pos, ""); m_List3.SetItemText(pos,1, m_spid); m_List3.SetItemText(pos,2, GetSPNameFromId(m_spid)); str.Format ("%f", GetSPPriceFromId(m_spid)); ConvertToPrice (str); m_List3.SetItemText(pos,3, str); m_List3.SetItemText(pos,4, "1"); } SetSPName3(); AfxMessageBox("已自动添加产品 '掌中宝app', 请继续挑选制作掌中宝app照片!", MB_ICONINFORMATION); } } } void ChoosePhotoSkin3::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default if(nIDEvent==3) { KillTimer(nIDEvent); SetSPName3(); } if(nIDEvent==2) { KillTimer(nIDEvent); SetSPName2(); } } float ChoosePhotoSkin3::GetSPPriceFromId(CString id) { for(int i=0; im_sparray.GetSize (); i++) { if(id==m_pParent->m_sparray.ElementAt (i).ElementAt (0)) return atof(m_pParent->m_sparray.ElementAt (i).ElementAt (4)); } return 0; } void ChoosePhotoSkin3::GetSPInfoFromName(CString name, CString &id, CString &splb) { for(int i=0; im_sparray.GetSize (); i++) { if(name==m_pParent->m_sparray.ElementAt (i).ElementAt (1)) { id=m_pParent->m_sparray.ElementAt (i).ElementAt (0); break; } } } CString ChoosePhotoSkin3::GetSPNameFromId(CString id) { for(int i=0; im_sparray.GetSize (); i++) { if(id==m_pParent->m_sparray.ElementAt (i).ElementAt (0)) return m_pParent->m_sparray.ElementAt (i).ElementAt (1); } id.TrimLeft ("0"); for( i=0; im_sparray.GetSize (); i++) { if(id==m_pParent->m_sparray.ElementAt (i).ElementAt (0)) return m_pParent->m_sparray.ElementAt (i).ElementAt (1); } return ""; } void ChoosePhotoSkin3::SetSPName2() { for(int i=0; iiItem) m_no2array.SetAt (iItem, ""); UpdateChooseZS(); } void ChoosePhotoSkin3::OnButton6() { // TODO: Add your control notification handler code here if(AfxMessageBox("确认重选吗?", MB_YESNO)!=IDYES)return ; for(int i=0; ii) m_no2array.SetAt (i, ""); } UpdateChooseZS(); m_bModify=1; } void ChoosePhotoSkin3::LoadData(BOOL bLoad) { if(bLoad) { m_name1 = m_pParent->m_name; m_time6 = m_pParent->m_time6; m_time4 = m_pParent->m_time4; m_waiter3 = m_pParent->m_waiter3; m_takezs = m_pParent->m_takezs; m_taoxizs = m_pParent->m_taoxizs; m_choosezs = m_pParent->m_choosezs; m_bz3 = m_pParent->m_bz3; m_bz4 = m_pParent->m_bz4; m_id = m_pParent->m_strOrderNumber; m_money3 = m_pParent->m_money3; m_oldmoney3=m_pParent->m_oldmoney3; m_time5 = m_pParent->m_time5; m_urgent = m_pParent->m_urgent; if(m_pParent->m_mode2 && m_time6.IsEmpty ()) m_time6=g_date; if(m_combourgent.FindString (0, m_urgent)==-1) m_combourgent.SetCurSel (1); else m_combourgent.SetCurSel (m_combourgent.FindString (0, m_urgent)); m_status8 = m_pParent->m_status8; if(m_combo1.FindString (0, m_status8)==-1) m_combo1.SetCurSel (0); else m_combo1.SetCurSel (m_combo1.FindString (0, m_status8)); UpdateData(false); m_no2array.Copy (m_pParent->m_no2array); m_noarray.Copy (m_pParent->m_noarray); m_List2.DeleteAllItems (); m_List3.DeleteAllItems (); for(int i=0; ioldsparray.GetSize (); i++) { m_List2.InsertItem(i, m_pParent->oldsparray.ElementAt (i).ElementAt (1)); m_List2.SetItemText(i, 1, m_pParent->oldsparray.ElementAt (i).ElementAt (2)); m_List2.SetItemText(i, 2, m_pParent->oldsparray.ElementAt (i).ElementAt (3)); } for( i=0; im_List3.GetItemCount (); i++) { m_List3.InsertItem(i, m_pParent->m_List3.GetItemText (i, 0)); m_List3.SetItemText(i, 1, m_pParent->m_List3.GetItemText (i, 1)); m_List3.SetItemText(i, 2, m_pParent->m_List3.GetItemText (i, 2)); m_List3.SetItemText(i, 3, m_pParent->m_List3.GetItemText (i, 3)); m_List3.SetItemText(i, 4, m_pParent->m_List3.GetItemText (i, 4)); m_List3.SetItemText(i, 5, m_pParent->m_List3.GetItemText (i, 5)); #ifdef LKAY_VERSION m_List3.SetItemText(i, 6, m_pParent->m_List3.GetItemText (i, 6)); m_List3.SetItemText(i, 7, m_pParent->m_List3.GetItemText (i, 7)); #endif } } else { UpdateData(); // m_pParent->m_name1=m_name1; m_pParent->m_time6=m_time6; m_pParent->m_time4=m_time4; m_pParent->m_waiter3=m_waiter3; m_pParent->m_taoxizs=m_taoxizs; m_pParent->m_choosezs=m_choosezs; m_pParent->m_bz3=m_bz3; m_pParent->m_bz4=m_bz4; m_pParent->m_strOrderNumber=m_id; m_pParent->m_money3=m_money3; m_pParent->m_oldmoney3=m_oldmoney3; m_combourgent.GetLBText (m_combourgent.GetCurSel (), m_urgent); m_pParent->m_urgent=m_urgent; m_pParent->m_time5=m_time5; m_pParent->m_status8=m_status8; m_pParent->UpdateData (false); m_pParent->m_no2array.Copy (m_no2array); m_pParent->m_noarray.Copy (m_noarray); m_pParent->m_bSave=m_bSave; if(m_bModify) { m_pParent->UpdateChooseZS();//更新选中的照片 m_pParent->GetNoSelPhoto(); m_pParent->LoadPhotos();//更新显示 } m_pParent->m_List2.DeleteAllItems (); m_pParent->m_List3.DeleteAllItems (); /* for(int i=0; im_List2.InsertItem(i, m_List2.GetItemText (i, 0)); m_pParent->m_List2.SetItemText(i, 1, m_List2.GetItemText (i, 1)); m_pParent->m_List2.SetItemText(i, 2, m_List2.GetItemText (i, 2)); m_pParent->m_List2.SetItemText(i, 3, m_List2.GetItemText (i, 3)); m_pParent->m_List2.SetItemText(i, 4, m_List2.GetItemText (i, 4)); }*/ for(int i=0; im_List3.InsertItem(i, m_List3.GetItemText (i, 0)); m_pParent->m_List3.SetItemText(i, 1, m_List3.GetItemText (i, 1)); m_pParent->m_List3.SetItemText(i, 2, m_List3.GetItemText (i, 2)); m_pParent->m_List3.SetItemText(i, 3, m_List3.GetItemText (i, 3)); m_pParent->m_List3.SetItemText(i, 4, m_List3.GetItemText (i, 4)); m_pParent->m_List3.SetItemText(i, 5, m_List3.GetItemText (i, 5)); #ifdef LKAY_VERSION m_pParent->m_List3.SetItemText(i, 6, m_List3.GetItemText (i, 6)); m_pParent->m_List3.SetItemText(i, 7, m_List3.GetItemText (i, 7)); #endif } } } void ChoosePhotoSkin3::OnBTNprint() { // TODO: Add your control notification handler code here if(m_pParent->m_mode2) g_pMainWnd->PrintFlowChart4(m_id); else g_pMainWnd->PrintFlowChart(m_id); } void ChoosePhotoSkin3::OnBTNprint2() { // TODO: Add your control notification handler code here m_pParent->UpdateChooseZS(); m_pParent->GetNoSelPhoto(); m_pParent->LoadPhotos();//更新显示 if(m_pParent->m_patharray2.GetSize()==0) { AfxMessageBox("没有选中的照片!");return; } /* CString name; if(!m_name1.IsEmpty ()) name=m_name1+","; name+=m_name2; name.TrimRight (",");*/ g_pMainWnd->PrintThumbNail(&(m_pParent->m_patharray2), "客人:"+m_name1+"-选片小图", m_pParent->m_mode2, m_pParent->m_size); } float ChoosePhotoSkin3::GetMoney() { float ret=0; for(int i=0; i