// BookingPage1.cpp : implementation file #include "stdafx.h" #include "ylgl.h" #include "BookingPage1.h" #include "SPLBDlg.h" #include "Booking2.h" #include "SelGrowthTXName.h" #include "ModifyReg.h" #include "Login2.h" #include "InputPrice.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif BookingPage1::BookingPage1(CWnd* pParent /*=NULL*/): CDialog(BookingPage1::IDD, pParent) { m_bz = _T(""); m_taoxijiage = _T(""); m_payed1 = _T(""); m_zs = _T(""); m_zs2 = _T(""); m_id = _T(""); m_taoxiname = _T(""); m_cost1=0; m_cost2=0; m_saleprice1=0; m_saleprice2=0; m_bGrowthTX=0; m_ncurgrowth=-1; } void BookingPage1::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_LIST9, m_listbox1); DDX_Control(pDX, IDC_EDITtaoxijiage, m_editnum3); //DDX_Control(pDX, IDC_EDITzs, m_editnum2);// 入底;//Jeff delete DDX_Control(pDX, IDC_EDITzs6, m_editnum2);// 入册;//Jeff add DDX_Control(pDX, IDC_EDITpayed1, m_editnum1); DDX_Control(pDX, IDC_LIST3, m_List3); DDX_Control(pDX, IDC_LIST1, m_List1); DDX_Control(pDX, IDC_COMBOtaoxiname, m_combotaoxiname); DDX_Control(pDX, IDC_COMBOtype2, m_combotype); DDX_Control(pDX, IDC_COMBOtype3, m_combofrom); DDX_Text(pDX, IDC_EDITbz, m_bz); DDX_Text(pDX, IDC_EDITtaoxijiage, m_taoxijiage); DDX_Text(pDX, IDC_EDITpayed1, m_payed1); DDX_Text(pDX, IDC_EDITzs, m_zs);//入底; DDX_Text(pDX, IDC_EDITzs6, m_zs2);//入册; DDX_Text(pDX, IDC_EDITid, m_id); DDX_CBString(pDX, IDC_COMBOtaoxiname, m_taoxiname); #ifdef LKAY_VERSION DDX_Control(pDX, IDC_COMBOdindantype, m_combodindantype); DDX_Text(pDX, IDC_EDITcontractno, m_contractno); DDX_Text(pDX, IDC_EDITcontractno2, m_contractno2); #endif DDX_Control(pDX, IDC_EDITid, m_OrderNumberEdit); } BEGIN_MESSAGE_MAP(BookingPage1, CDialog) ON_CBN_SELCHANGE(IDC_COMBOtaoxiname, OnSelchangeCOMBOtaoxiname) ON_BN_CLICKED(IDC_BUTdelall2, OnBUTdelall2) ON_BN_CLICKED(IDC_BUTdel3, OnBUTdel3) ON_BN_CLICKED(IDC_BUTspbox2, OnBUTspbox2) ON_BN_CLICKED(IDC_BUTdelall, OnBUTdelall) ON_BN_CLICKED(IDC_BUTdel, OnBUTdel) ON_BN_CLICKED(IDC_BUTspbox, OnBUTspbox) ON_BN_CLICKED(IDC_BUTdeljd, OnBUTdeljd) ON_BN_CLICKED(IDC_BUTaddjd, OnBUTaddjd) ON_BN_CLICKED(IDC_BUTTON1, OnButton1) ON_BN_CLICKED(IDC_BUTTON22, OnButton22) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) ON_BN_CLICKED(IDC_BUTTON9, OnButton9) ON_CBN_DROPDOWN(IDC_COMBOtype2, OnDropdownCOMBOtype2) ON_CBN_DROPDOWN(IDC_COMBOtype3, OnDropdownCOMBOtype3) ON_CBN_SELCHANGE(IDC_COMBOtype2, OnSelchangeCOMBOtype2) ON_BN_CLICKED(IDC_BUTTON14, OnButton14) ON_CBN_CLOSEUP(IDC_COMBOtaoxiname, OnCloseupCOMBOtaoxiname) ON_LBN_SELCHANGE(IDC_LIST9, OnSelchangeList9) ON_MESSAGE(WM_USER+100,OnListInputEnd) END_MESSAGE_MAP() void BookingPage1::OnCancel() { } void BookingPage1::OnOK() { } BOOL CALLBACK EnumChildProc3(HWND hwnd,LPARAM lParam) { CRect rtCtrl,rtWnd; if(hwnd) { ::GetWindowRect(hwnd,&rtCtrl); ::GetWindowRect(GetParent(hwnd),&rtWnd); rtCtrl.OffsetRect(-rtWnd.left,-rtWnd.top); float temp; temp= (float)rtCtrl.left*g_WidthScale2; rtCtrl.left = (int)temp; temp= (float)rtCtrl.top*g_HeightScale2; rtCtrl.top = (int)temp; temp = (float)rtCtrl.right*g_WidthScale2; rtCtrl.right = (int)temp; temp =(float)rtCtrl.bottom*g_HeightScale2; rtCtrl.bottom =(int)temp; ::MoveWindow(hwnd,rtCtrl.left,rtCtrl.top,rtCtrl.Width(),rtCtrl.Height(),TRUE); return TRUE; } else { return FALSE; } } BOOL BookingPage1::OnInitDialog() { CDialog::OnInitDialog(); if(IsHasRights2new(49)==0) { GetDlgItem(IDC_BUTTON1)->EnableWindow(0); GetDlgItem(IDC_BUTTON2)->EnableWindow(0); } // Jeff: 121位置:使用自定义订单号. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(121)) && ((Booking2*)GetParent())->m_bModify==0) { ((CEdit*)GetDlgItem(IDC_EDITid))->SetReadOnly (0); } #ifdef CHILD_VERSION #ifndef LKAY_VERSION GetDlgItem(IDC_COMBOdindantype)->ShowWindow (0); GetDlgItem(IDC_EDITcontractno)->ShowWindow (0); GetDlgItem(IDC_EDITcontractno2)->ShowWindow (0); GetDlgItem(IDC_STATIC1)->ShowWindow (0); GetDlgItem(IDC_STATIC5)->ShowWindow (0); GetDlgItem(IDC_STATIC6)->ShowWindow (0); #endif #endif CRect rc2; GetWindowRect(rc2); MoveWindow(m_rc); g_WidthScale2 = (float)m_rc.Width()/(float)rc2.Width(); // new/Old g_HeightScale2 = (float)m_rc.Height()/(float)rc2.Height(); EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc3,0); m_combotaoxiname.GetWindowRect (rc2); ScreenToClient(rc2); rc2.bottom +=200; m_combotaoxiname.MoveWindow (rc2); m_combotype.GetWindowRect (rc2); ScreenToClient(rc2); rc2.bottom +=200; m_combotype.MoveWindow (rc2); m_combofrom.GetWindowRect (rc2); ScreenToClient(rc2); rc2.bottom +=200; m_combofrom.MoveWindow (rc2); #ifdef LKAY_VERSION m_combodindantype.GetWindowRect (rc2); ScreenToClient(rc2); rc2.bottom +=200; m_combodindantype.MoveWindow (rc2); m_combodindantype.AddString ("意向客户"); m_combodindantype.AddString ("预约客户"); m_combodindantype.AddString ("定金客户"); m_combodindantype.AddString ("拍摄客户"); m_combodindantype.AddString ("重拍补拍"); if(((Booking2*)GetParent())->m_bModify) m_combodindantype.SetCurSel (m_combodindantype.FindString (0, m_dindantype)); else m_combodindantype.SetCurSel (0); #endif m_combotaoxiname.m_pList1array=&m_List1array; m_combotaoxiname.RefDroppedWidth(); int i = 0; if(((Booking2*)GetParent())->m_bModify) { #ifdef CHILD_VERSION #ifdef DDF_VERSION if(0) #else if("成长套系"==m_txtype) #endif { m_bGrowthTX=1; GetDlgItem(IDC_STATIC7)->SetWindowText("*成长套系-拍摄次数"); GetDlgItem(IDC_BUTTON2)->ShowWindow(SW_HIDE); } #endif m_oldtaoxijiage=m_taoxijiage; m_List1.InitStyle(); m_List1.m_mode=1; m_List1.InsertColumn(0,_T("autuid"),LVCFMT_LEFT,0); m_List1.InsertColumn(1,_T("编号"),LVCFMT_LEFT,55); m_List1.InsertColumn(2,_T("商品名称"),LVCFMT_LEFT,190); m_List1.InsertColumn(3,_T("价格"),LVCFMT_LEFT,55); m_List1.InsertColumn(4,_T("数量"),LVCFMT_LEFT,55); m_List1.InsertColumn(5,_T("加急"),LVCFMT_LEFT,45); m_List1.InsertColumn(6,_T("取件日期"),LVCFMT_LEFT,90); m_List3.InitStyle();m_List3.m_mode=1; m_List3.InsertColumn(0,_T("autuid"),LVCFMT_LEFT,0); m_List3.InsertColumn(1,_T("编号"),LVCFMT_LEFT,45); m_List3.InsertColumn(2,_T("商品名称"),LVCFMT_LEFT,235); m_List3.InsertColumn(3,_T("价格"),LVCFMT_LEFT,60); m_List3.InsertColumn(4,_T("数量"),LVCFMT_LEFT,45); m_combotype.AddString (m_txtype); m_combotype.SetCurSel (m_combotype.FindString (0, m_txtype)); m_combofrom.AddString (m_from); m_combofrom.SetCurSel (m_combofrom.FindString (0, m_from)); GetDlgItem(IDC_BUTdelall)->ShowWindow (SW_HIDE); GetDlgItem(IDC_BUTdelall2)->ShowWindow (SW_HIDE); ((CEdit*)GetDlgItem(IDC_EDITpayed1))->SetReadOnly (); for( i=0; iShowWindow (SW_HIDE); m_List1.InitStyle(); #ifndef CHILD_VERSION m_List1.InsertColumn(0,_T("编号"),LVCFMT_LEFT,45); m_List1.InsertColumn(1,_T("商品名称"),LVCFMT_LEFT,200); m_List1.InsertColumn(2,_T("价格"),LVCFMT_LEFT,60); m_List1.InsertColumn(3,_T("数量"),LVCFMT_LEFT,45); m_List1.InsertColumn(4,_T("加急"),LVCFMT_LEFT,45); m_List1.InsertColumn(5,_T("取件日期"),LVCFMT_LEFT,90); #else m_List1.InsertColumn(0,_T("编号"),LVCFMT_LEFT,90); m_List1.InsertColumn(1,_T("商品名称"),LVCFMT_LEFT,400); m_List1.InsertColumn(2,_T("价格"),LVCFMT_LEFT,120); m_List1.InsertColumn(3,_T("数量"),LVCFMT_LEFT,90); m_List1.InsertColumn(4,_T("加急"),LVCFMT_LEFT,90); m_List1.InsertColumn(5,_T("取件日期"),LVCFMT_LEFT,180); #endif m_List3.InitStyle(); m_List3.InsertColumn(0,_T("编号"),LVCFMT_LEFT,45); m_List3.InsertColumn(1,_T("商品名称"),LVCFMT_LEFT,235); m_List3.InsertColumn(2,_T("价格"),LVCFMT_LEFT,60); m_List3.InsertColumn(3,_T("数量"),LVCFMT_LEFT,45); NewID(); } return TRUE; } void BookingPage1::OnSelchangeCOMBOtaoxiname() { UpdateData(); int pos=m_combotaoxiname.GetCurSel (); if(pos==-1)return; m_combotaoxiname.GetLBText (pos, m_taoxiname); pos=-1; for(int i=0; im_bModify)addpos=1; m_List1Bakarray.RemoveAll (); m_List3Bakarray.RemoveAll (); m_List1.DeleteAllItems (); m_List3.DeleteAllItems (); int pos=0; int i = 0; for( i=0; im_bModify)addpos=1; m_cost1=0; m_saleprice1=0; CString str; int i = 0; for( i=0; im_bModify)addpos=1; m_cost2=0; CString str; m_saleprice2=0; int i = 0; for( i=0; im_bModify)addpos=1; m_cost1=0; m_saleprice1=0; CString str; int i = 0; for( i=0; im_bModify) { if(m_List1Bakarray.ElementAt (iItem).ElementAt (8).IsEmpty ()==0) { AfxMessageBox("此物品已选片, 不能删除!", MB_ICONSTOP); return; } if(m_List1Bakarray.ElementAt (iItem).ElementAt (2)!="" || m_List1Bakarray.ElementAt (iItem).ElementAt (3)!="") { AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP); return; } if(m_List1Bakarray.ElementAt (iItem).ElementAt (4)!="未完成" && m_List1Bakarray.ElementAt (iItem).ElementAt (4)!="") { AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP); return; } if(m_List1Bakarray.ElementAt (iItem).ElementAt (5)!="未取" && m_List1Bakarray.ElementAt (iItem).ElementAt (5)!="") { AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP); return; } m_List1.DeleteItem (iItem); m_List1Bakarray.RemoveAt(iItem); } else m_List1.DeleteItem (iItem); CalculateCost(); int count=m_List1.GetItemCount (); if(count) { if(iItem==count) iItem=0; m_List1.SetItemState (iItem, LVIS_SELECTED, LVIS_SELECTED); } if(m_bGrowthTX) { CString takename; int pos=m_listbox1.GetCurSel (); if(pos!=-1) { m_listbox1.GetText (pos, takename); } if(takename!="" && m_List1arraygrowthbak.GetSize()) { BOOL bFind=1; while(bFind) { int size=m_List1arraygrowthbak.GetSize(); int size2=m_List1arraygrowthbak.ElementAt (0).GetSize (); bFind=0; for(int i=0; im_bModify)addpos=1; int size=m_List1arraygrowthbak.GetSize (); m_List1arraygrowthbak.SetSize(size+m_List1.GetItemCount (), 1); for(int i=0; im_bModify)addpos=1; for(int a=0; am_bModify) { m_List1.InsertItem(pos, ""); m_List1.SetItemText(pos,1, dlg.m_spid); m_List1Bakarray.SetSize(m_List1.GetItemCount ()); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); } else m_List1.InsertItem(pos, dlg.m_spid); m_List1.SetItemText(pos,1+addpos, GetSPNameFromId(dlg.m_spid)); str.Format ("%f", GetSPPriceFromId3(dlg.m_spid)); ConvertToPrice (str); m_List1.SetItemText(pos,2+addpos, str); m_List1.SetItemText(pos,3+addpos, "1"); } } else { if(((Booking2*)GetParent())->m_bModify) { m_List1.InsertItem(pos, ""); m_List1.SetItemText(pos,1, dlg.m_spid); m_List1Bakarray.SetSize(m_List1.GetItemCount ()); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); m_List1Bakarray.ElementAt (pos).Add (""); } else m_List1.InsertItem(pos, dlg.m_spid); m_List1.SetItemText(pos,1+addpos, GetSPNameFromId(dlg.m_spid)); str.Format ("%f", GetSPPriceFromId3(dlg.m_spid)); ConvertToPrice (str); m_List1.SetItemText(pos,2+addpos, str); m_List1.SetItemText(pos,3+addpos, "1"); } } CalculateCost(); if(m_bGrowthTX) { CString takename; int pos=m_listbox1.GetCurSel (); if(pos!=-1) { m_listbox1.GetText (pos, takename); } if(takename!="" && m_List1arraygrowthbak.GetSize()) { BOOL bFind=1; while(bFind) { int size=m_List1arraygrowthbak.GetSize(); int size2=m_List1arraygrowthbak.ElementAt (0).GetSize (); bFind=0; for(int i=0; im_bModify) { if(m_List3Bakarray.ElementAt (iItem).ElementAt (8).IsEmpty ()==0) { AfxMessageBox("此物品已选片, 不能删除!", MB_ICONSTOP); return; } if(m_List3Bakarray.ElementAt (iItem).ElementAt (2)!="" || m_List3Bakarray.ElementAt (iItem).ElementAt (3)!="") { AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP); return; } if(m_List3Bakarray.ElementAt (iItem).ElementAt (4)!="未完成" && m_List3Bakarray.ElementAt (iItem).ElementAt (4)!="") { AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP); return; } if(m_List3Bakarray.ElementAt (iItem).ElementAt (5)!="未取" && m_List3Bakarray.ElementAt (iItem).ElementAt (5)!="") { AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP); return; } m_List3.DeleteItem (iItem); m_List3Bakarray.RemoveAt(iItem); } else m_List3.DeleteItem (iItem); CalculateCost2(); int count=m_List3.GetItemCount (); if(count==0)return; if(iItem==count) iItem=0; m_List3.SetItemState (iItem, LVIS_SELECTED, LVIS_SELECTED); } void BookingPage1::OnBUTspbox() { // TODO: Add your control notification handler code here SPBox dlg; #ifndef CHILD_VERSION dlg.m_mode=1; #endif if(dlg.DoModal ()!=IDOK)return; if(atoi(g_cominfoarray.ElementAt(0).ElementAt(114))) { Login2 dlg; dlg.m_mode=1; if(dlg.DoModal ()!=IDOK)return; if(IsHasRightsnew2(48, dlg.m_rights)==0)return; } int addpos=0; if(((Booking2*)GetParent())->m_bModify)addpos=1; for(int a=0; am_bModify) { m_List3.InsertItem(pos, ""); m_List3.SetItemText(pos,1, dlg.m_spid); m_List3Bakarray.SetSize(m_List3.GetItemCount ()); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); } else m_List3.InsertItem(pos, dlg.m_spid); m_List3.SetItemText(pos,1+addpos, GetSPNameFromId(dlg.m_spid)); str.Format ("%f", GetSPPriceFromId3(dlg.m_spid)); ConvertToPrice (str); m_List3.SetItemText(pos,2+addpos, str); m_List3.SetItemText(pos,3+addpos, "1"); } } else { if(((Booking2*)GetParent())->m_bModify) { m_List3.InsertItem(pos, ""); m_List3.SetItemText(pos,1, dlg.m_spid); m_List3Bakarray.SetSize(m_List3.GetItemCount ()); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); m_List3Bakarray.ElementAt (pos).Add (""); } else m_List3.InsertItem(pos, dlg.m_spid); m_List3.SetItemText(pos,1+addpos, GetSPNameFromId(dlg.m_spid)); str.Format ("%f", GetSPPriceFromId3(dlg.m_spid)); ConvertToPrice (str); m_List3.SetItemText(pos,2+addpos, str); m_List3.SetItemText(pos,3+addpos, "1"); } } CalculateCost2(); } void BookingPage1::OnBUTaddjd() { // TODO: Add your control notification handler code here if(m_bGrowthTX) { m_growthtxselname.Empty (); CString str; for(int i=0; i|", MB_ICONINFORMATION);return 0; } if(m_id.Find("\\")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } if(m_id.Find(":")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } if(m_id.Find("*")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } if(m_id.Find("?")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } if(m_id.Find("\"")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } if(m_id.Find("<")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } if(m_id.Find(">")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } if(m_id.Find("|")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } if(m_id.Find(".")!=-1) { AfxMessageBox("流水单号中请不要包含以下字符 /\\:*?\"<>|", MB_ICONINFORMATION);return 0; } m_id.TrimLeft (); m_id.TrimRight (); if(m_id.GetLength ()<3) { AfxMessageBox("流水单号太短", MB_ICONINFORMATION);return 0; } /* if("成长套系"==m_txtype) { if(m_growthtxselname.IsEmpty ()) { AfxMessageBox("成长套系包含的单次拍摄未设置!", MB_ICONINFORMATION); return 0; } }*/ m_growthtxselname=""; if(m_listbox1.GetCount ()==0) { if(m_bGrowthTX) AfxMessageBox("请录入至少一个单次拍摄!", MB_ICONINFORMATION); else AfxMessageBox("请录入至少一个景点!", MB_ICONINFORMATION); return 0; } CalculateCost(); CalculateCost2(); if(m_listbox1.GetCurSel ()==-1) SelFirst(); else OnSelchangeList9(); /////////////////////////////////// if(atoi(g_cominfoarray.ElementAt(0).ElementAt(113)) && (((Booking2*)GetParent())->m_bModify==0) ) { CString m_discount; if(atof(m_taoxijiage)>0 && (m_saleprice1+m_saleprice2)>0) m_discount.Format ("%0.3f", min(10.0, (atof(m_taoxijiage)*10)/(m_saleprice1+m_saleprice2)) ); else m_discount="0"; if(IsHasRights2new(26)==0)//无折扣权限 { if(m_discount!="10.0") { AfxMessageBox("无折扣权限,需授权!", MB_ICONINFORMATION); Login2 dlg; dlg.m_mode=2; if(dlg.DoModal ()!=IDOK)return 0; if(IsHasRightsnew2(26, dlg.m_rights)==0)return 0; if(m_saleprice1+m_saleprice2>1) { m_discount.Format ("%0.3f", min(10.0, (atof(m_taoxijiage)*10)/(m_saleprice1+m_saleprice2)) ); if(atof(m_discount)1) { m_discount.Format ("%0.3f", min(10.0, (atof(m_taoxijiage)*10)/(m_saleprice1+m_saleprice2)) ); if(atof(m_discount)m_bModify==0) { if(!NewID())return 0; } return 1; } BOOL BookingPage1::NewID() { if(atoi(g_cominfoarray.ElementAt(0).ElementAt(121)) && ((Booking2*)GetParent())->m_bModify==0) return 1; g_bNoConnDlg=1; CString date=g_date; date.Replace("-", ""); CString sql; sql="select max(id) as cot from dindan where id like '"+date+"%' "; g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql); g_bNoConnDlg=0; if(g_bSendOK==0)return 0; date.Replace ("-", ""); m_id.Format ("%s-%03d", date, g_ncount+1); SetDlgItemText(IDC_EDITid, m_id); return 1; } void BookingPage1::NewDan() { m_bz = _T(""); m_taoxijiage = _T(""); m_oldtaoxijiage=m_taoxijiage; m_taoxiname = _T(""); m_payed1 = _T(""); m_zs = _T(""); m_zs2 = _T(""); m_cost1=0; m_cost2=0; m_saleprice1=0; m_saleprice2=0; m_id = _T(""); UpdateData(false); m_combotaoxiname.SetCurSel (-1); m_combotype.SetCurSel (-1); m_combofrom.SetCurSel (-1); m_List1.DeleteAllItems (); CalculateCost(); m_List3.DeleteAllItems (); CalculateCost2(); m_listbox1.ResetContent (); NewID(); } void BookingPage1::OnButton1() { // TODO: Add your control notification handler code here SPLBDlg dlg; dlg.m_mode=3; dlg.DoModal (); m_combotype.ResetContent (); } void BookingPage1::OnButton22() { // TODO: Add your control notification handler code here SPLBDlg dlg; dlg.m_mode=8; dlg.DoModal (); m_combofrom.ResetContent (); } void BookingPage1::OnButton2() { // TODO: Add your control notification handler code here SPLBDlg dlg; dlg.m_mode=1; dlg.DoModal (); } void BookingPage1::OnDropdownCOMBOtype2() { // TODO: Add your control notification handler code here if(m_combotype.GetCount ()<2) { g_sendhead.bsql=0; g_sendhead.code[0]=157; g_sendhead.tabcount=1; g_pMainWnd->ProcessChatMessageRequest2(3);if(g_bSendOK==0)return; DataToArray(&g_List1array); for(int ii=0; iiProcessChatMessageRequest2(3);if(g_bSendOK==0)return; DataToArray(&g_List1array); for(int ii=0; iiSetWindowText("*成长套系-拍摄次数"); GetDlgItem(IDC_BUTTON2)->ShowWindow(SW_HIDE); } else { m_bGrowthTX=0; GetDlgItem(IDC_STATIC7)->SetWindowText("*景点"); GetDlgItem(IDC_BUTTON2)->ShowWindow(SW_SHOW); } #endif } void BookingPage1::OnButton9() // 删除记录; { // TODO: Add your control notification handler code here ModifyReg dlg; dlg.m_id=m_id; dlg.DoModal (); } void BookingPage1::OnButton14() { // TODO: Add your control notification handler code here if(atoi(g_cominfoarray.ElementAt(0).ElementAt(113))) { Login2 dlg; dlg.m_mode=2; if(dlg.DoModal ()!=IDOK)return; if(IsHasRightsnew2(26, dlg.m_rights)==0)return; InputPrice dlg2; if(dlg2.DoModal ()!=IDOK)return; float discount=atof(dlg.m_discount)/10.0; if(atof(dlg2.m_price)SetWindowText("套系包含产品-"+takename); if(m_List1arraygrowthbak.GetSize()==0 && m_List1.GetItemCount()) { int addpos=0; if(((Booking2*)GetParent())->m_bModify)addpos=1; int size=m_List1arraygrowthbak.GetSize (); m_List1arraygrowthbak.SetSize(size+m_List1.GetItemCount (), 1); for(int i=0; i=m_listbox1.GetCount())return; int pos=m_ncurgrowth; CString takename; m_listbox1.GetText (pos, takename); if(takename!="" && m_List1arraygrowthbak.GetSize() && m_List1.GetItemCount()) { BOOL bFind=1; while(bFind) { int size=m_List1arraygrowthbak.GetSize(); int size2=m_List1arraygrowthbak.ElementAt (0).GetSize (); bFind=0; for(int i=0; im_bModify)addpos=1; int size=m_List1arraygrowthbak.GetSize (); m_List1arraygrowthbak.SetSize(size+m_List1.GetItemCount (), 1); for(int i=0; i