1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912 |
- // Booking.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "Booking.h"
- #include "MyMdi.H"
- #include "ClientDlg.h"
- #include "ClientDlg2.h"
- #include "SetStyle.h"
- #include "InputMemberno.h"
- #include "SelMemberType.h"
- #include "AddMember.h"
- #include "InputCard2Dlg.h"
- #include "SPLBDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // Booking pinyin1 IDC_STATIC2
- IMPLEMENT_DYNCREATE(Booking, MyFormView)
- Booking::Booking()
- : MyFormView(Booking::IDD)
- {
- //{{AFX_DATA_INIT(Booking)
- m_taoxijiage = _T("");
- m_zs = _T("");
- m_discount = _T("");
- m_money1 = _T("");
- m_money2 = _T("");
- m_money3 = _T("");
- m_name1 = _T("");
- m_name2 = _T("");
- m_payed1 = _T("");
- m_payed2 = _T("");
- m_payed3 = _T("");
- m_payed4 = _T("");
- m_payed5 = _T("");
- m_time1 = g_date;
- m_time2 = _T("");
- m_time3 = _T("");
- m_bz = _T("");
- m_clothescount = _T("");
- m_clothescount2 = _T("");
- m_outside = _T("");
- m_outside2 = _T("");
- m_style = _T("");
- m_choosephotomoney = _T("");
- m_takephotomoney = _T("");
- m_waiter6 = g_user.name ;
- m_nFocusPos=0;
- m_cost1=m_cost2=0;
- //}}AFX_DATA_INIT
- }
- Booking::~Booking()
- {
- }
- void Booking::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(Booking)
- DDX_Control(pDX, IDC_LIST9, m_listbox1);
- DDX_Control(pDX, IDC_EDITzs, m_numedit4);
- DDX_Control(pDX, IDC_EDITtaoxijiage, m_numedit3);
- DDX_Control(pDX, IDC_EDITtime3, m_datectrl2);
- DDX_Control(pDX, IDC_EDITtime2, m_datectrl1);
- DDX_Control(pDX, IDC_EDITtime1, m_datectrl3);
- DDX_Control(pDX, IDC_EDITpayed1, m_edit2);
- DDX_Control(pDX, IDC_EDITdiscount, m_edit1);
- DDX_Control(pDX, IDC_COMBObm, m_combobm);
- DDX_Control(pDX, IDC_COMBOarea, m_comboarea);
- DDX_Control(pDX, IDC_COMBOtype2, m_combotype);
- DDX_Control(pDX, IDC_COMBOrenyuan, m_comborenyuan);
- DDX_Control(pDX, IDC_COMBOid, m_comboid);
- DDX_Control(pDX, IDC_LIST3, m_List3);
- DDX_Control(pDX, IDC_LIST1, m_List1);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_Control(pDX, IDC_COMBOtaoxiname, m_combotaoxiname);
- DDX_Text(pDX, IDC_EDITtaoxijiage, m_taoxijiage);
- DDX_Text(pDX, IDC_EDITzs, m_zs);
- DDX_Text(pDX, IDC_EDITdiscount, m_discount);
- DDX_Text(pDX, IDC_EDITmoney1, m_money1);
- DDX_Text(pDX, IDC_EDITmoney2, m_money2);
- DDX_Text(pDX, IDC_EDITmoney3, m_money3);
- DDX_Text(pDX, IDC_EDITname1, m_name1);
- DDX_Text(pDX, IDC_EDITname2, m_name2);
- DDX_Text(pDX, IDC_EDITpayed1, m_payed1);
- DDX_Text(pDX, IDC_EDITpayed2, m_payed2);
- DDX_Text(pDX, IDC_EDITpayed3, m_payed3);
- DDX_Text(pDX, IDC_EDITpayed4, m_payed4);
- DDX_Text(pDX, IDC_EDITpayed5, m_payed5);
- DDX_Text(pDX, IDC_EDITtime1, m_time1);
- DDX_Text(pDX, IDC_EDITtime2, m_time2);
- DDX_Text(pDX, IDC_EDITtime3, m_time3);
- DDX_Text(pDX, IDC_EDITbz, m_bz);
- DDV_MaxChars(pDX, m_bz, 1000);
- DDX_Text(pDX, IDC_EDITOclothescount, m_clothescount);
- DDX_Text(pDX, IDC_EDITOclothescount2, m_clothescount2);
- DDX_Text(pDX, IDC_EDITOoutside, m_outside);
- DDX_Text(pDX, IDC_EDITOoutside2, m_outside2);
- DDX_Text(pDX, IDC_EDITwaiter6, m_memberno);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(Booking, MyFormView)
- //{{AFX_MSG_MAP(Booking)
- ON_BN_CLICKED(IDC_BUTsave, OnBUTsave)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_CBN_SELCHANGE(IDC_COMBOtaoxiname, OnSelchangeCOMBOtaoxiname)
- ON_BN_CLICKED(IDC_BUTspbox, OnBUTspbox)
- ON_WM_TIMER()
- ON_EN_CHANGE(IDC_EDITtaoxijiage, OnChangeEDITtaoxijiage)
- ON_EN_CHANGE(IDC_EDITdiscount, OnChangeEDITdiscount)
- ON_EN_CHANGE(IDC_EDITpayed1, OnChangeEDITpayed1)
- ON_CBN_DROPDOWN(IDC_COMBObm, OnDropdownCOMBObm)
- ON_CBN_DROPDOWN(IDC_COMBOrenyuan, OnDropdownCOMBOrenyuan)
- ON_CBN_SELCHANGE(IDC_COMBObm, OnSelchangeCOMBObm)
- ON_CBN_DROPDOWN(IDC_COMBOid, OnDropdownCOMBOid)
- ON_CBN_SELCHANGE(IDC_COMBOid, OnSelchangeCOMBOid)
- ON_BN_CLICKED(IDC_BUTWaiter, OnBUTWaiter)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
- ON_BN_CLICKED(IDC_BUTstyle, OnBUTstyle)
- ON_BN_CLICKED(IDC_BUTdel, OnBUTdel)
- ON_BN_CLICKED(IDC_BUTdelall, OnBUTdelall)
- ON_BN_CLICKED(IDC_BUTspbox2, OnBUTspbox2)
- ON_BN_CLICKED(IDC_BUTdel3, OnBUTdel3)
- ON_BN_CLICKED(IDC_BUTdelall2, OnBUTdelall2)
- ON_BN_CLICKED(IDC_BUTaddjd, OnBUTaddjd)
- ON_BN_CLICKED(IDC_BUTdeljd, OnBUTdeljd)
- ON_BN_CLICKED(IDC_BUTinfo1, OnBUTinfo1)
- ON_BN_CLICKED(IDC_BUTinfo2, OnBUTinfo2)
- ON_BN_CLICKED(IDC_BUTinfo3, OnBUTinfo3)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // Booking diagnostics
- #ifdef _DEBUG
- void Booking::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void Booking::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // Booking message handlers
- void Booking::OnInitialUpdate()
- {
- MyFormView::OnInitialUpdate();
- #ifdef NOCALCOST
- GetDlgItem(IDC_STATIC2)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_STATIC4)->ShowWindow(SW_HIDE);
- #endif
- #ifndef CHILD_VERSION
- #ifndef ZHIAI_VERSION
- GetDlgItem(IDC_STATIC10)->SetWindowText("服装套数:");
- GetDlgItem(IDC_STATIC11)->SetWindowText("造型:");
- GetDlgItem(IDC_STATIC12)->SetWindowText("外景:");
- GetDlgItem(IDC_STATIC13)->SetWindowText("内景:");
- #endif
- #endif
- // TODO: Add your specialized code here and/or call the base class
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
-
- // 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,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
- EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
- m_combotype.AddString ("婚纱照");
- m_combotype.AddString ("写真照");
- m_combotype.AddString ("宝宝照");
- m_combotype.AddString ("全家福");
- m_combotype.AddString ("情侣照");
- m_combotaoxiname.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_combotaoxiname.MoveWindow (rc2);
- m_combobm.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_combobm.MoveWindow (rc2);
- m_combotype.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_combotype.MoveWindow (rc2);
- m_comborenyuan.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_comborenyuan.MoveWindow (rc2);
- m_comboid.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=600;
- m_comboid.MoveWindow (rc2);
- #ifdef ZHIAI_VERSION
- GetDlgItem(IDC_EDITOoutside)->GetWindowRect(rc2);
- GetDlgItem(IDC_EDITOoutside)->ShowWindow(0);
- ScreenToClient(rc2);
- m_comboarea.MoveWindow (rc2);
-
- m_comboarea.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=600;
- m_comboarea.MoveWindow (rc2);
- #else
- m_comboarea.ShowWindow(0);
- #endif
- GetDlgItem(IDC_EDITmoney1)->GetWindowRect(rc2);
- SetComboHei(&m_comboid, rc2.Height ());
- SetComboHei(&m_comborenyuan, rc2.Height ());
- SetComboHei(&m_combotaoxiname, rc2.Height ());
- SetComboHei(&m_combobm, rc2.Height ());
- SetComboHei(&m_combotype, rc2.Height ());
- SetComboHei(&m_comboarea, rc2.Height ());
- m_static1.SetFont (&g_titlefont);
- int i;
- #ifdef ZHIAI_VERSION
- g_sendhead.bsql=0;
- g_sendhead.code[0]=6;
- g_sendhead.code[1]=7;
- g_sendhead.code[2]=10;
- g_sendhead.code[3]=4;
- g_sendhead.code[4]=82;
- g_sendhead.tabcount=5;
- g_pMainWnd->ProcessChatMessageRequest2(6);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>areaarray;
- DataToArray(&m_List1array, &m_List2array, &m_List3array, &m_sparray, &areaarray);
- for( i=0; i<areaarray.GetSize(); i++)
- {
- m_comboarea.AddString(areaarray.ElementAt(i).ElementAt(0));
- }
- #else
- g_sendhead.bsql=0;
- g_sendhead.code[0]=6;
- g_sendhead.code[1]=7;
- g_sendhead.code[2]=10;
- g_sendhead.code[3]=4;
- g_sendhead.tabcount=4;
- g_pMainWnd->ProcessChatMessageRequest2(6);if(g_bSendOK==0)return;
- DataToArray(&m_List1array, &m_List2array, &m_List3array, &m_sparray);
- #endif
- for(i=0; i<m_List1array.GetSize (); i++)
- m_combotaoxiname.AddString (m_List1array.ElementAt (i).ElementAt (1));
-
- m_List1.InitStyle();
- 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);
- 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);
- CRect rc;
- GetDlgItem(IDC_STATIC5)->GetWindowRect(rc);
- ScreenToClient(rc);
-
- OnBUTinfo1();
- rc2=rc;
- rc2.bottom =rc2.top;
- rc2.top -=1;
- GetDlgItem(IDC_STATIC6)->MoveWindow(rc2);
- rc2=rc;
- rc2.top =rc2.bottom;
- rc2.bottom +=1;
- GetDlgItem(IDC_STATIC7)->MoveWindow(rc2);
- }
- void Booking::OnSelchangeCOMBOtaoxiname()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- int pos=m_combotaoxiname.GetCurSel ();
- if(pos==-1)return;
-
- m_combotaoxiname.GetLBText (pos, taoxiname);
- pos=-1;
- for(int i=0; i<m_List1array.GetSize (); i++)
- {
- if(taoxiname==m_List1array.ElementAt (i).ElementAt (1))
- {
- pos=i;
- break;
- }
- }
- if(pos==-1)
- {
- m_taoxiid = "";
- m_taoxijiage = "";
- m_zs = "";
- UpdateData(false);
- OnChangeEDITtaoxijiage();
- m_List1.DeleteAllItems ();
- return;
- }
- m_taoxiid = m_List1array.ElementAt (pos).ElementAt (0);
- m_taoxijiage = m_List1array.ElementAt (pos).ElementAt (2);
- m_zs = m_List1array.ElementAt (pos).ElementAt (3);
- UpdateData(false);
- OnChangeEDITtaoxijiage();
- FillGrid();
- }
- void Booking::FillGrid()
- {
- m_List1.DeleteAllItems ();
- m_List3.DeleteAllItems ();
- int pos=0;
- for(int i=0; i<m_List2array.GetSize (); i++)
- {
- if(m_List2array.ElementAt (i).ElementAt (0)!=m_taoxiid)continue;
- m_List1.InsertItem(pos, m_List2array.ElementAt (i).ElementAt (1));
- m_List1.SetItemText(pos,1, GetSPNameFromId(m_List2array.ElementAt (i).ElementAt (1)));
-
- m_List1.SetItemText(pos,2, GetSPPriceFromId2(m_List2array.ElementAt (i).ElementAt (1)));
- m_List1.SetItemText(pos,3, m_List2array.ElementAt (i).ElementAt (2));
-
- pos++;
- }
-
- pos=0;
- for( i=0; i<m_List3array.GetSize (); i++)
- {
- if(m_List3array.ElementAt (i).ElementAt (0)!=m_taoxiid)continue;
- m_List3.InsertItem(pos, m_List3array.ElementAt (i).ElementAt (1));
- m_List3.SetItemText(pos,1, GetSPNameFromId(m_List3array.ElementAt (i).ElementAt (1)));
- m_List3.SetItemText(pos,2, GetSPPriceFromId2(m_List3array.ElementAt (i).ElementAt (1)));
- m_List3.SetItemText(pos,3, m_List3array.ElementAt (i).ElementAt (2));
- pos++;
- }
- CalculateCost();
- }
- float Booking::GetSPPriceFromId(CString id)
- {
- for(int i=0; i<m_sparray.GetSize (); i++)
- {
- if(id==m_sparray.ElementAt (i).ElementAt (0))
- return atof(m_sparray.ElementAt (i).ElementAt (3));
- }
- return 0;
- }
- float Booking::GetSPPriceFromId3(CString id)
- {
- for(int i=0; i<m_sparray.GetSize (); i++)
- {
- if(id==m_sparray.ElementAt (i).ElementAt (0))
- return atof(m_sparray.ElementAt (i).ElementAt (4));
- }
- return 0;
- }
- CString Booking::GetSPPriceFromId2(CString id)
- {
- for(int i=0; i<m_sparray.GetSize (); i++)
- {
- if(id==m_sparray.ElementAt (i).ElementAt (0))
- return m_sparray.ElementAt (i).ElementAt (4);
- }
- return "";
- }
- CString Booking::GetSPNameFromId(CString id)
- {
- for(int i=0; i<m_sparray.GetSize (); i++)
- {
- if(id==m_sparray.ElementAt (i).ElementAt (0))
- return m_sparray.ElementAt (i).ElementAt (1);
- }
- id.TrimLeft ("0");
- for( i=0; i<m_sparray.GetSize (); i++)
- {
- if(id==m_sparray.ElementAt (i).ElementAt (0))
- return m_sparray.ElementAt (i).ElementAt (1);
- }
- return "";
- }
- BOOL Booking::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- if(pMsg->message==WM_KEYDOWN)
- {
- switch( pMsg->wParam )
- {
- case 0x43: // copy
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_COPY);
- return TRUE;
- }
- break;
- case 0x56: //Ctrl + V:
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_PASTE);
- return TRUE;
- }
- break;
- case 0x58: // cut
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_CUT);
- return TRUE;
- }
- break;
- case 0x5A: //undo
- case 0x59: //redo
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_UNDO);
- return TRUE;
- }
- break;
- }
- }
- else if(0)//pMsg->message==WM_LBUTTONDBLCLK)
- {
- {//list1
- CPoint pt;
- CRect rc,rc2;
- ::GetCursorPos (&pt);
- m_List1.GetWindowRect (rc2);
- if(rc2.PtInRect (pt)==0)
- goto mm;
- pt.x-=rc2.left ;
- pt.y-=rc2.top ;
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)return 1;
- int iItem=m_List1.GetNextSelectedItem(pos);
- {
- m_List1.GetSubItemRect( iItem, 3, LVIR_BOUNDS, rc);
- if(rc.PtInRect (pt))
- return MyFormView::PreTranslateMessage(pMsg);
- else
- return 1;
- }
- }
- mm: {//list3
- CPoint pt;
- CRect rc,rc2;
- ::GetCursorPos (&pt);
- m_List3.GetWindowRect (rc2);
- if(rc2.PtInRect (pt)==0)
- return MyFormView::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, 3, LVIR_BOUNDS, rc);
- if(rc.PtInRect (pt))
- return MyFormView::PreTranslateMessage(pMsg);
- else
- return 1;
- }
-
- }
-
- if(0)//pMsg->message==WM_LBUTTONDOWN)
- {
- {//list1
- CPoint pt;
- CRect rc,rc2;
- ::GetCursorPos (&pt);
- m_List1.GetWindowRect (rc2);
- if(rc2.PtInRect (pt)==0)
- goto oo;
- m_nFocusPos=0;
- SetTimer(1, 300, NULL);
- goto oo;
- }
- nn:
- oo: {//list3
- CPoint pt;
- CRect rc,rc2;
- ::GetCursorPos (&pt);
- m_List3.GetWindowRect (rc2);
- if(rc2.PtInRect (pt)==0) return MyFormView::PreTranslateMessage(pMsg);
- SetTimer(3, 300, NULL);
- }
- }
- return MyFormView::PreTranslateMessage(pMsg);
- }
- void Booking::SetSPName1()
- {
- CString str;
- for(int i=0; i<m_List1.GetItemCount (); i++)
- {
- if(GetSPNameFromId(m_List1.GetItemText (i, 0))!="")
- m_List1.SetItemText(i,1, GetSPNameFromId(m_List1.GetItemText (i, 0)));
- str.Format ("%f", GetSPPriceFromId(m_List1.GetItemText (i, 0)));
- ConvertToPrice (str);
- m_List1.SetItemText(i,2, str);
- // m_List1.SetItemText(i,3, "1");
- }
- CalculateCost();
- }
- void Booking::SetSPName2()
- {
- }
- void Booking::SetSPName3()
- {
- CString str;
- for(int i=0; i<m_List3.GetItemCount (); i++)
- {
- if(GetSPNameFromId(m_List3.GetItemText (i, 0))!="")
- m_List3.SetItemText(i,1, GetSPNameFromId(m_List3.GetItemText (i, 0)));
- str.Format ("%f", GetSPPriceFromId(m_List3.GetItemText (i, 0)));
- ConvertToPrice (str);
- m_List3.SetItemText(i,2, str);
- // m_List3.SetItemText(i,3, "1");
- }
- CalculateCost2();
- }
- void Booking::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- if(nIDEvent==1)
- {
- KillTimer(nIDEvent);
- SetSPName1();
- }
- else if(nIDEvent==2)
- {
- KillTimer(nIDEvent);
- SetSPName2();
- }
- else if(nIDEvent==3)
- {
- KillTimer(nIDEvent);
- SetSPName3();
- }
- }
- void Booking::OnBUTsave()
- {
- if(IsHasRights2(0)==0)
- return;
- // TODO: Add your control notification handler code here
- UpdateData();
- int pos=m_comboid.GetCurSel ();
- if(pos==-1)
- {
- AfxMessageBox("资料不全,打*号的项目必须填写!", MB_ICONINFORMATION);
- return;
- }
- CString id;
- m_comboid.GetLBText (pos, id);
- BOOL bAdd=1;
- if(pos)bAdd=0;
- if(m_name1.IsEmpty () && m_name2.IsEmpty ())
- {
- AfxMessageBox("资料不全,打*号的项目必须填写!", MB_ICONINFORMATION);
- return;
- }
- if(m_name1.Find("*")!=-1 || m_name2.Find("*")!=-1 )
- {
- AfxMessageBox("客人名字非法!", MB_ICONINFORMATION);
- return;
- }
- CalculateCost();
- CalculateCost2();
-
- pos=m_combotaoxiname.GetCurSel ();
- if(pos!=-1)
- {
- m_combotaoxiname.GetLBText (pos, taoxiname);
- }
- else
- {
- m_combotaoxiname.GetWindowText (taoxiname);
- m_taoxiid.Empty ();
- }
- m_taoxijiage.TrimLeft ();
- m_taoxijiage.TrimRight ();
- m_payed1.TrimLeft ();
- m_payed1.TrimRight ();
- if(taoxiname.IsEmpty () || m_taoxijiage.IsEmpty ()|| m_payed1.IsEmpty ()||m_zs.IsEmpty ())
- {
- AfxMessageBox("资料不全,打*号的项目必须填写!", MB_ICONINFORMATION);
- return;
- }
- CString bm;
- pos=m_combobm.GetCurSel ();
- if(pos!=-1)
- {
- m_combobm.GetLBText (pos, bm);
- }
- CString ren,txtype,area;
- pos=m_comborenyuan.GetCurSel ();
- if(pos!=-1)
- {
- m_comborenyuan.GetLBText (pos, ren);
- }
- else
- {
- AfxMessageBox("资料不全,打*号的项目必须填写!", MB_ICONINFORMATION);
- return;
- }
- pos=m_combotype.GetCurSel ();
- if(pos!=-1)
- {
- m_combotype.GetLBText (pos, txtype);
- }
- else
- {
- AfxMessageBox("资料不全,打*号的项目必须填写!", MB_ICONINFORMATION);
- return;
- }
- #ifdef ZHIAI_VERSION
- pos=m_comboarea.GetCurSel ();
- if(pos!=-1)
- {
- m_comboarea.GetLBText (pos, area);
- }
- m_outside=area;
- #endif
- if(!CheckDateOK(m_time2))return;
- if(!CheckDateOK(m_time3))return;
- #ifndef NOCALCOST
- if(atof(m_taoxijiage)<m_cost1+m_cost2)
- {
- if(AfxMessageBox("警告:套系价格低于成本, 可能是亏本生意, 是否继续?", MB_YESNO|MB_ICONSTOP)!=IDYES)return;
- }
- #endif
- CString strmoney;
- float list3money=0;
- strmoney.Format ("%f", list3money);
- ConvertToPrice(strmoney);
- CString sql,str,str2;
- CString strRes1,strRes2;
- GetFirstLetter(m_name1, strRes1);
- GetFirstLetter(m_name2, strRes2);
-
- m_waiter6=g_user.name ;
- CString m_membernotemp=m_memberno;
- if(m_type)m_memberno.Empty ();
- if(bAdd)
- {
- CTime time=CTime::GetCurrentTime ();
-
- CString date=g_date;
- sql="select max(id) as cot from dindan where time1='"+date+"' ";
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- date.Replace ("-", "");
- id.Format ("%s-%03d", date, g_ncount+1);
- if(m_comboid.FindString (0, id)==-1)
- {
- m_comboid.InsertString(0,id);
- m_comboid.SetCurSel (0);
- }
- CString newid;
- newid.Format ("%s-%03d", date, g_ncount+2);
- m_comboid.InsertString(0,newid);
- UpdateData(false);
- m_sid=id;
- sql.Format ("insert into [dindan]([id],[money1],[name1],[name2],[taoxiid],[taoxiname],[taoxijiage],[taoxizs],[time1],[time2],[time3],[bm],[ren],[discount],[payed1],[status],[status2],[status3],[status4],[status6],[status5],[status7],[status8],[urgent],[bz],[pinyin1],[pinyin2],[clothescount],[clothescount2],[outside],[outside2],[style],[waiter6],[memberno],[txtype],[tichenren1],[tichenren2],[tichenren3],[tichenren4],[tichenren5])values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','未拍','未选','未取','未修','未修','未设计','未刻','未看','否','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','','','','','')",
- id,strmoney,m_name1,m_name2,m_taoxiid,taoxiname,m_taoxijiage,m_zs,m_time1,m_time2,m_time3,bm,ren,m_discount,m_payed1,FilterBZ(m_bz),strRes1,strRes2,m_clothescount,m_clothescount2,m_outside,m_outside2,m_style,m_waiter6,m_memberno,txtype);
-
- sql+="###insert into [client](id,name1,name2)values('"+id+"','"+m_name1+"','"+m_name2+"')";
-
- CString sql2;
- sql2="###"+id+"$$$"+m_memberno;
- sql+=sql2;
- }
- m_memberno=m_membernotemp;
-
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>sparray;
- sparray.SetSize(m_List1.GetItemCount ()+m_List3.GetItemCount ()+m_listbox1.GetCount());
- int realcount=0;
- for(int i=0; i<m_List1.GetItemCount (); i++)
- {
- str=m_List1.GetItemText (i, 1);
- str.TrimLeft (); str.TrimRight ();
- if(str.IsEmpty ())
- continue;
- sparray.ElementAt (realcount).Add ( id );
- sparray.ElementAt (realcount).Add ( m_List1.GetItemText (i, 0) );
- sparray.ElementAt (realcount).Add ( m_List1.GetItemText (i, 2) );
- sparray.ElementAt (realcount).Add ( m_List1.GetItemText (i, 3) );
- sparray.ElementAt (realcount).Add ( "1" );
- sparray.ElementAt (realcount).Add ( m_List1.GetItemText (i, 1) );
- sparray.ElementAt (realcount).Add ( m_List1.GetItemText (i, 4) );
- sparray.ElementAt (realcount).Add ( m_List1.GetItemText (i, 5) );
- realcount++;
- }
- for( i=0; i<m_List3.GetItemCount (); i++)
- {
- str=m_List3.GetItemText (i, 1);
- str.TrimLeft (); str.TrimRight ();
- if(str.IsEmpty ())continue;
- sparray.ElementAt (realcount).Add ( id );
- sparray.ElementAt (realcount).Add ( m_List3.GetItemText (i, 0) );
- sparray.ElementAt (realcount).Add ( m_List3.GetItemText (i, 2) );
- sparray.ElementAt (realcount).Add ( m_List3.GetItemText (i, 3) );
- sparray.ElementAt (realcount).Add ( "2" );
- sparray.ElementAt (realcount).Add ( m_List3.GetItemText (i, 1) );
- sparray.ElementAt (realcount).Add ( "" );
- sparray.ElementAt (realcount).Add ( "" );
- realcount++;
- }
- for(i=0; i<m_listbox1.GetCount (); i++)
- {
- m_listbox1.GetText (i, str);
- sparray.ElementAt (realcount).Add ( id );
- sparray.ElementAt (realcount).Add ( str );
- realcount++;
- }
- sparray.SetSize(realcount);
- if(realcount==0)
- {
- sparray.SetSize(1);
- sparray.ElementAt (0).Add (id);
- }
-
- CMemFile memfile;
- CArchive ar(&memfile, CArchive::store);
- for(int ii=0; ii<sparray.GetSize (); ii++)
- {
- sparray.ElementAt (ii).Serialize (ar);
- }
- ar.Close();
- int length=memfile.GetLength ();
- BYTE *pData = memfile.Detach();
- int size=sparray.GetSize ();
- BYTE *pData2=new BYTE[length+sizeof(int)];
- memcpy(pData2, pData, length);
- memcpy(pData2+length, &size, sizeof(int));
- delete []pData;
- length+=sizeof(int);
- g_nSendCode=3;
- g_pMainWnd->ProcessChatMessageRequest2(pData2, length);
- g_nSendCode=0;
- delete []pData2;
- if(g_bSendOK==0)return;
- AfxMessageBox("保存成功!", MB_ICONINFORMATION);
- if(m_type==1||m_type==3)
- SaveCard2Data();
- GetDlgItem(IDC_BUTsave)->EnableWindow(0);
- GetDlgItem(IDC_BUTclient)->EnableWindow(1);
- GetDlgItem(IDC_BUTprint)->EnableWindow(1);
- if(IsHasRights2(4))
- GetDlgItem(IDC_BUTWaiter)->EnableWindow(1);
- CString phone;
- if(bAdd)
- {
- #ifdef CHILD_VERSION
- CClientDlg2 dlg;
- #else
- CClientDlg dlg;
- dlg.m_hqtime=m_time3;
- #endif
- dlg.m_phone1=m_phone1;
- dlg.m_phone2=m_phone2;
- dlg.m_bAdd=1;
- dlg.m_bNeedSendMsg=1;
- dlg.id =id;
- dlg.m_name1 =m_name1;
- dlg.m_name2 =m_name2;
- if(dlg.DoModal ()==IDOK)
- {
- #ifdef CHILD_VERSION
- phone=dlg.m_phone1 ;
- #else
- phone=dlg.m_phone2 ;
- #endif
- m_name1=dlg.m_name1 ;
- m_name2=dlg.m_name2 ;
- UpdateData(false);
- }
- }
- BOOL bNeedCard=0;
- if(m_type==1 || m_type==2 || m_type==3)
- bNeedCard=1;
- if(m_memberno.IsEmpty ())
- bNeedCard=1;
- if(bNeedCard)
- {
- SelMemberType dlg;
- if(dlg.DoModal ()==IDOK)
- {
- if(dlg.m_type==0)
- {
- AddMember dlg;
- dlg.m_name =m_name2;
- dlg.m_phone =phone;
- if(dlg.DoModal ()==IDOK)
- {
- if(AfxMessageBox("会员添加成功,是否发放副卡?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
- {
- InputCard2Dlg dlg2;
- dlg2.m_name =dlg.m_name;
- dlg2.m_no =dlg.m_memberno ;
- dlg2.DoModal ();
- }
- sql="update dindan set [memberno]='"+dlg.m_memberno+"' where [id]='"+id+"'";
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- }
- }
- else
- {
- AddMember dlg;
- dlg.m_mode=1;
- dlg.m_name =m_name2;
- dlg.m_phone =phone;
- dlg.m_jiage =m_money1;
- if(dlg.DoModal ()==IDOK)
- {
- if(AfxMessageBox("会员添加成功,是否发放副卡?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
- {
- InputCard2Dlg dlg2;
- dlg2.m_mode=1;
- dlg2.m_name =dlg.m_name;
- dlg2.m_no =dlg.m_memberno ;
- dlg2.DoModal ();
- }
- sql="update dindan set [memberno]='"+dlg.m_memberno+"' where [id]='"+id+"'";
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- }
- }
- }
- }
- }
- void Booking::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- void Booking::OnChangeEDITtaoxijiage()
- {
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the MyFormView::OnInitDialog()
- // function and call CRichEditCtrl().SetEventMask()
- // with the ENM_CHANGE flag ORed into the mask.
- /* UpdateData();
- CString str;
- float list3money=0;
- for(int i=0; i<m_List3.GetItemCount (); i++)
- {
- list3money+=GetSPPriceFromId(m_List3.GetItemText (i, 0))*atof(m_List3.GetItemText(i,3));
- }
- m_money1.Format ("%f", list3money+atof(m_taoxijiage)-atof(m_discount));
- m_money2=m_payed1;
- m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- UpdateData(false);
- */
- UpdateData();
- CString str;
- float list3money=0;
- /* for(int i=0; i<m_List3.GetItemCount (); i++)
- {
- list3money+=GetSPPriceFromId(m_List3.GetItemText (i, 0))*atof(m_List3.GetItemText(i,3));
- }*/
- m_money1.Format ("%f", list3money+atof(m_taoxijiage)-atof(m_discount)+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);
- // TODO: Add your control notification handler code here
-
- }
- void Booking::OnChangeEDITdiscount()
- {
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the MyFormView::OnInitDialog()
- // function and call CRichEditCtrl().SetEventMask()
- // with the ENM_CHANGE flag ORed into the mask.
- OnChangeEDITtaoxijiage();
- // TODO: Add your control notification handler code here
- }
- void Booking::OnChangeEDITpayed1()
- {
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the MyFormView::OnInitDialog()
- // function and call CRichEditCtrl().SetEventMask()
- // with the ENM_CHANGE flag ORed into the mask.
- OnChangeEDITtaoxijiage();
- // TODO: Add your control notification handler code here
-
- }
- void Booking::OnDropdownCOMBObm()
- {
- // TODO: Add your control notification handler code here
- if(m_combobm.GetCount ()<2)
- {
- g_sendhead.bsql=0;
- g_sendhead.code[0]=3;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(3);if(g_bSendOK==0)return;
- DataToArray(&g_List1array);
- for(int ii=0; ii<g_List1array.GetSize (); ii++)
- m_combobm.AddString ( g_List1array.ElementAt (ii).ElementAt(0) );
- }
- }
- void Booking::OnDropdownCOMBOrenyuan()
- {
- // TODO: Add your control notification handler code here
- if(m_renyuanarray.GetSize ()==0)
- {
-
- for(int ii=0; ii<g_userarray.GetSize (); ii++)
- {
- m_renyuanarray.Add ( g_userarray.ElementAt (ii).ElementAt(2) );
- m_renyuanarray.Add ( g_userarray.ElementAt (ii).ElementAt(1) );
- }
- }
- m_comborenyuan.ResetContent ();
- int pos=m_combobm.GetCurSel ();
- if(pos==-1)
- {
- for(int ii=0; ii<m_renyuanarray.GetSize (); ii+=2)
- {
- m_comborenyuan.AddString (m_renyuanarray.ElementAt (ii+1) );
- }
- }
- else
- {
- CString str;
- m_combobm.GetLBText (pos, str);
- for(int ii=0; ii<m_renyuanarray.GetSize (); ii+=2)
- {
- if(str==m_renyuanarray.ElementAt (ii))
- m_comborenyuan.AddString (m_renyuanarray.ElementAt (ii+1) );
- }
- }
- }
- void Booking::OnSelchangeCOMBObm()
- {
- // TODO: Add your control notification handler code here
- m_comborenyuan.ResetContent ();
- m_comborenyuan.SetCurSel (-1);
- }
- void Booking::OnDropdownCOMBOid()
- {
- // TODO: Add your control notification handler code here
- if(m_comboid.GetCount ()==0)
- {
- CString date=g_date;
- CString sql;
- // sql="select count(*) as cot from dindan where time1='"+date+"' ";
- sql="select max(id) as cot from dindan where time1='"+date+"' ";
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- date.Replace ("-", "");
- CString id;
- id.Format ("%s-%03d", date, g_ncount+1);
- m_comboid.AddString (id);
- }
- }
- void Booking::OnSelchangeCOMBOid()
- {
- // TODO: Add your control notification handler code here
- int pos=m_comboid.GetCurSel ();
- m_phone1=m_phone2="";
-
- GetDlgItem(IDC_BUTprint)->EnableWindow(pos);
- if(IsHasRights2new(0))
- {
- GetDlgItem(IDC_BUTsave)->EnableWindow(pos==0);
- // GetDlgItem(IDC_BUTclient)->EnableWindow(pos==0);
- }
- else
- GetDlgItem(IDC_BUTsave)->EnableWindow(0);
- //订单修改权限
- // GetDlgItem(IDC_BUTsave)->EnableWindow(IsHasRights2new(1));
- // if(pos)
- // GetDlgItem(IDC_BUTclient)->EnableWindow(IsHasRights2new(1));
-
- m_memberno="";
- m_memberno2="";
- m_type=0;
- if(pos<1)
- {
- ClearCtrl();
- InputMemberno dlg;
- dlg.m_bNoAdd=1;
- if(dlg.DoModal ()==IDOK)
- {
- m_memberno=dlg.m_memberno;
- m_memberno2=dlg.m_memberno2;
- m_type=dlg.m_type;
- m_memberno2date=dlg.m_memberno2date;
- m_membernoname=dlg.m_membernoname ;
- m_membernosex=dlg.m_membernosex ;
- m_membernophone=dlg.m_membernophone ;
- m_membernojiage=dlg.m_membernojiage ;
- SetDlgItemText(IDC_EDITwaiter6, m_memberno);
- }
- return;
- }
- CString id;
- m_comboid.GetLBText (pos, id);
- CString filter="id='"+id+"';id='"+id+"' and kind<>'4' and kind<>'5'";
- g_sendhead.code[0]=11;
- g_sendhead.code[1]=50;
- g_sendhead.tabcount=2;
- g_sendhead.bsql=0;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>sparray;
- DataToArray(&g_List1array, &sparray);
- CString bm,ren;
- m_takephotomoney = g_List1array.ElementAt (0).ElementAt (2);
- m_choosephotomoney = g_List1array.ElementAt (0).ElementAt (3);
- m_name1 = g_List1array.ElementAt (0).ElementAt (4);
- m_name2 = g_List1array.ElementAt (0).ElementAt (5);
- m_taoxiid= g_List1array.ElementAt (0).ElementAt (6);
- taoxiname= g_List1array.ElementAt (0).ElementAt (7);
- m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
- m_zs = g_List1array.ElementAt (0).ElementAt (9);
- m_time1 = g_List1array.ElementAt (0).ElementAt (10);
- m_time2 = g_List1array.ElementAt (0).ElementAt (11);
- m_time3 = g_List1array.ElementAt (0).ElementAt (12);
- bm = g_List1array.ElementAt (0).ElementAt (13);
- ren = g_List1array.ElementAt (0).ElementAt (14);
- m_discount = g_List1array.ElementAt (0).ElementAt (15);
- m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
- m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
- m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
- m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
- m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
- m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
- m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
- m_outside = g_List1array.ElementAt (0).ElementAt (28);
- m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
- m_style = g_List1array.ElementAt (0).ElementAt (30);
- m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
- m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
- m_waiter3 = g_List1array.ElementAt (0).ElementAt (36);
- m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
- m_bz = g_List1array.ElementAt (0).ElementAt (38);
- m_waiter6 = g_List1array.ElementAt (0).ElementAt (41);
- pos=m_combotaoxiname.FindString (0, taoxiname);
- if(pos==-1)
- {
- m_combotaoxiname.InsertString (0, taoxiname);
- m_combotaoxiname.SetCurSel (0);
- }
- else
- m_combotaoxiname.SetCurSel (pos);
- pos=m_combobm.FindString (0, bm);
- if(pos==-1)
- {
- m_combobm.ResetContent ();
- m_combobm.InsertString (0, bm);
- m_combobm.SetCurSel (0);
- }
- else
- m_combobm.SetCurSel (pos);
- pos=m_comborenyuan.FindString (0, ren);
- if(pos==-1)
- {
- m_comborenyuan.InsertString (0, ren);
- m_comborenyuan.SetCurSel (0);
- }
- else
- m_comborenyuan.SetCurSel (pos);
- UpdateData(false);
-
- m_List1.DeleteAllItems ();
- m_List3.DeleteAllItems ();
- int listpos[2]={0};
- CEditListCtrl *pList[2]={&m_List1,&m_List3};
- for(int i=0; i<sparray.GetSize (); i++)
- {
- pos=atoi(sparray.ElementAt (i).ElementAt (4))-1;
- if(pos>1)pos=0;
-
- pList[pos]->InsertItem(listpos[pos], sparray.ElementAt (i).ElementAt (1));
- pList[pos]->SetItemText(listpos[pos], 1, sparray.ElementAt (i).ElementAt (5));
-
- pList[pos]->SetItemText(listpos[pos], 2, sparray.ElementAt (i).ElementAt (2));
- pList[pos]->SetItemText(listpos[pos], 3, sparray.ElementAt (i).ElementAt (3));
-
- listpos[pos]++;
- }
- OnChangeEDITtaoxijiage();
- CalculateCost();
- CalculateCost2();
- }
- void Booking::ClearCtrl()
- {
- m_money1 = _T("");
- m_money2 = _T("");
- m_money3 = _T("");
- m_choosephotomoney = _T("");
- m_name1 = _T("");
- m_name2 = _T("");
- m_taoxiid = _T("");
- m_taoxijiage = _T("");
- m_zs = _T("");
- m_time1 = g_date;
- m_time2 = _T("");
- m_time3 = _T("");
- m_bz = _T("");
- m_discount = _T("");
- m_payed1 = _T("");
- m_payed2 = _T("");
- m_payed3 = _T("");
- m_payed4 = _T("");
- m_payed5 = _T("");
- m_clothescount = _T("");
- m_clothescount2 = _T("");
- m_outside = _T("");
- m_outside2 = _T("");
- m_style = _T("");
- m_waiter1 = _T("");
- m_waiter2 = _T("");
- m_waiter3 = _T("");
- m_waiter4 = _T("");
- m_waiter6 = g_user.name ;
- m_combotaoxiname.SetCurSel (-1);
- m_combobm.SetCurSel (-1);
- m_comborenyuan.SetCurSel (-1);
- UpdateData(false);
- m_List1.DeleteAllItems ();
- m_List3.DeleteAllItems ();
- }
- void Booking::OnBUTWaiter()
- {
- if(AfxMessageBox("是否导入订单?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
- CFileDialog fdlg(true, NULL,"", OFN_HIDEREADONLY,"影楼订单文件(*.*)|*.dan||");
- if(fdlg.DoModal ()!=IDOK)return;
- CString path=fdlg.GetFileName ();
- CArray<CStringArray, CStringArray>g_Sel1array[20];//精英团队
- CArray<CStringArray, CStringArray>g_Sel2array[20];//景点介绍
- CArray<CStringArray, CStringArray>g_Sel3array[20];//套系内容
- CArray<CStringArray, CStringArray>g_Sel4array[20];//产品展示
- CArray<CStringArray, CStringArray>g_Sel5array[20];//礼服介绍
- CString g_name1;
- CString g_name2;
- CString g_phone1;
- CString g_phone2;
- CString g_price1;
- CString g_price2;
- CString g_date;
- {
- CString str=path;
- int pos=str.Find(".");
- if(pos==-1)return;
- str=str.Left(pos);
-
- pos=str.Find(" ");
- if(pos==-1)return;
- g_name1=str.Left(pos);str=str.Right(str.GetLength()-pos-1);
-
- pos=str.Find(" ");
- if(pos==-1)return;
- g_name2=str.Left(pos);str=str.Right(str.GetLength()-pos-1);
- pos=str.Find(" ");
- if(pos==-1)return;
- g_phone1=str.Left(pos);str=str.Right(str.GetLength()-pos-1);
- pos=str.Find(" ");
- if(pos==-1)return;
- g_phone2=str.Left(pos);str=str.Right(str.GetLength()-pos-1);
- }
- int length[100];
- CFile fp;
- fp.Open(path, CFile::modeRead);
- int fileleng=fp.GetLength ();
- int memlength=fileleng-sizeof(int)*100;
- for(int i=0; i<100; i++)
- fp.Read(length+i, sizeof(int));
- for( i=0; i<20; i++)
- g_Sel1array[i].SetSize(length[i]);
- for( i=0; i<20; i++)
- g_Sel2array[i].SetSize(length[20+i]);
- for( i=0; i<20; i++)
- g_Sel3array[i].SetSize(length[40+i]);
- for( i=0; i<20; i++)
- g_Sel4array[i].SetSize(length[60+i]);
- for( i=0; i<20; i++)
- g_Sel5array[i].SetSize(length[80+i]);
- BYTE *pData=new BYTE[memlength];
- fp.Read(pData, memlength);
- fp.Close ();
- CMemFile memfile;
- memfile.Attach (pData, memlength);
- CArchive ar(&memfile, CArchive::load);
- for( i=0; i<20; i++)
- {
- for(int j=0; j<length[i]; j++)
- g_Sel1array[i].ElementAt (j).Serialize (ar);
- }
- for( i=0; i<20; i++)
- {
- for(int j=0; j<g_Sel2array[i].GetSize(); j++)
- g_Sel2array[i].ElementAt (j).Serialize (ar);
- }
- for( i=0; i<20; i++)
- {
- for(int j=0; j<g_Sel3array[i].GetSize(); j++)
- g_Sel3array[i].ElementAt (j).Serialize (ar);
- }
- for( i=0; i<20; i++)
- {
- for(int j=0; j<g_Sel4array[i].GetSize(); j++)
- g_Sel4array[i].ElementAt (j).Serialize (ar);
- }
- for( i=0; i<20; i++)
- {
- for(int j=0; j<g_Sel5array[i].GetSize(); j++)
- g_Sel5array[i].ElementAt (j).Serialize (ar);
- }
- ar.Close();
- memfile.Detach ();
- delete []pData;
- if(g_Sel5array[19].GetSize ())
- {
- g_price1=g_Sel5array[19].ElementAt (0).ElementAt (0);
- g_price2=g_Sel5array[19].ElementAt (0).ElementAt (1);
- }
- else
- {
- g_price1=g_price2="";
- }
- OnDropdownCOMBOid();
- m_comboid.SetCurSel (0);
- OnSelchangeCOMBOid();
- m_name1=g_name1;
- m_name2=g_name2;
- CStringArray array;
- for( i=0; i<19; i++)
- {
- for(int j=0; j<g_Sel3array[i].GetSize(); j++)
- {
- if(g_Sel3array[i].ElementAt (j).GetSize ()<2)continue;
- int count=g_Sel3array[i].ElementAt (j).GetSize ();
- for(int a=1; a<count; a++)
- {
- if(a==1)
- {
- CString taoxiname=g_Sel3array[i].ElementAt (j).ElementAt (a) ;
- m_combotaoxiname.InsertString (0, taoxiname);
- m_combotaoxiname.SetCurSel (0);
- }
- else
- {
- CString str=g_Sel3array[i].ElementAt (j).ElementAt (a);
- CString dir,name;
- int pos=str.ReverseFind('\\');
- dir=str.Left(pos);
- name=str.Right(str.GetLength()-pos-1);
- array.Add (name);
- }
- }
- }
- }
- for( i=0; i<19; i++)
- {
- for(int j=0; j<g_Sel4array[i].GetSize(); j++)
- {
- int count=g_Sel4array[i].ElementAt (j).GetSize ();
- for(int a=1; a<count; a++)
- {
- array.Add (g_Sel4array[i].ElementAt (j).ElementAt (a));
- }
- }
- }
- for(i=0; i<array.GetSize () ; i++)
- {
- int pos=m_List1.GetItemCount ();
- CString str;
- if(pos)
- {
- if(m_List1.GetItemText (pos-1, 0).IsEmpty ()&&m_List1.GetItemText (pos-1, 1).IsEmpty ())
- {
- pos--;
- m_List1.SetItemText(pos,0, "");
- m_List1.SetItemText(pos,1, array.ElementAt (i));
- m_List1.SetItemText(pos,2, "");
- m_List1.SetItemText(pos,3, "1");
- }
- else
- {
- m_List1.InsertItem(pos, "");
- m_List1.SetItemText(pos,1, array.ElementAt (i));
- m_List1.SetItemText(pos,2, "");
- m_List1.SetItemText(pos,3, "1");
- }
- }
- else
- {
- m_List1.InsertItem(pos, "");
- m_List1.SetItemText(pos,1, array.ElementAt (i));
- m_List1.SetItemText(pos,2, "");
- m_List1.SetItemText(pos,3, "1");
- }
- }
- if(g_Sel5array[19].GetSize ())
- {
- g_price1=g_Sel5array[19].ElementAt (0).ElementAt (0);
- g_price2=g_Sel5array[19].ElementAt (0).ElementAt (1);
- }
- else
- {
- g_price1=g_price2="";
- }
- m_taoxijiage=g_price1;
- m_payed1=g_price2;
- UpdateData(false);
- m_phone1=g_phone1;
- m_phone2=g_phone2;
- OnChangeEDITtaoxijiage();
- }
- void Booking::OnButton1()
- {
- // TODO: Add your control notification handler code here
- /* CTime tm=CTime::GetCurrentTime ();
- CTimeSpan dt(1, 0, 0, 0);
- CTimeSpan dt2(25, 0, 0, 0);
- CTime tm2=tm-dt2;
- while(tm>tm2)
- {
- CString filter;
- filter="id like '";
- filter+=tm2.Format("%Y%m%d");
- filter+="%'";
-
- tm2+=dt;
-
-
- g_sendhead.code[0]=50;
- g_sendhead.tabcount=1;
- g_sendhead.bsql=0;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>sparray;
- DataToArray(&sparray);
-
- m_List1.DeleteAllItems ();
- m_List3.DeleteAllItems ();
- int listpos[3]={0};int pos;
- CEditListCtrl *pList[3]={&m_List1,&m_List2,&m_List3};
- for(int i=0; i<sparray.GetSize (); i++)
- {
- pos=atoi(sparray.ElementAt (i).ElementAt (4))-1;
- pList[pos]->InsertItem(listpos[pos], sparray.ElementAt (i).ElementAt (1));
- pList[pos]->SetItemText(listpos[pos], 1, GetSPNameFromId(sparray.ElementAt (i).ElementAt (1)));
- if(pos<2)
- pList[pos]->SetItemText(listpos[pos], 2, sparray.ElementAt (i).ElementAt (0));
- else
- {
- pList[pos]->SetItemText(listpos[pos], 2, sparray.ElementAt (i).ElementAt (0));
- pList[pos]->SetItemText(listpos[pos], 3, sparray.ElementAt (i).ElementAt (0));
- }
- listpos[pos]++;
- }
-
- CArray<CStringArray, CStringArray>savearray;
- savearray.SetSize(m_List1.GetItemCount ());
- CString sql,id,spid,name;
-
- for( i=0; i<m_List1.GetItemCount (); i++)
- {
- spid=m_List1.GetItemText (i, 0);
- id= m_List1.GetItemText (i, 2) ;
- name=m_List1.GetItemText (i, 1);
- sql="update dindansp set name='"+name+"' where id='"+id+"' and spid='"+spid+"'";
-
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- }
- for( i=0; i<m_List3.GetItemCount (); i++)
- {
- spid=m_List3.GetItemText (i, 0);
- id= m_List3.GetItemText (i, 3) ;
- name=m_List3.GetItemText (i, 1);
- sql="update dindansp set name='"+name+"' where id='"+id+"' and spid='"+spid+"'";
-
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- }
- }*/
- }
- void Booking::OnBUTprint()
- {
- // TODO: Add your control notification handler code here
- int pos=m_comboid.GetCurSel ();
- if(pos==-1)
- {
- return;
- }
- CString id;
- m_comboid.GetLBText (pos, id);
- g_pMainWnd->PrintDinDan(id);
- }
- void Booking::OnBUTstyle()
- {
- // TODO: Add your control notification handler code here
- SetStyle dlg;
- dlg.m_style=m_style;
- if(dlg.DoModal ()==IDOK)
- m_style=dlg.m_style;
- }
- void Booking::OnBUTspbox()
- {
- // TODO: Add your control notification handler code here
- SPBox dlg;
- #ifndef CHILD_VERSION
- dlg.m_mode=1;
- #endif
- if(dlg.DoModal ()!=IDOK)return;
- for(int a=0; a<dlg.m_spidarray .GetSize (); a++)
- {
- dlg.m_spid=dlg.m_spidarray.ElementAt (a);
- dlg.m_spname=dlg.m_spnamearray.ElementAt (a);
- int pos=m_List3.GetItemCount ();
- CString str;
- if(pos)
- {
- if(m_List3.GetItemText (pos-1, 0).IsEmpty ()&&m_List3.GetItemText (pos-1, 1).IsEmpty ())
- {
- pos--;
- m_List3.SetItemText(pos,0, dlg.m_spid);
- m_List3.SetItemText(pos,1, GetSPNameFromId(dlg.m_spid));
- str.Format ("%f", GetSPPriceFromId3(dlg.m_spid));
- ConvertToPrice (str);
- m_List3.SetItemText(pos,2, str);
- m_List3.SetItemText(pos,3, "1");
- }
- else
- {
- m_List3.InsertItem(pos, dlg.m_spid);
- m_List3.SetItemText(pos,1, GetSPNameFromId(dlg.m_spid));
- str.Format ("%f", GetSPPriceFromId3(dlg.m_spid));
- ConvertToPrice (str);
- m_List3.SetItemText(pos,2, str);
- m_List3.SetItemText(pos,3, "1");
- }
- }
- else
- {
- m_List3.InsertItem(pos, dlg.m_spid);
- m_List3.SetItemText(pos,1, GetSPNameFromId(dlg.m_spid));
- str.Format ("%f", GetSPPriceFromId3(dlg.m_spid));
- ConvertToPrice (str);
- m_List3.SetItemText(pos,2, str);
- m_List3.SetItemText(pos,3, "1");
- }
- }
- CalculateCost2();
- }
- void Booking::OnBUTdel()
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List3.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要删除的项目!", MB_ICONINFORMATION);
- return;
- }
- int iItem=m_List3.GetNextSelectedItem(pos);
- 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 Booking::OnBUTdelall()
- {
- // TODO: Add your control notification handler code here
- m_List3.DeleteAllItems ();
- CalculateCost2();
- }
- void Booking::OnBUTspbox2()
- {
- // TODO: Add your control notification handler code here
- SPBox dlg;
- if(dlg.DoModal ()!=IDOK)return;
- for(int a=0; a<dlg.m_spidarray .GetSize (); a++)
- {
- dlg.m_spid=dlg.m_spidarray.ElementAt (a);
- dlg.m_spname=dlg.m_spnamearray.ElementAt (a);
- int pos=m_List1.GetItemCount ();
- CString str;
- if(pos)
- {
- if(m_List1.GetItemText (pos-1, 0).IsEmpty ()&&m_List1.GetItemText (pos-1, 1).IsEmpty ())
- {
- pos--;
- m_List1.SetItemText(pos,0, dlg.m_spid);
- m_List1.SetItemText(pos,1, GetSPNameFromId(dlg.m_spid));
- str.Format ("%f", GetSPPriceFromId3(dlg.m_spid));
- ConvertToPrice (str);
- m_List1.SetItemText(pos,2, str);
- m_List1.SetItemText(pos,3, "1");
- }
- else
- {
- m_List1.InsertItem(pos, dlg.m_spid);
- m_List1.SetItemText(pos,1, GetSPNameFromId(dlg.m_spid));
- str.Format ("%f", GetSPPriceFromId3(dlg.m_spid));
- ConvertToPrice (str);
- m_List1.SetItemText(pos,2, str);
- m_List1.SetItemText(pos,3, "1");
- }
- }
- else
- {
- m_List1.InsertItem(pos, dlg.m_spid);
- m_List1.SetItemText(pos,1, GetSPNameFromId(dlg.m_spid));
- str.Format ("%f", GetSPPriceFromId3(dlg.m_spid));
- ConvertToPrice (str);
- m_List1.SetItemText(pos,2, str);
- m_List1.SetItemText(pos,3, "1");
- }
- }
- CalculateCost();
- }
- void Booking::OnBUTdel3()
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要删除的项目!", MB_ICONINFORMATION);
- return;
- }
- if(AfxMessageBox("确定要删除套系中的商品吗?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
- int iItem=m_List1.GetNextSelectedItem(pos);
- m_List1.DeleteItem (iItem);
- CalculateCost();
- int count=m_List1.GetItemCount ();
- if(count==0)return;
- if(iItem==count)
- iItem=0;
-
- m_List1.SetItemState (iItem, LVIS_SELECTED, LVIS_SELECTED);
- }
- void Booking::OnBUTdelall2()
- {
- // TODO: Add your control notification handler code here
-
- if(AfxMessageBox("确定要删除套系中的商品吗?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
- m_List1.DeleteAllItems ();
-
- CalculateCost();
- }
- void Booking::CalculateCost()
- {
-
- m_cost1=0;
- CString str;
- for(int i=0; i<m_List1.GetItemCount (); i++)
- {
- m_cost1+=GetSPPriceFromId(m_List1.GetItemText (i, 0))*atof(m_List1.GetItemText (i, 3));
- }
- float cost2=0;
- for( i=0; i<m_List1.GetItemCount (); i++)
- {
- cost2+=GetSPPriceFromId3(m_List1.GetItemText (i, 0))*atof(m_List1.GetItemText (i, 3));
- }
- str.Format ("套系包含商品,成本:%0.1f,售价:%0.1f", m_cost1,cost2);
- str.Format ("套系包含商品,总价:%0.1f",cost2);
- ::ConvertToPrice (str);
- SetDlgItemText(IDC_STATIC2, str);
-
- }
- void Booking::CalculateCost2()
- {
-
- m_cost2=0;
- CString str;
- for(int i=0; i<m_List3.GetItemCount (); i++)
- {
- m_cost2+=GetSPPriceFromId(m_List3.GetItemText (i, 0))*atof(m_List3.GetItemText (i, 3));
- }
- float cost2=0;
- for( i=0; i<m_List3.GetItemCount (); i++)
- {
- cost2+=GetSPPriceFromId3(m_List3.GetItemText (i, 0))*atof(m_List3.GetItemText (i, 3));
- }
- #ifndef CHILD_VERSION
- str.Format ("婚庆服务,成本:%0.1f,售价:%0.1f", m_cost2,cost2);
- #else
- str.Format ("增加产品,成本:%0.1f,售价:%0.1f", m_cost2,cost2);
- #endif
- #ifndef CHILD_VERSION
- str.Format ("婚庆服务,总价:%0.1f",cost2);
- #else
- str.Format ("增加产品,总价:%0.1f",cost2);
- #endif
- ::ConvertToPrice (str);
- SetDlgItemText(IDC_STATIC4, str);
-
- }
- void Booking::SaveCard2Data()
- {
- if(m_type==1)
- {
- CString m_point;
- m_point.Format ("%d", atol(m_money1)/100);
- m_point.Format ("%d", atol(m_point)*100);
- CString m_card2no=m_memberno2;
- CString date2=m_memberno2date;
- CString m_name=m_membernoname ;
- CString m_sex=m_membernosex ;
- CString m_phone=m_membernophone ;
- CString sql;
- sql="delete from membercard2 where [card2no]='"+m_card2no+"'";
- sql+="@@@insert into [memberreg]([memberno],[dindanid],[money],[date],[card2no],[type],[taoxi],[date2])values('"+m_memberno+"','"+m_sid+"','"+m_point+"','"+g_date+"','"+m_card2no+"','转介绍','"+taoxiname+"','"+date2+"')";
- sql+="@@@";
- m_point.Format ("%d", atol(m_point)/100);
- if( atoi(g_cominfoarray.ElementAt(0).ElementAt(51)) )
- {
- CString m_content5 = g_cominfoarray.ElementAt(0).ElementAt(52);
- CString content,timestamp;
- CString name;
- if(!m_name1.IsEmpty ())
- name=m_name1+",";
- name+=m_name2;
- name.TrimRight (",");
- CString name2=m_name;
- #ifndef CHILD_VERSION
- if(m_sex=="男")
- name2+="先生";
- else if(m_sex=="女")
- name2+="女士";
- #endif
- content.Format ("%s您好,您的朋友%s为您积分%s分.", name2, name, m_point);
- content+=m_content5;
- timestamp=CTime::GetCurrentTime ().Format ("%Y%m%d%H%M%S");
-
- if( CheckPhoneType(m_phone)!=-1 && CheckBadWords(content,0) && CheckBadWords2(content,0) )
- {
- int count=GetLengthEx(content)/MSG_LENGTH;
- if(GetLengthEx(content)%MSG_LENGTH)
- count++;
- CString scount;
- scount.Format ("%d", count);
- CString sql2="insert into [sendreg]([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone+"','"+content+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')";
- sql+=sql2;sql+="@@@";
- }
- }
- sql+=m_memberno;
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- }
- else if(m_type==3)
- {
- CString m_rate;
- CString filter="[memberno]='"+m_memberno+"'";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=132;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- DataToArray(&g_List1array);
- if(g_List1array.GetSize ()%5==0)
- m_rate="5%";
- else if(g_List1array.GetSize ()%5==1)
- m_rate="10%";
- else if(g_List1array.GetSize ()%5==2)
- m_rate="15%";
- else if(g_List1array.GetSize ()%5==3)
- m_rate="20%";
- else if(g_List1array.GetSize ()%5==4)
- m_rate="50%";
- float frate=atof(m_rate)/100.0;
- CString m_point;
- m_point.Format ("%d", (int)(min(atof(m_money1),atof(m_membernojiage))*frate));
- CString m_card2no=m_memberno2;
- CString date2=m_memberno2date;
- CString m_name=m_membernoname ;
- CString m_sex=m_membernosex ;
- CString m_phone=m_membernophone ;
-
- CString sql;
- sql="delete from [membercard2blue] where [card2no]='"+m_card2no+"'";
- sql+="~~~insert into [memberregblue]([memberno],[dindanid],[money],[date],[card2no],[type],[taoxi],[date2])values('"+m_memberno+"','"+m_sid+"','"+m_point+"','"+g_date+"','"+m_card2no+"','转介绍','"+taoxiname+"','"+date2+"')";
- sql+="~~~";
- if( atoi(g_cominfoarray.ElementAt(0).ElementAt(51)) )
- {
- CString m_content5 = g_cominfoarray.ElementAt(0).ElementAt(52);
- CString content,timestamp;
- CString name;
- if(!m_name1.IsEmpty ())
- name=m_name1+",";
- name+=m_name2;
- name.TrimRight (",");
- CString name2=m_name;
- #ifndef CHILD_VERSION
- if(m_sex=="男")
- name2+="先生";
- else if(m_sex=="女")
- name2+="女士";
- #endif
- content.Format ("%s您好,您的朋友%s为您返现金%s元.", name2, name, m_point);
- content+=m_content5;
- timestamp=CTime::GetCurrentTime ().Format ("%Y%m%d%H%M%S");
-
- if( CheckPhoneType(m_phone)!=-1 && CheckBadWords(content,0)&& CheckBadWords2(content,0) )
- {
- int count=GetLengthEx(content)/MSG_LENGTH;
- if(GetLengthEx(content)%MSG_LENGTH)
- count++;
- CString scount;
- scount.Format ("%d", count);
- CString sql2="insert into [sendreg]([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone+"','"+content+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')";
- sql+=sql2;sql+="~~~";
- }
- }
- sql+=m_memberno;
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- }
- }
- void Booking::OnBUTaddjd()
- {
- // TODO: Add your control notification handler code here
- SPLBDlg dlg;
- dlg.m_mode =2;
- if(dlg.DoModal ()==IDOK)
- {
- for(int i=0; i<dlg.m_array.GetSize (); i++)
- m_listbox1.AddString (dlg.m_array.ElementAt (i) );
- }
- }
- void Booking::OnBUTdeljd()
- {
- // TODO: Add your control notification handler code here
- int pos=m_listbox1.GetCurSel ();
- if(pos==-1)
- {
- AfxMessageBox("请选中您要删除的景点!", MB_ICONINFORMATION);return;
- }
- m_listbox1.DeleteString (pos);
- int count=m_listbox1.GetCount ();
- if(pos<count)
- m_listbox1.SetCurSel (pos);
- else if(count && pos==count)
- m_listbox1.SetCurSel (0);
- }
- void Booking::OnBUTinfo1()
- {
- // TODO: Add your control notification handler code here
- CRect rc;
- GetDlgItem(IDC_STATIC5)->GetWindowRect(rc);
- ScreenToClient(rc);
- m_page1.Create (IDD_DLGBookingPage1, this);
- m_page1.MoveWindow (rc);
- m_page1.ShowWindow (SW_SHOW);
- }
- void Booking::OnBUTinfo2()
- {
- // TODO: Add your control notification handler code here
-
- }
- void Booking::OnBUTinfo3()
- {
- // TODO: Add your control notification handler code here
-
- }
|