BookingPage3.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. // BookingPage3.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "BookingPage3.h"
  6. #include "SelCardType.h"
  7. #include "Booking2.h"
  8. #include "TXFG.h"
  9. #include "InputMemberno.h"
  10. #include "SPLBDlg.h"
  11. #include "SelMemberType.h"
  12. #include "AddMember.h"
  13. #include "InputCard2Dlg.h"
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. // BookingPage3 dialog
  21. BookingPage3::BookingPage3(CWnd* pParent /*=NULL*/)
  22. : CDialog(BookingPage3::IDD, pParent)
  23. {
  24. //{{AFX_DATA_INIT(BookingPage3)
  25. m_clothescount = _T("");
  26. m_clothescount2 = _T("");
  27. m_outside = _T("");
  28. m_outside2 = _T("");
  29. m_memberno = _T("");
  30. m_cardtype = _T("");
  31. m_name = _T("");
  32. m_style = _T("");
  33. m_cardtype = _T("");
  34. m_type=0;
  35. m_name = _T("");
  36. m_mode=0;
  37. m_bNoAdd=0;
  38. m_bInputOk=0;
  39. m_bFirst=1;
  40. m_cfno = _T("");
  41. //}}AFX_DATA_INIT
  42. }
  43. void BookingPage3::DoDataExchange(CDataExchange* pDX)
  44. {
  45. CDialog::DoDataExchange(pDX);
  46. //{{AFX_DATA_MAP(BookingPage3)
  47. DDX_Control(pDX, IDC_COMBOreason, m_comboreason);
  48. DDX_Control(pDX, IDC_COMBOfrom, m_combofrom);
  49. DDX_Control(pDX, IDC_COMBOarea, m_comboarea);
  50. DDX_Control(pDX, IDC_COMBOrenyuan, m_comborenyuan);
  51. DDX_Control(pDX, IDC_COMBObm, m_combobm);
  52. DDX_Text(pDX, IDC_EDITOclothescount, m_clothescount);
  53. DDX_Text(pDX, IDC_EDITOclothescount2, m_clothescount2);
  54. DDX_Text(pDX, IDC_EDITOoutside, m_outside);
  55. DDX_Text(pDX, IDC_EDITOoutside2, m_outside2);
  56. DDX_Text(pDX, IDC_EDIT1, m_memberno);
  57. DDX_Text(pDX, IDC_EDIT2, m_cardtype);
  58. DDX_Text(pDX, IDC_EDIT3, m_name);
  59. DDX_Text(pDX, IDC_EDITOcfno, m_cfno);
  60. //}}AFX_DATA_MAP
  61. }
  62. BEGIN_MESSAGE_MAP(BookingPage3, CDialog)
  63. //{{AFX_MSG_MAP(BookingPage3)
  64. ON_CBN_DROPDOWN(IDC_COMBObm, OnDropdownCOMBObm)
  65. ON_CBN_DROPDOWN(IDC_COMBOrenyuan, OnDropdownCOMBOrenyuan)
  66. ON_CBN_SELCHANGE(IDC_COMBObm, OnSelchangeCOMBObm)
  67. ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
  68. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  69. ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
  70. ON_BN_CLICKED(IDC_BUTTON10, OnButton10)
  71. ON_BN_CLICKED(IDC_BUTTON11, OnButton11)
  72. ON_CBN_DROPDOWN(IDC_COMBOfrom, OnDropdownCOMBOfrom)
  73. ON_CBN_DROPDOWN(IDC_COMBOreason, OnDropdownCOMBOreason)
  74. //}}AFX_MSG_MAP
  75. ON_BN_CLICKED(Btn_NewCard, OnBnClickedNewcard)
  76. END_MESSAGE_MAP()
  77. /////////////////////////////////////////////////////////////////////////////
  78. // BookingPage3 message handlers
  79. void BookingPage3::OnOK()
  80. {
  81. // TODO: Add extra validation here
  82. }
  83. void BookingPage3::OnCancel()
  84. {
  85. // TODO: Add extra cleanup here
  86. }
  87. extern BOOL CALLBACK EnumChildProc3(HWND hwnd,LPARAM lParam);
  88. BOOL BookingPage3::OnInitDialog()
  89. {
  90. CDialog::OnInitDialog();
  91. #ifndef LKAY_VERSION
  92. GetDlgItem(IDC_STATIC15)->ShowWindow (0);
  93. GetDlgItem(IDC_STATIC14)->ShowWindow (0);
  94. GetDlgItem(IDC_STATIC19)->ShowWindow (0);
  95. GetDlgItem(IDC_EDITOcfno)->ShowWindow (0);
  96. GetDlgItem(IDC_COMBOfrom)->ShowWindow (0);
  97. GetDlgItem(IDC_COMBOreason)->ShowWindow (0);
  98. GetDlgItem(IDC_BUTTON10)->ShowWindow (0);
  99. GetDlgItem(IDC_BUTTON11)->ShowWindow (0);
  100. #endif
  101. // TODO: Add extra initialization here
  102. CRect rc2;
  103. GetWindowRect(rc2);
  104. MoveWindow(m_rc);
  105. g_WidthScale2 = (float)m_rc.Width()/(float)rc2.Width(); // new/Old
  106. g_HeightScale2 = (float)m_rc.Height()/(float)rc2.Height();
  107. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc3,0);
  108. #ifndef ZHIAI_VERSION
  109. GetDlgItem(IDC_STATIC10)->SetWindowText("服装套数:");
  110. GetDlgItem(IDC_STATIC11)->SetWindowText("造型:");
  111. GetDlgItem(IDC_STATIC12)->SetWindowText("外景:");
  112. GetDlgItem(IDC_STATIC13)->SetWindowText("内景:");
  113. #endif
  114. #if 1
  115. // 当会员卡号空时,可开新卡;
  116. if ( m_memberno.IsEmpty() )
  117. {
  118. GetDlgItem(Btn_NewCard)->EnableWindow(TRUE);
  119. }
  120. else
  121. GetDlgItem(Btn_NewCard)->EnableWindow(FALSE);
  122. #endif
  123. /* m_combobm.GetWindowRect (rc2);
  124. ScreenToClient(rc2);
  125. rc2.bottom +=200;
  126. m_combobm.MoveWindow (rc2);
  127. m_comborenyuan.GetWindowRect (rc2);
  128. ScreenToClient(rc2);
  129. rc2.bottom +=200;
  130. m_comborenyuan.MoveWindow (rc2);*/
  131. m_comborenyuan.RefDroppedWidth();
  132. #ifdef LKAY_VERSION
  133. m_combofrom.GetWindowRect (rc2);
  134. ScreenToClient(rc2);
  135. rc2.bottom +=200;
  136. m_combofrom.MoveWindow (rc2);
  137. m_comboreason.GetWindowRect (rc2);
  138. ScreenToClient(rc2);
  139. rc2.bottom +=200;
  140. m_comboreason.MoveWindow (rc2);
  141. /* m_combofrom.AddString ("广告");
  142. m_combofrom.AddString ("报纸");
  143. m_combofrom.AddString ("网络");
  144. m_combofrom.AddString ("朋友介绍");
  145. m_combofrom.AddString ("路过");
  146. m_combofrom.AddString ("外展");
  147. m_comboreason.AddString ("产品");
  148. m_comboreason.AddString ("价格");
  149. m_comboreason.AddString ("品牌");
  150. m_comboreason.AddString ("服装");
  151. m_comboreason.AddString ("外景");
  152. m_comboreason.AddString ("随便逛逛");*/
  153. if(((Booking2*)GetParent())->m_bModify)
  154. {
  155. if(m_combofrom.FindString (0, m_from)==-1)
  156. m_combofrom.AddString (m_from);
  157. m_combofrom.SetCurSel (m_combofrom.FindString (0, m_from));
  158. if(m_comboreason.FindString (0, m_reason)==-1)
  159. m_comboreason.AddString (m_reason);
  160. m_comboreason.SetCurSel (m_comboreason.FindString (0, m_reason));
  161. }
  162. #endif
  163. int i;
  164. #ifdef ZHIAI_VERSION
  165. GetDlgItem(IDC_EDITOoutside)->GetWindowRect(rc2);
  166. GetDlgItem(IDC_EDITOoutside)->ShowWindow(0);
  167. ScreenToClient(rc2);
  168. m_comboarea.MoveWindow (rc2);
  169. m_comboarea.GetWindowRect (rc2);
  170. ScreenToClient(rc2);
  171. rc2.bottom +=600;
  172. m_comboarea.MoveWindow (rc2);
  173. g_sendhead.bsql=0;
  174. g_sendhead.code[0]=82;
  175. g_sendhead.tabcount=1;
  176. g_pMainWnd->ProcessChatMessageRequest2(6);
  177. if(g_bSendOK)
  178. {
  179. CArray<CStringArray, CStringArray>areaarray;
  180. DataToArray(&areaarray);
  181. for( i=0; i<areaarray.GetSize(); i++)
  182. {
  183. m_comboarea.AddString(areaarray.ElementAt(i).ElementAt(0));
  184. }
  185. }
  186. int pos=m_comboarea.FindString (0, m_outside);
  187. if(pos==-1)
  188. {
  189. m_comboarea.InsertString (0, m_outside);
  190. m_comboarea.SetCurSel (0);
  191. }
  192. else
  193. m_comboarea.SetCurSel (pos);
  194. #else
  195. m_comboarea.ShowWindow(0);
  196. #endif
  197. CStringArray strarray;
  198. //////////////////////////////////////////
  199. if(m_List5array.GetSize ()==12)
  200. {
  201. for(int i=0; i<12; i++)
  202. strarray.Add (m_List5array.ElementAt (i).ElementAt (0));
  203. }
  204. else
  205. {
  206. strarray.Add("复古典雅");
  207. strarray.Add("温文尔雅");
  208. strarray.Add("豪华艳丽");
  209. strarray.Add("传统大方");
  210. strarray.Add("新潮个性");
  211. strarray.Add("浪漫奔放");
  212. strarray.Add("简单素雅");
  213. strarray.Add("活泼俏丽");
  214. strarray.Add("妩媚温馨");
  215. strarray.Add("温柔贤惠");
  216. strarray.Add("成熟感性");
  217. strarray.Add("清纯可爱");
  218. }
  219. for( i=0; i<12; i++)
  220. {
  221. SetDlgItemText(IDC_CHECK1+i, strarray.ElementAt (i));
  222. }
  223. if(((Booking2*)GetParent())->m_bModify)
  224. {
  225. if(m_combobm.FindString (0, m_bm)==-1)
  226. m_combobm.AddString (m_bm);
  227. if(m_comborenyuan.FindString (0, m_ren)==-1)
  228. m_comborenyuan.AddString (m_ren);
  229. m_combobm.SetCurSel (m_combobm.FindString (0, m_bm));
  230. m_comborenyuan.SetCurSel (m_comborenyuan.FindString (0, m_ren));
  231. SetRights(m_style);
  232. ((CEdit*)GetDlgItem(IDC_EDIT1))->SetReadOnly ();
  233. }
  234. if(IsHasRights2new(49)==0)
  235. {
  236. GetDlgItem(IDC_BUTTON1)->EnableWindow(0);
  237. }
  238. // TODO: Add extra initialization here
  239. return TRUE; // return TRUE unless you set the focus to a control
  240. // EXCEPTION: OCX Property Pages should return FALSE
  241. }
  242. void BookingPage3::OnDropdownCOMBObm()
  243. {
  244. // TODO: Add your control notification handler code here
  245. if(m_combobm.GetCount ()<2)
  246. {
  247. g_sendhead.bsql=0;
  248. g_sendhead.code[0]=3;
  249. g_sendhead.tabcount=1;
  250. g_pMainWnd->ProcessChatMessageRequest2(3);if(g_bSendOK==0)return;
  251. DataToArray(&g_List1array);
  252. for(int ii=0; ii<g_List1array.GetSize (); ii++)
  253. m_combobm.AddString ( g_List1array.ElementAt (ii).ElementAt(0) );
  254. }
  255. }
  256. void BookingPage3::OnDropdownCOMBOrenyuan()
  257. {
  258. // TODO: Add your control notification handler code here
  259. /* if(m_renyuanarray.GetSize ()==0)
  260. {
  261. for(int ii=0; ii<g_userarray.GetSize (); ii++)
  262. {
  263. m_renyuanarray.Add ( g_userarray.ElementAt (ii).ElementAt(2) );
  264. m_renyuanarray.Add ( g_userarray.ElementAt (ii).ElementAt(1) );
  265. }
  266. }
  267. m_comborenyuan.ResetContent ();
  268. int pos=m_combobm.GetCurSel ();
  269. if(pos==-1)
  270. {
  271. for(int ii=0; ii<m_renyuanarray.GetSize (); ii+=2)
  272. {
  273. m_comborenyuan.AddString (m_renyuanarray.ElementAt (ii+1) );
  274. }
  275. }
  276. else
  277. {
  278. CString str;
  279. m_combobm.GetLBText (pos, str);
  280. for(int ii=0; ii<m_renyuanarray.GetSize (); ii+=2)
  281. {
  282. if(str==m_renyuanarray.ElementAt (ii))
  283. m_comborenyuan.AddString (m_renyuanarray.ElementAt (ii+1) );
  284. }
  285. } */
  286. }
  287. void BookingPage3::OnSelchangeCOMBObm()
  288. {
  289. // TODO: Add your control notification handler code here
  290. m_comborenyuan.ResetContent ();
  291. m_comborenyuan.SetCurSel (-1);
  292. }
  293. void BookingPage3::OnChangeEdit1()
  294. {
  295. // TODO: If this is a RICHEDIT control, the control will not
  296. // send this notification unless you override the CDialog::OnInitDialog()
  297. // function and call CRichEditCtrl().SetEventMask()
  298. // with the ENM_CHANGE flag ORed into the mask.
  299. // UpdateData();
  300. // CheckType();
  301. // TODO: Add your control notification handler code here
  302. }
  303. void BookingPage3::CheckType(int type)
  304. { return;
  305. m_bInputOk=0;
  306. UpdateData();
  307. m_memberno.TrimLeft ();
  308. m_memberno.TrimRight ();
  309. SetDlgItemText(IDC_STATIC1,"");
  310. if( m_memberno.IsEmpty ())
  311. {
  312. return;
  313. }
  314. CStringArray namearray;
  315. for(int i=0; i<m_List1array.GetSize (); i++)
  316. {
  317. if(m_List1array.ElementAt (i).ElementAt (1)==m_memberno)
  318. {
  319. m_type=0;
  320. m_bInputOk=1;
  321. m_cardtype="金卡会员";
  322. m_name=m_List1array.ElementAt (i).ElementAt (2);
  323. UpdateData(false);
  324. if(type!=-1 && type==m_type)
  325. return;
  326. if(m_mode)return;
  327. namearray.Add (m_cardtype);
  328. }
  329. }
  330. if(m_mode==0)
  331. {
  332. for( i=0; i<m_List2array.GetSize (); i++)
  333. {
  334. if(m_List2array.ElementAt (i).ElementAt (1)==m_memberno)
  335. {
  336. m_type=1;
  337. m_memberno2=m_List2array.ElementAt (i).ElementAt (0);
  338. m_memberno2date=m_List2array.ElementAt (i).ElementAt (2);
  339. m_bInputOk=1;
  340. m_cardtype="金卡副卡";
  341. GetNameFromNo(m_memberno2,m_membernoname,m_membernosex,m_membernophone);
  342. m_name=m_membernoname;
  343. UpdateData(false);
  344. if(type!=-1 && type==m_type)
  345. return;
  346. namearray.Add (m_cardtype);
  347. }
  348. }
  349. for( i=0; i<m_List3array.GetSize (); i++)
  350. {
  351. if(m_List3array.ElementAt (i).ElementAt (1)==m_memberno)
  352. {
  353. m_type=2;
  354. m_bInputOk=1;
  355. m_cardtype="蓝钻卡会员";
  356. m_name=m_List3array.ElementAt (i).ElementAt (2);
  357. UpdateData(false);
  358. if(type!=-1 && type==m_type)
  359. return;
  360. namearray.Add (m_cardtype);
  361. }
  362. }
  363. for( i=0; i<m_List4array.GetSize (); i++)
  364. {
  365. if(m_List4array.ElementAt (i).ElementAt (1)==m_memberno)
  366. {
  367. m_type=3;
  368. m_memberno2=m_List4array.ElementAt (i).ElementAt (0);
  369. m_memberno2date=m_List4array.ElementAt (i).ElementAt (2);
  370. m_bInputOk=1;
  371. m_cardtype="蓝钻卡副卡";
  372. GetNameFromNo2(m_memberno2,m_membernoname,m_membernosex,m_membernophone,m_membernojiage);
  373. m_name=m_membernoname;
  374. UpdateData(false);
  375. if(type!=-1 && type==m_type)
  376. return;
  377. namearray.Add (m_cardtype);
  378. }
  379. }
  380. }
  381. if(namearray.GetSize ()==1)return;
  382. if(type==-1 && namearray.GetSize ()>1)
  383. {
  384. SelCardType dlg;
  385. dlg.m_pArray =&namearray;
  386. dlg.DoModal ();
  387. CheckType(dlg.m_type);
  388. return;
  389. }
  390. m_cardtype="";
  391. m_name="";
  392. UpdateData(false);
  393. SetDlgItemText(IDC_STATIC1,"没有这个会员卡号!");
  394. }
  395. void BookingPage3::GetNameFromNo(CString no, CString &name, CString &sex, CString &phone)
  396. {
  397. CString filter="[memberno]='"+no+"'";
  398. g_sendhead.bsql=0;
  399. g_sendhead.code[0]=68;
  400. g_sendhead.tabcount=1;
  401. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  402. DataToArray(&g_List1array);
  403. if(g_List1array.GetSize ())
  404. {
  405. name=g_List1array.ElementAt (0).ElementAt (2);
  406. sex=g_List1array.ElementAt (0).ElementAt (3);
  407. phone=g_List1array.ElementAt (0).ElementAt (4);
  408. return;
  409. }
  410. }
  411. void BookingPage3::GetNameFromNo2(CString no, CString &name, CString &sex, CString &phone, CString &price)
  412. {
  413. CString filter="[memberno]='"+no+"'";
  414. g_sendhead.bsql=0;
  415. g_sendhead.code[0]=130;
  416. g_sendhead.tabcount=1;
  417. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  418. DataToArray(&g_List1array);
  419. if(g_List1array.GetSize ())
  420. {
  421. name=g_List1array.ElementAt (0).ElementAt (2);
  422. sex=g_List1array.ElementAt (0).ElementAt (3);
  423. phone=g_List1array.ElementAt (0).ElementAt (4);
  424. price=g_List1array.ElementAt (0).ElementAt (9);
  425. return;
  426. }
  427. }
  428. void BookingPage3::InputOk()
  429. {
  430. }
  431. BOOL BookingPage3::CheckOK()
  432. {
  433. UpdateData();
  434. int pos;
  435. /*=m_combobm.GetCurSel ();
  436. if(pos!=-1)
  437. {
  438. m_combobm.GetLBText (pos, m_bm);
  439. }
  440. else
  441. return 0;*/
  442. pos=m_comborenyuan.GetCurSel ();
  443. if(pos!=-1)
  444. {
  445. m_comborenyuan.GetLBText (pos, m_ren);
  446. }
  447. else
  448. return 0;
  449. m_style=GetRights();
  450. #ifdef ZHIAI_VERSION
  451. pos=m_comboarea.GetCurSel ();
  452. if(pos!=-1)
  453. {
  454. m_comboarea.GetLBText (pos, m_outside);
  455. }
  456. else
  457. m_outside.Empty ();
  458. #endif
  459. #ifdef LKAY_VERSION
  460. pos=m_combofrom.GetCurSel ();
  461. if(pos!=-1)
  462. {
  463. m_combofrom.GetLBText (pos, m_from);
  464. }
  465. else
  466. {
  467. m_from.Empty ();
  468. }
  469. pos=m_comboreason.GetCurSel ();
  470. if(pos!=-1)
  471. {
  472. m_comboreason.GetLBText (pos, m_reason);
  473. }
  474. else
  475. {
  476. m_reason.Empty ();
  477. }
  478. #endif
  479. return 1;
  480. }
  481. CString BookingPage3::GetRights()
  482. {
  483. CString ret,temp;
  484. for(int i=0; i<12; i++)
  485. {
  486. temp.Format ("%d",((CButton*)GetDlgItem(IDC_CHECK1+i))->GetCheck());
  487. ret+=temp;
  488. }
  489. return ret;
  490. }
  491. void BookingPage3::SetRights(CString rights)
  492. {
  493. for(int i=0; i<rights.GetLength (); i++)
  494. {
  495. if(i>=12)break;
  496. ((CButton*)GetDlgItem(IDC_CHECK1+i))->SetCheck(rights.GetAt (i)=='1');
  497. }
  498. }
  499. void BookingPage3::NewDan()
  500. {
  501. m_clothescount = _T("");
  502. m_clothescount2 = _T("");
  503. m_outside = _T("");
  504. m_outside2 = _T("");
  505. m_style = _T("000000000000");
  506. m_memberno = _T("");
  507. m_cardtype = _T("");
  508. m_name = _T("");
  509. m_memberno = _T("");
  510. m_cardtype = _T("");
  511. m_combobm.SetCurSel (-1);
  512. m_comborenyuan.SetCurSel (-1);
  513. SetRights(m_style);
  514. UpdateData(0);
  515. }
  516. void BookingPage3::OnButton1()
  517. {
  518. TXFG dlg;
  519. dlg.DoModal ();
  520. }
  521. void BookingPage3::OnButton3() // 输入会员卡号按钮;
  522. {
  523. UpdateData();
  524. InputMemberno dlg;
  525. dlg.m_bNoAdd = 1;
  526. if (dlg.DoModal() == IDOK)
  527. {
  528. m_memberno = dlg.m_memberno;
  529. m_memberno2 = dlg.m_memberno2;
  530. m_type = dlg.m_type;
  531. m_memberno2date = dlg.m_memberno2date;
  532. m_membernoname = dlg.m_membernoname;
  533. m_membernosex = dlg.m_membernosex;
  534. m_membernophone = dlg.m_membernophone;
  535. m_membernojiage = dlg.m_membernojiage;
  536. m_name = dlg.m_name;
  537. m_cardtype = dlg.m_cardtype;
  538. UpdateData(0);
  539. }
  540. }
  541. void BookingPage3::ShowMemberDlg()
  542. {
  543. if(m_bFirst==0)
  544. return;
  545. m_bFirst=0;
  546. OnButton3();
  547. }
  548. void BookingPage3::OnButton10()
  549. {
  550. // TODO: Add your control notification handler code here
  551. SPLBDlg dlg;
  552. dlg.m_mode=8;
  553. dlg.DoModal ();
  554. m_combofrom.ResetContent ();
  555. }
  556. void BookingPage3::OnButton11()
  557. {
  558. // TODO: Add your control notification handler code here
  559. SPLBDlg dlg;
  560. dlg.m_mode=9;
  561. dlg.DoModal ();
  562. m_comboreason.ResetContent ();
  563. }
  564. void BookingPage3::OnDropdownCOMBOfrom()
  565. {
  566. // TODO: Add your control notification handler code here
  567. if(m_combofrom.GetCount ()<2)
  568. {
  569. g_sendhead.bsql=0;
  570. g_sendhead.code[0]=186;
  571. g_sendhead.tabcount=1;
  572. g_pMainWnd->ProcessChatMessageRequest2(3);if(g_bSendOK==0)return;
  573. DataToArray(&g_List1array);
  574. for(int ii=0; ii<g_List1array.GetSize (); ii++)
  575. m_combofrom.AddString ( g_List1array.ElementAt (ii).ElementAt(0) );
  576. }
  577. }
  578. void BookingPage3::OnDropdownCOMBOreason()
  579. {
  580. // TODO: Add your control notification handler code here
  581. if(m_comboreason.GetCount ()<2)
  582. {
  583. g_sendhead.bsql=0;
  584. g_sendhead.code[0]=187;
  585. g_sendhead.tabcount=1;
  586. g_pMainWnd->ProcessChatMessageRequest2(3);if(g_bSendOK==0)return;
  587. DataToArray(&g_List1array);
  588. for(int ii=0; ii<g_List1array.GetSize (); ii++)
  589. m_comboreason.AddString ( g_List1array.ElementAt (ii).ElementAt(0) );
  590. }
  591. }
  592. void BookingPage3::OnBnClickedNewcard() // 开新卡;
  593. {
  594. if ( m_strPhone.IsEmpty() || m_strCustomer.IsEmpty() )
  595. {
  596. AfxMessageBox("顾客姓名和手机不能空!");
  597. return;
  598. }
  599. CString sql;
  600. SelMemberType dlg;
  601. if (dlg.DoModal() == IDOK)
  602. {
  603. if (dlg.m_type == 0)
  604. {
  605. AddMember dlg;
  606. dlg.m_name = m_strCustomer;
  607. dlg.m_phone = m_strPhone;
  608. if (dlg.DoModal() == IDOK)
  609. {
  610. if (AfxMessageBox("会员添加成功,是否充值或发放副卡?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
  611. {
  612. InputCard2Dlg dlg2;
  613. dlg2.m_name = dlg.m_name;
  614. dlg2.m_no = dlg.m_memberno;
  615. m_memberno = dlg.m_memberno;
  616. dlg2.DoModal();
  617. }
  618. sql = "update dindan set [memberno]='" + dlg.m_memberno + "' where [id]='" + m_strOrderNum + "'";
  619. g_sendhead.bsql = 1;
  620. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  621. }
  622. }
  623. else
  624. {
  625. AddMember dlg;
  626. dlg.m_mode = 1;
  627. dlg.m_name = m_strCustomer;
  628. dlg.m_phone = m_strPhone;
  629. dlg.m_jiage = m_strTaoxiJiaoge;
  630. if (dlg.DoModal() == IDOK)
  631. {
  632. if (AfxMessageBox("会员添加成功,是否充值或发放副卡?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
  633. {
  634. InputCard2Dlg dlg2;
  635. dlg2.m_mode = 1;
  636. dlg2.m_name = dlg.m_name;
  637. dlg2.m_no = dlg.m_memberno;
  638. m_memberno = dlg.m_memberno;
  639. dlg2.DoModal();
  640. }
  641. sql = "update dindan set [memberno]='" + dlg.m_memberno + "' where [id]='" + m_strOrderNum + "'";
  642. g_sendhead.bsql = 1;
  643. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  644. }
  645. }
  646. }
  647. UpdateData(FALSE);
  648. if(!m_memberno.IsEmpty())GetDlgItem(Btn_NewCard)->EnableWindow(FALSE);
  649. }