TakeControlDlg1.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. // TakeControlDlg1.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "TakeControlDlg1.h"
  6. #include "SelDress.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // TakeControlDlg1 dialog IDC_EDITtime2
  14. TakeControlDlg1::TakeControlDlg1(CWnd* pParent /*=NULL*/)
  15. : CDialog(TakeControlDlg1::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(TakeControlDlg1)
  18. m_name1 = _T("");
  19. m_name2 = _T("");
  20. m_time2 = _T("");
  21. m_id = _T("");
  22. m_bz2 = _T("");
  23. m_clothescount = _T("");
  24. m_outside = _T("");
  25. m_ren = _T("");
  26. m_taoxiname = _T("");
  27. m_time4 = _T("");
  28. m_time5 = _T("");
  29. m_time6 = _T("");
  30. m_taketime = _T("");
  31. m_limitcount = atoi(g_cominfoarray.ElementAt(0).ElementAt(82));
  32. m_dress = _T("");
  33. m_bModify=0;
  34. m_pIdArray=NULL;
  35. m_pBranchArray=NULL;
  36. m_bz = _T("");
  37. //}}AFX_DATA_INIT
  38. if(m_limitcount==0)m_limitcount=10;
  39. }
  40. void TakeControlDlg1::DoDataExchange(CDataExchange* pDX)
  41. {
  42. CDialog::DoDataExchange(pDX);
  43. //{{AFX_DATA_MAP(TakeControlDlg1)
  44. DDX_Control(pDX, IDC_COMBObranch, m_combobranch);
  45. DDX_Control(pDX, IDC_COMBO12, m_combo22);
  46. DDX_Control(pDX, IDC_COMBO10, m_combo12);
  47. DDX_Control(pDX, IDC_LIST2, m_List1);
  48. DDX_Control(pDX, IDC_SPIN1, m_spin1);
  49. DDX_Control(pDX, IDC_LIST1, m_listbox1);
  50. DDX_Control(pDX, IDC_COMBOdatetime, m_combodatetime);
  51. DDX_Control(pDX, IDC_COMBO5, m_combobox);
  52. DDX_Control(pDX, IDC_COMBO11, m_combobox2);
  53. DDX_Control(pDX, IDC_COMBO4, m_combo4);
  54. DDX_Control(pDX, IDC_COMBO3, m_combo3);
  55. DDX_Control(pDX, IDC_EDITtime6, m_editdate4);
  56. DDX_Control(pDX, IDC_EDITtime4, m_editdate2);
  57. DDX_Control(pDX, IDC_EDITtime2, m_editdate);
  58. DDX_Control(pDX, IDC_COMBO2, m_combo2);
  59. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  60. DDX_Text(pDX, IDC_EDITname, m_name1);
  61. DDX_Text(pDX, IDC_EDITname2, m_name2);
  62. DDX_Text(pDX, IDC_EDITtime2, m_time2);
  63. DDX_Text(pDX, IDC_EDITid, m_id);
  64. DDX_Text(pDX, IDC_EDITObz2, m_bz2);
  65. DDX_Text(pDX, IDC_EDITOclothescount, m_clothescount);
  66. DDX_Text(pDX, IDC_EDITOoutside, m_outside);
  67. DDX_Text(pDX, IDC_EDITOren, m_ren);
  68. DDX_Text(pDX, IDC_EDITtaoxiname, m_taoxiname);
  69. DDX_Text(pDX, IDC_EDITtime4, m_time4);
  70. DDX_Text(pDX, IDC_EDITtime6, m_time6);
  71. DDX_CBString(pDX, IDC_COMBOdatetime, m_taketime);
  72. DDX_Text(pDX, IDC_EDIT1, m_limitcount);
  73. DDX_Text(pDX, IDC_EDITdress, m_dress);
  74. DDX_Text(pDX, IDC_EDITbz, m_bz);
  75. DDV_MaxChars(pDX, m_bz, 150);
  76. //}}AFX_DATA_MAP
  77. }
  78. BEGIN_MESSAGE_MAP(TakeControlDlg1, CDialog)
  79. //{{AFX_MSG_MAP(TakeControlDlg1)
  80. ON_CBN_SELCHANGE(IDC_COMBO5, OnSelchangeCombo5)
  81. ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
  82. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  83. ON_EN_CHANGE(IDC_EDITtime2, OnChangeEDITtime2)
  84. ON_CBN_SELCHANGE(IDC_COMBO11, OnSelchangeCombo11)
  85. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  86. //}}AFX_MSG_MAP
  87. END_MESSAGE_MAP()
  88. /////////////////////////////////////////////////////////////////////////////
  89. // TakeControlDlg1 message handlers
  90. BOOL TakeControlDlg1::OnInitDialog()
  91. {
  92. CDialog::OnInitDialog();
  93. #ifdef ENTERPRISE_VERSION
  94. GetDlgItem(IDC_STATICbranch)->ShowWindow(SW_SHOW);
  95. GetDlgItem(IDC_COMBObranch)->ShowWindow(SW_SHOW);
  96. // m_combobranch.AddString ("yy");
  97. for(int i=0; i<g_brancharray.GetSize (); i++)
  98. {
  99. m_combobranch.AddString (g_brancharray.ElementAt (i).ElementAt (0));
  100. }
  101. #endif
  102. // TODO: Add extra initialization here
  103. #ifdef CHILD_VERSION
  104. GetDlgItem(IDC_STATIC1)->SetWindowText("家长姓名:");
  105. GetDlgItem(IDC_STATIC2)->SetWindowText("宝宝姓名:");
  106. GetDlgItem(IDC_STATIC10)->SetWindowText("引导师:");
  107. #endif
  108. if(IsHasRights2new(49)==0)
  109. {
  110. GetDlgItem(IDC_BUTTON1)->EnableWindow(0);
  111. }
  112. #ifdef CHILD_VERSION
  113. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;景点,100;拍照,100;拍照日期,100;时间,100;摄影师,100;化妆师,100;接单人,100;套系名称,100;套系价格,100" );
  114. #else
  115. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;婚期,100;景点,100;拍照,100;拍照日期,100;时间,100;摄影师,100;化妆师,100;接单人,100;套系名称,100;套系价格,100" );
  116. #endif
  117. m_spin1.SetRange (1, 500);
  118. /* m_combodatetime.AddString ("上午9点");
  119. m_combodatetime.AddString ("上午10点");
  120. m_combodatetime.AddString ("上午11点");
  121. m_combodatetime.AddString ("上午12点");
  122. m_combodatetime.AddString ("下午1点");
  123. m_combodatetime.AddString ("下午2点");
  124. m_combodatetime.AddString ("下午3点");
  125. m_combodatetime.AddString ("下午4点");
  126. m_combodatetime.AddString ("下午5点");
  127. m_combodatetime.AddString ("下午6点");
  128. m_combodatetime.AddString ("晚上7点");
  129. m_combodatetime.AddString ("晚上8点");
  130. m_combodatetime.AddString ("晚上9点");
  131. m_combodatetime.AddString ("晚上10点");*/
  132. m_combodatetime.AddString ("09:00");
  133. m_combodatetime.AddString ("10:00");
  134. m_combodatetime.AddString ("11:00");
  135. m_combodatetime.AddString ("12:00");
  136. m_combodatetime.AddString ("13:00");
  137. m_combodatetime.AddString ("14:00");
  138. m_combodatetime.AddString ("15:00");
  139. m_combodatetime.AddString ("16:00");
  140. m_combodatetime.AddString ("17:00");
  141. m_combodatetime.AddString ("18:00");
  142. m_combodatetime.AddString ("19:00");
  143. m_combodatetime.AddString ("20:00");
  144. m_combodatetime.AddString ("21:00");
  145. m_combodatetime.AddString ("22:00");
  146. if(g_bAllBranch==0)
  147. {
  148. GetDlgItem(IDC_STATIC7)->ShowWindow(0);
  149. GetDlgItem(IDC_EDITtime5)->ShowWindow(0);
  150. }
  151. else
  152. {
  153. CRect rc,rc2;
  154. GetDlgItem(IDC_STATIC20)->ShowWindow(0);
  155. GetWindowRect(rc);
  156. m_List1.GetWindowRect(rc2);
  157. rc.right=rc2.left;
  158. MoveWindow(rc);
  159. }
  160. if(m_pIdArray==NULL)
  161. {
  162. m_acCombo.Init(&m_combobox);
  163. if(g_bAllBranch==0)
  164. {
  165. g_sendhead.bsql=0;
  166. g_sendhead.code[0]=30;
  167. g_sendhead.tabcount=1;
  168. g_pMainWnd->ProcessChatMessageRequest2(21);
  169. if(g_bSendOK==0)return 0;
  170. DataToArray(&m_List1array);
  171. }
  172. else
  173. {
  174. if(m_bModify==0)
  175. {
  176. m_List1array.RemoveAll ();
  177. CStringArray failbrancharray;
  178. CString branch;
  179. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  180. {
  181. if(i!=-1)
  182. {
  183. branch=g_brancharray.ElementAt (i).ElementAt (0);
  184. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  185. g_pMainWnd->OnDisconnect();
  186. g_branchname=branch;
  187. g_bBranchModify=1;
  188. }
  189. else
  190. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  191. g_sendhead.bsql=0;
  192. g_sendhead.code[0]=30;
  193. g_sendhead.tabcount=1;
  194. g_pMainWnd->ProcessChatMessageRequest2(1);
  195. if(g_bSendOK==0)
  196. {
  197. failbrancharray.Add(branch);
  198. continue;
  199. }
  200. CArray<CStringArray, CStringArray>List1array;
  201. DataToArray(&List1array);
  202. int size=m_List1array.GetSize ();
  203. for(int j=0; j<List1array.GetSize (); j++)
  204. {
  205. size++;
  206. m_List1array.SetSize(size , 1 );
  207. size--;
  208. m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
  209. m_List1array.ElementAt (size).Add (branch);
  210. size++;
  211. }
  212. }
  213. for(i=0; i<failbrancharray.GetSize (); i++)
  214. {
  215. //AfxMessageBox("连接"+failbrancharray.ElementAt(i)+"服务器失败!", MB_ICONINFORMATION);
  216. }
  217. g_pMainWnd->OnDisconnect();
  218. g_bBranchModify=0;
  219. g_branchip=g_branchname="";
  220. }
  221. else
  222. {
  223. GetDlgItem(IDC_STATIC5)->SetWindowText("");
  224. GetDlgItem(IDC_STATIC6)->SetWindowText("");
  225. m_combobox.ShowWindow (0);
  226. }
  227. }
  228. m_acCombo.m_pArray=&m_List1array;
  229. if(m_bModify==0)m_combobox.SetFocus ();
  230. m_combobox2.ShowWindow (0);
  231. }
  232. else
  233. {
  234. for(int i=0; i<m_pIdArray->GetSize(); i++)
  235. {
  236. m_combobox2.AddString (m_pIdArray->ElementAt(i));
  237. }
  238. m_combobox2.SetCurSel (0);
  239. id=m_pIdArray->ElementAt (0);
  240. GetDlgItem(IDC_STATIC5)->SetWindowText("选择客人:");
  241. GetDlgItem(IDC_STATIC6)->SetWindowText("");
  242. m_combobox.ShowWindow (0);
  243. }
  244. this->CenterWindow (g_pMainWnd);
  245. if(g_bAllBranch)
  246. GetDlgItem(IDC_EDITtime5)->SetWindowText(m_branch);
  247. if(m_bModify)ClientChange();
  248. return false; // return TRUE unless you set the focus to a control
  249. // EXCEPTION: OCX Property Pages should return FALSE
  250. }
  251. void TakeControlDlg1::OnOK()
  252. {
  253. // TODO: Add extra validation here
  254. UpdateData();
  255. if(!CheckDateOK(m_time2))return;
  256. CString branch;
  257. int pos=m_combo1.GetCurSel ();
  258. if(pos!=-1)
  259. m_combo1.GetLBText (pos, m_waiter1);
  260. pos=m_combobranch.GetCurSel ();
  261. if(pos!=-1)
  262. m_combobranch.GetLBText (pos, branch);
  263. #ifdef ENTERPRISE_VERSION
  264. if(branch=="")
  265. {
  266. AfxMessageBox("请先选中您要安排的拍摄门店", MB_ICONINFORMATION);
  267. return;
  268. }
  269. #endif
  270. pos=m_combo2.GetCurSel ();
  271. if(pos!=-1)
  272. m_combo2.GetLBText (pos, m_waiter2);
  273. pos=m_combo12.GetCurSel ();
  274. if(pos!=-1)
  275. m_combo12.GetLBText (pos, m_waiter12);
  276. pos=m_combo22.GetCurSel ();
  277. if(pos!=-1)
  278. m_combo22.GetLBText (pos, m_waiter22);
  279. CString sql;
  280. pos=m_listbox1.GetCurSel ();
  281. if(pos==-1)
  282. {
  283. AfxMessageBox("请先先中您要安排的景点!", MB_ICONINFORMATION);
  284. return;
  285. }
  286. CString type=m_jdarray.ElementAt (pos).ElementAt (1);
  287. if( m_bz.GetLength()>150)m_bz=m_bz.Left(150);
  288. sql.Format ("update dindanjd set [bookingdate]='%s',[time]='%s',[waiter1]='%s',[waiter2]='%s',[waiter12]='%s',[waiter22]='%s',[dress]='%s',[bz]='%s',[clerk]='%s',[inputtime]='msgtimestamp2',[branch]='%s' where [id]='%s' and [name]='%s'",
  289. m_time2,m_taketime,m_waiter1,m_waiter2,m_waiter12,m_waiter22,m_dress,m_bz,g_user.name,branch,id,type);
  290. m_jdarray.ElementAt (pos).SetAt (2, m_time2);
  291. m_jdarray.ElementAt (pos).SetAt (3, m_taketime);
  292. m_jdarray.ElementAt (pos).SetAt (4, m_waiter1);
  293. m_jdarray.ElementAt (pos).SetAt (5, m_waiter2);
  294. m_jdarray.ElementAt (pos).SetAt (6, m_waiter12);
  295. m_jdarray.ElementAt (pos).SetAt (7, m_waiter22);
  296. m_jdarray.ElementAt (pos).SetAt (8, m_dress);
  297. m_jdarray.ElementAt (pos).SetAt (9, m_bz);
  298. m_jdarray.ElementAt (pos).SetAt (10, branch);
  299. g_sendhead.bsql=1;
  300. if(g_bAllBranch==0)
  301. {
  302. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  303. }
  304. else
  305. {
  306. g_branchip=GetIP(m_branch);
  307. g_pMainWnd->OnDisconnect();
  308. g_branchname=m_branch;
  309. g_bBranchModify=1;
  310. g_pMainWnd->ProcessChatMessageRequest2(sql);
  311. g_pMainWnd->OnDisconnect();g_bBranchModify=0;g_branchip=g_branchname="";
  312. if(g_bSendOK==0)return;
  313. }
  314. dataUpdateCentrer.UpdateTodayBarMsg();
  315. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  316. //AfxMessageBox("wenbin test!!!", MB_ICONINFORMATION); //modify by wangwenbin 2015-05-03
  317. DataChange();
  318. }
  319. void TakeControlDlg1::ClientChange()
  320. {
  321. if(g_bAllBranch==0)
  322. {
  323. CString filter="id='"+id+"';id='"+id+"'";
  324. g_sendhead.code[0]=53;
  325. g_sendhead.code[1]=150;
  326. g_sendhead.tabcount=2;
  327. g_sendhead.bsql=0;
  328. g_pMainWnd->ProcessChatMessageRequest2(filter);
  329. if(g_bSendOK==0)return;
  330. DataToArray(&g_List1array,&m_jdarray);
  331. }
  332. else
  333. {
  334. CString filter="id='"+id+"';id='"+id+"'";
  335. g_sendhead.code[0]=53;
  336. g_sendhead.code[1]=150;
  337. g_sendhead.tabcount=2;
  338. g_sendhead.bsql=0;
  339. g_branchip=GetIP(m_branch);
  340. g_pMainWnd->OnDisconnect();
  341. g_branchname=m_branch;
  342. g_bBranchModify=1;
  343. g_pMainWnd->ProcessChatMessageRequest2(filter);
  344. g_pMainWnd->OnDisconnect();
  345. g_bBranchModify=0;
  346. g_branchip=g_branchname="";
  347. if(g_bSendOK==0)return;
  348. DataToArray(&g_List1array,&m_jdarray);
  349. }
  350. m_listbox1.ResetContent ();
  351. for(int i=0; i<m_jdarray.GetSize (); i++)
  352. {
  353. m_listbox1.AddString (m_jdarray.ElementAt (i).ElementAt (1));
  354. }
  355. if(g_List1array.GetSize ())
  356. {
  357. m_id=g_List1array.ElementAt (0).ElementAt (2);
  358. m_name1=g_List1array.ElementAt (0).ElementAt (3);
  359. m_name2=g_List1array.ElementAt (0).ElementAt (4);
  360. m_taoxiname=g_List1array.ElementAt (0).ElementAt (7);
  361. m_ren=g_List1array.ElementAt (0).ElementAt (10);
  362. UpdateData(false);
  363. }
  364. if(m_listbox1.GetCount())
  365. {
  366. m_listbox1.SetCurSel(0);
  367. OnSelchangeList1();
  368. }
  369. }
  370. void TakeControlDlg1::OnSelchangeCombo5() // 查找客户下拉框;
  371. {
  372. // TODO: Add your control notification handler code here
  373. int pos=m_combobox.GetCurSel();
  374. if(pos==-1)return;
  375. if(m_acCombo.m_posarray.GetSize ()<=pos)return;
  376. int pos2=m_acCombo.m_posarray .ElementAt (pos);
  377. id=m_List1array.ElementAt (pos2).ElementAt (0);
  378. int size=m_List1array.ElementAt (pos2).GetSize();
  379. if(g_bAllBranch)
  380. {
  381. m_branch=m_List1array.ElementAt (pos2).ElementAt (size-1);
  382. GetDlgItem(IDC_EDITtime5)->SetWindowText(m_branch);
  383. }
  384. ClientChange();
  385. }
  386. void TakeControlDlg1::OnSelchangeList1()
  387. {
  388. // TODO: Add your control notification handler code here
  389. int pos=m_listbox1.GetCurSel ();
  390. if(pos==-1)return;
  391. m_time2=m_jdarray.ElementAt (pos).ElementAt (2);
  392. m_taketime=m_jdarray.ElementAt (pos).ElementAt (3);
  393. m_waiter1=m_jdarray.ElementAt (pos).ElementAt (4);
  394. m_waiter2=m_jdarray.ElementAt (pos).ElementAt (5);
  395. m_waiter12=m_jdarray.ElementAt (pos).ElementAt (6);
  396. m_waiter22=m_jdarray.ElementAt (pos).ElementAt (7);
  397. m_dress=m_jdarray.ElementAt (pos).ElementAt (8);
  398. m_bz=m_jdarray.ElementAt (pos).ElementAt (9);
  399. CString branch=m_jdarray.ElementAt (pos).ElementAt (10);
  400. UpdateData(false);
  401. if(m_waiter1.IsEmpty ())
  402. m_combo1.SetCurSel (-1);
  403. else
  404. {
  405. if(m_combo1.FindString (0, m_waiter1)==-1)
  406. {
  407. m_combo1.InsertString (0, m_waiter1);
  408. m_combo1.SetCurSel (0);
  409. }
  410. else
  411. {
  412. m_combo1.SetCurSel (m_combo1.FindString (0, m_waiter1));
  413. }
  414. }
  415. if(m_waiter2.IsEmpty ())
  416. m_combo2.SetCurSel (-1);
  417. else
  418. {
  419. if(m_combo2.FindString (0, m_waiter2)==-1)
  420. {
  421. m_combo2.InsertString (0, m_waiter2);
  422. m_combo2.SetCurSel (0);
  423. }
  424. else
  425. {
  426. m_combo2.SetCurSel (m_combo2.FindString (0, m_waiter2));
  427. }
  428. }
  429. if(m_waiter12.IsEmpty ())
  430. m_combo12.SetCurSel (-1);
  431. else
  432. {
  433. if(m_combo12.FindString (0, m_waiter12)==-1)
  434. {
  435. m_combo12.InsertString (0, m_waiter12);
  436. m_combo12.SetCurSel (0);
  437. }
  438. else
  439. {
  440. m_combo12.SetCurSel (m_combo12.FindString (0, m_waiter12));
  441. }
  442. }
  443. if(m_waiter22.IsEmpty ())
  444. m_combo22.SetCurSel (-1);
  445. else
  446. {
  447. if(m_combo22.FindString (0, m_waiter22)==-1)
  448. {
  449. m_combo22.InsertString (0, m_waiter22);
  450. m_combo22.SetCurSel (0);
  451. }
  452. else
  453. {
  454. m_combo22.SetCurSel (m_combo22.FindString (0, m_waiter22));
  455. }
  456. }
  457. if(branch.IsEmpty ())
  458. m_combobranch.SetCurSel (-1);
  459. else
  460. {
  461. if(m_combobranch.FindString (0, branch)==-1)
  462. {
  463. m_combobranch.InsertString (0, branch);
  464. m_combobranch.SetCurSel (0);
  465. }
  466. else
  467. {
  468. m_combobranch.SetCurSel (m_combobranch.FindString (0, branch));
  469. }
  470. }
  471. }
  472. void TakeControlDlg1::OnButton1()
  473. {
  474. // TODO: Add your control notification handler code here
  475. UpdateData();
  476. CString sql;
  477. sql.Format ("update version set [limitcount1]='%d'", m_limitcount);
  478. g_sendhead.bsql=1;
  479. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  480. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  481. CString str;
  482. str.Format ("%d", m_limitcount);
  483. g_cominfoarray.ElementAt(0).SetAt (82, str);
  484. }
  485. void TakeControlDlg1::DataChange()
  486. {
  487. if(g_bAllBranch)return;
  488. UpdateData();
  489. if(!CheckDateOK2(m_time2))return;
  490. int ii=0;
  491. if(g_bAllBranch==0)
  492. {
  493. g_sendhead.code[0]=120;
  494. g_sendhead.tabcount=1;
  495. g_sendhead.bsql=0;
  496. CString sql;
  497. sql.Format ("bookingdate>='"+m_time2+"' and bookingdate<='"+m_time2+"'");
  498. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  499. DataToArray(&g_List1array);
  500. }
  501. else
  502. {
  503. if(m_List2array.GetSize()==0)
  504. {
  505. CStringArray failbrancharray;
  506. CString branch;
  507. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  508. {
  509. if(i!=-1)
  510. {
  511. branch=g_brancharray.ElementAt (i).ElementAt (0);
  512. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  513. g_pMainWnd->OnDisconnect();
  514. g_branchname=branch;
  515. g_bBranchModify=1;
  516. }
  517. else
  518. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  519. g_sendhead.bsql=0;
  520. g_sendhead.code[0]=120;
  521. g_sendhead.tabcount=1;
  522. g_pMainWnd->ProcessChatMessageRequest2(1);
  523. if(g_bSendOK==0)
  524. {
  525. failbrancharray.Add (branch);
  526. continue;
  527. }
  528. CArray<CStringArray, CStringArray>List1array;
  529. DataToArray(&List1array);
  530. int size=m_List2array.GetSize ();
  531. for(int j=0; j<List1array.GetSize (); j++)
  532. {
  533. size++;
  534. m_List2array.SetSize(size , 1 );
  535. size--;
  536. m_List2array.ElementAt (size).Copy (List1array.ElementAt (j));
  537. m_List2array.ElementAt (size).Add (branch);
  538. size++;
  539. }
  540. }
  541. for(i=0; i<failbrancharray.GetSize (); i++)
  542. {
  543. // AfxMessageBox("连接"+failbrancharray.ElementAt(i)+"服务器失败!", MB_ICONINFORMATION);
  544. }
  545. g_pMainWnd->OnDisconnect();
  546. g_bBranchModify=0;g_branchip=g_branchname="";
  547. }
  548. g_List1array.RemoveAll();
  549. g_List1array.SetSize(m_List2array.GetSize () , 1 );
  550. int size=0;
  551. for(int j=0; j<m_List2array.GetSize (); j++)
  552. {
  553. #ifdef CHILD_VERSION
  554. if(m_List2array.ElementAt (j).ElementAt(8)!=m_time2)continue;
  555. #else
  556. if(m_List2array.ElementAt (j).ElementAt(9)!=m_time2)continue;
  557. #endif
  558. g_List1array.ElementAt (size).Copy (m_List2array.ElementAt (j));
  559. size++;
  560. }
  561. g_List1array.SetSize(size , 1 );
  562. }
  563. m_List1.DeleteAllItems2 ();
  564. m_List1.m_arLabels.SetSize( g_List1array.GetSize (), 1 );
  565. int count=0;
  566. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  567. {
  568. m_List1.m_arLabels.ElementAt (count++).Copy (g_List1array.ElementAt (ii));
  569. }
  570. m_List1.m_arLabels.SetSize(count, 1);
  571. ii=count;
  572. m_List1.m_LabelCount=ii;
  573. m_List1.SetItemCountEx (ii);
  574. CString str;
  575. str.Format ("客人:%d", ii);
  576. SetDlgItemText(IDC_STATIC4, str);
  577. if(m_limitcount<=ii)
  578. AfxMessageBox("友情提醒:\r\n当日预约客人过多,请合理安排客人。");
  579. }
  580. void TakeControlDlg1::OnChangeEDITtime2()
  581. {
  582. // TODO: If this is a RICHEDIT control, the control will not
  583. // send this notification unless you override the CDialog::OnInitDialog()
  584. // function and call CRichEditCtrl().SetEventMask()
  585. // with the ENM_CHANGE flag ORed into the mask.
  586. DataChange();
  587. // TODO: Add your control notification handler code here
  588. }
  589. void TakeControlDlg1::OnSelchangeCombo11()
  590. {
  591. // TODO: Add your control notification handler code here
  592. int pos=m_combobox2.GetCurSel ();
  593. if(pos==-1)return;
  594. m_combobox2.GetLBText (pos, id);
  595. if(g_bAllBranch)
  596. {
  597. m_branch=m_pBranchArray->ElementAt(pos);
  598. GetDlgItem(IDC_EDITtime5)->SetWindowText(m_branch);
  599. }
  600. ClientChange();
  601. }
  602. void TakeControlDlg1::OnButton2()
  603. {
  604. // TODO: Add your control notification handler code here
  605. UpdateData();
  606. SelDress dlg;
  607. dlg.m_sel =m_dress;
  608. if(dlg.DoModal ()==IDOK)
  609. {
  610. m_dress=dlg.m_sel;
  611. UpdateData(0);
  612. }
  613. }