TakeControlDlg1.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  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. int i = 0;
  180. for( i=-1; i<g_brancharray.GetSize ()-1; i++)
  181. {
  182. if(i!=-1)
  183. {
  184. branch=g_brancharray.ElementAt (i).ElementAt (0);
  185. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  186. g_pMainWnd->OnDisconnect();
  187. g_branchname=branch;
  188. g_bBranchModify=1;
  189. }
  190. else
  191. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  192. g_sendhead.bsql=0;
  193. g_sendhead.code[0]=30;
  194. g_sendhead.tabcount=1;
  195. g_pMainWnd->ProcessChatMessageRequest2(1);
  196. if(g_bSendOK==0)
  197. {
  198. failbrancharray.Add(branch);
  199. continue;
  200. }
  201. CArray<CStringArray, CStringArray>List1array;
  202. DataToArray(&List1array);
  203. int size=m_List1array.GetSize ();
  204. for(int j=0; j<List1array.GetSize (); j++)
  205. {
  206. size++;
  207. m_List1array.SetSize(size , 1 );
  208. size--;
  209. m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
  210. m_List1array.ElementAt (size).Add (branch);
  211. size++;
  212. }
  213. }
  214. for(i=0; i<failbrancharray.GetSize (); i++)
  215. {
  216. //AfxMessageBox("连接"+failbrancharray.ElementAt(i)+"服务器失败!", MB_ICONINFORMATION);
  217. }
  218. g_pMainWnd->OnDisconnect();
  219. g_bBranchModify=0;
  220. g_branchip=g_branchname="";
  221. }
  222. else
  223. {
  224. GetDlgItem(IDC_STATIC5)->SetWindowText("");
  225. GetDlgItem(IDC_STATIC6)->SetWindowText("");
  226. m_combobox.ShowWindow (0);
  227. }
  228. }
  229. m_acCombo.m_pArray=&m_List1array;
  230. if(m_bModify==0)m_combobox.SetFocus ();
  231. m_combobox2.ShowWindow (0);
  232. }
  233. else
  234. {
  235. for(int i=0; i<m_pIdArray->GetSize(); i++)
  236. {
  237. m_combobox2.AddString (m_pIdArray->ElementAt(i));
  238. }
  239. m_combobox2.SetCurSel (0);
  240. id=m_pIdArray->ElementAt (0);
  241. GetDlgItem(IDC_STATIC5)->SetWindowText("选择客人:");
  242. GetDlgItem(IDC_STATIC6)->SetWindowText("");
  243. m_combobox.ShowWindow (0);
  244. }
  245. this->CenterWindow (g_pMainWnd);
  246. if(g_bAllBranch)
  247. GetDlgItem(IDC_EDITtime5)->SetWindowText(m_branch);
  248. if(m_bModify)ClientChange();
  249. return false; // return TRUE unless you set the focus to a control
  250. // EXCEPTION: OCX Property Pages should return FALSE
  251. }
  252. void TakeControlDlg1::OnOK()
  253. {
  254. // TODO: Add extra validation here
  255. UpdateData();
  256. if(!CheckDateOK(m_time2))return;
  257. CString branch;
  258. int pos=m_combo1.GetCurSel ();
  259. if(pos!=-1)
  260. m_combo1.GetLBText (pos, m_waiter1);
  261. pos=m_combobranch.GetCurSel ();
  262. if(pos!=-1)
  263. m_combobranch.GetLBText (pos, branch);
  264. #ifdef ENTERPRISE_VERSION
  265. if(branch=="")
  266. {
  267. AfxMessageBox("请先选中您要安排的拍摄门店", MB_ICONINFORMATION);
  268. return;
  269. }
  270. #endif
  271. pos=m_combo2.GetCurSel ();
  272. if(pos!=-1)
  273. m_combo2.GetLBText (pos, m_waiter2);
  274. pos=m_combo12.GetCurSel ();
  275. if(pos!=-1)
  276. m_combo12.GetLBText (pos, m_waiter12);
  277. pos=m_combo22.GetCurSel ();
  278. if(pos!=-1)
  279. m_combo22.GetLBText (pos, m_waiter22);
  280. CString sql;
  281. pos=m_listbox1.GetCurSel ();
  282. if(pos==-1)
  283. {
  284. AfxMessageBox("请先先中您要安排的景点!", MB_ICONINFORMATION);
  285. return;
  286. }
  287. CString type=m_jdarray.ElementAt (pos).ElementAt (1);
  288. if( m_bz.GetLength()>150)m_bz=m_bz.Left(150);
  289. 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'",
  290. m_time2,m_taketime,m_waiter1,m_waiter2,m_waiter12,m_waiter22,m_dress,m_bz,g_user.name,branch,id,type);
  291. m_jdarray.ElementAt (pos).SetAt (2, m_time2);
  292. m_jdarray.ElementAt (pos).SetAt (3, m_taketime);
  293. m_jdarray.ElementAt (pos).SetAt (4, m_waiter1);
  294. m_jdarray.ElementAt (pos).SetAt (5, m_waiter2);
  295. m_jdarray.ElementAt (pos).SetAt (6, m_waiter12);
  296. m_jdarray.ElementAt (pos).SetAt (7, m_waiter22);
  297. m_jdarray.ElementAt (pos).SetAt (8, m_dress);
  298. m_jdarray.ElementAt (pos).SetAt (9, m_bz);
  299. m_jdarray.ElementAt (pos).SetAt (10, branch);
  300. g_sendhead.bsql=1;
  301. if(g_bAllBranch==0)
  302. {
  303. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  304. }
  305. else
  306. {
  307. g_branchip=GetIP(m_branch);
  308. g_pMainWnd->OnDisconnect();
  309. g_branchname=m_branch;
  310. g_bBranchModify=1;
  311. g_pMainWnd->ProcessChatMessageRequest2(sql);
  312. g_pMainWnd->OnDisconnect();g_bBranchModify=0;g_branchip=g_branchname="";
  313. if(g_bSendOK==0)return;
  314. }
  315. dataUpdateCentrer.UpdateTodayBarMsg();
  316. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  317. //AfxMessageBox("wenbin test!!!", MB_ICONINFORMATION); //modify by wangwenbin 2015-05-03
  318. DataChange();
  319. }
  320. void TakeControlDlg1::ClientChange()
  321. {
  322. if(g_bAllBranch==0)
  323. {
  324. CString filter="id='"+id+"';id='"+id+"'";
  325. g_sendhead.code[0]=53;
  326. g_sendhead.code[1]=150;
  327. g_sendhead.tabcount=2;
  328. g_sendhead.bsql=0;
  329. g_pMainWnd->ProcessChatMessageRequest2(filter);
  330. if(g_bSendOK==0)return;
  331. DataToArray(&g_List1array,&m_jdarray);
  332. }
  333. else
  334. {
  335. CString filter="id='"+id+"';id='"+id+"'";
  336. g_sendhead.code[0]=53;
  337. g_sendhead.code[1]=150;
  338. g_sendhead.tabcount=2;
  339. g_sendhead.bsql=0;
  340. g_branchip=GetIP(m_branch);
  341. g_pMainWnd->OnDisconnect();
  342. g_branchname=m_branch;
  343. g_bBranchModify=1;
  344. g_pMainWnd->ProcessChatMessageRequest2(filter);
  345. g_pMainWnd->OnDisconnect();
  346. g_bBranchModify=0;
  347. g_branchip=g_branchname="";
  348. if(g_bSendOK==0)return;
  349. DataToArray(&g_List1array,&m_jdarray);
  350. }
  351. m_listbox1.ResetContent ();
  352. for(int i=0; i<m_jdarray.GetSize (); i++)
  353. {
  354. m_listbox1.AddString (m_jdarray.ElementAt (i).ElementAt (1));
  355. }
  356. if(g_List1array.GetSize ())
  357. {
  358. m_id=g_List1array.ElementAt (0).ElementAt (2);
  359. m_name1=g_List1array.ElementAt (0).ElementAt (3);
  360. m_name2=g_List1array.ElementAt (0).ElementAt (4);
  361. m_taoxiname=g_List1array.ElementAt (0).ElementAt (7);
  362. m_ren=g_List1array.ElementAt (0).ElementAt (10);
  363. UpdateData(false);
  364. }
  365. if(m_listbox1.GetCount())
  366. {
  367. m_listbox1.SetCurSel(0);
  368. OnSelchangeList1();
  369. }
  370. }
  371. void TakeControlDlg1::OnSelchangeCombo5() // 查找客户下拉框;
  372. {
  373. // TODO: Add your control notification handler code here
  374. int pos=m_combobox.GetCurSel();
  375. if(pos==-1)return;
  376. if(m_acCombo.m_posarray.GetSize ()<=pos)return;
  377. int pos2=m_acCombo.m_posarray .ElementAt (pos);
  378. id=m_List1array.ElementAt (pos2).ElementAt (0);
  379. int size=m_List1array.ElementAt (pos2).GetSize();
  380. if(g_bAllBranch)
  381. {
  382. m_branch=m_List1array.ElementAt (pos2).ElementAt (size-1);
  383. GetDlgItem(IDC_EDITtime5)->SetWindowText(m_branch);
  384. }
  385. ClientChange();
  386. }
  387. void TakeControlDlg1::OnSelchangeList1()
  388. {
  389. // TODO: Add your control notification handler code here
  390. int pos=m_listbox1.GetCurSel ();
  391. if(pos==-1)return;
  392. m_time2=m_jdarray.ElementAt (pos).ElementAt (2);
  393. m_taketime=m_jdarray.ElementAt (pos).ElementAt (3);
  394. m_waiter1=m_jdarray.ElementAt (pos).ElementAt (4);
  395. m_waiter2=m_jdarray.ElementAt (pos).ElementAt (5);
  396. m_waiter12=m_jdarray.ElementAt (pos).ElementAt (6);
  397. m_waiter22=m_jdarray.ElementAt (pos).ElementAt (7);
  398. m_dress=m_jdarray.ElementAt (pos).ElementAt (8);
  399. m_bz=m_jdarray.ElementAt (pos).ElementAt (9);
  400. CString branch=m_jdarray.ElementAt (pos).ElementAt (10);
  401. UpdateData(false);
  402. if(m_waiter1.IsEmpty ())
  403. m_combo1.SetCurSel (-1);
  404. else
  405. {
  406. if(m_combo1.FindString (0, m_waiter1)==-1)
  407. {
  408. m_combo1.InsertString (0, m_waiter1);
  409. m_combo1.SetCurSel (0);
  410. }
  411. else
  412. {
  413. m_combo1.SetCurSel (m_combo1.FindString (0, m_waiter1));
  414. }
  415. }
  416. if(m_waiter2.IsEmpty ())
  417. m_combo2.SetCurSel (-1);
  418. else
  419. {
  420. if(m_combo2.FindString (0, m_waiter2)==-1)
  421. {
  422. m_combo2.InsertString (0, m_waiter2);
  423. m_combo2.SetCurSel (0);
  424. }
  425. else
  426. {
  427. m_combo2.SetCurSel (m_combo2.FindString (0, m_waiter2));
  428. }
  429. }
  430. if(m_waiter12.IsEmpty ())
  431. m_combo12.SetCurSel (-1);
  432. else
  433. {
  434. if(m_combo12.FindString (0, m_waiter12)==-1)
  435. {
  436. m_combo12.InsertString (0, m_waiter12);
  437. m_combo12.SetCurSel (0);
  438. }
  439. else
  440. {
  441. m_combo12.SetCurSel (m_combo12.FindString (0, m_waiter12));
  442. }
  443. }
  444. if(m_waiter22.IsEmpty ())
  445. m_combo22.SetCurSel (-1);
  446. else
  447. {
  448. if(m_combo22.FindString (0, m_waiter22)==-1)
  449. {
  450. m_combo22.InsertString (0, m_waiter22);
  451. m_combo22.SetCurSel (0);
  452. }
  453. else
  454. {
  455. m_combo22.SetCurSel (m_combo22.FindString (0, m_waiter22));
  456. }
  457. }
  458. if(branch.IsEmpty ())
  459. m_combobranch.SetCurSel (-1);
  460. else
  461. {
  462. if(m_combobranch.FindString (0, branch)==-1)
  463. {
  464. m_combobranch.InsertString (0, branch);
  465. m_combobranch.SetCurSel (0);
  466. }
  467. else
  468. {
  469. m_combobranch.SetCurSel (m_combobranch.FindString (0, branch));
  470. }
  471. }
  472. }
  473. void TakeControlDlg1::OnButton1()
  474. {
  475. // TODO: Add your control notification handler code here
  476. UpdateData();
  477. CString sql;
  478. sql.Format ("update version set [limitcount1]='%d'", m_limitcount);
  479. g_sendhead.bsql=1;
  480. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  481. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  482. CString str;
  483. str.Format ("%d", m_limitcount);
  484. g_cominfoarray.ElementAt(0).SetAt (82, str);
  485. }
  486. void TakeControlDlg1::DataChange()
  487. {
  488. if(g_bAllBranch)return;
  489. UpdateData();
  490. if(!CheckDateOK2(m_time2))return;
  491. int ii=0;
  492. if(g_bAllBranch==0)
  493. {
  494. g_sendhead.code[0]=120;
  495. g_sendhead.tabcount=1;
  496. g_sendhead.bsql=0;
  497. CString sql;
  498. sql.Format ("bookingdate>='"+m_time2+"' and bookingdate<='"+m_time2+"'");
  499. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  500. DataToArray(&g_List1array);
  501. }
  502. else
  503. {
  504. if(m_List2array.GetSize()==0)
  505. {
  506. CStringArray failbrancharray;
  507. CString branch;
  508. int i = 0;
  509. for(i=-1; i<g_brancharray.GetSize ()-1; i++)
  510. {
  511. if(i!=-1)
  512. {
  513. branch=g_brancharray.ElementAt (i).ElementAt (0);
  514. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  515. g_pMainWnd->OnDisconnect();
  516. g_branchname=branch;
  517. g_bBranchModify=1;
  518. }
  519. else
  520. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  521. g_sendhead.bsql=0;
  522. g_sendhead.code[0]=120;
  523. g_sendhead.tabcount=1;
  524. g_pMainWnd->ProcessChatMessageRequest2(1);
  525. if(g_bSendOK==0)
  526. {
  527. failbrancharray.Add (branch);
  528. continue;
  529. }
  530. CArray<CStringArray, CStringArray>List1array;
  531. DataToArray(&List1array);
  532. int size=m_List2array.GetSize ();
  533. for(int j=0; j<List1array.GetSize (); j++)
  534. {
  535. size++;
  536. m_List2array.SetSize(size , 1 );
  537. size--;
  538. m_List2array.ElementAt (size).Copy (List1array.ElementAt (j));
  539. m_List2array.ElementAt (size).Add (branch);
  540. size++;
  541. }
  542. }
  543. for(i=0; i<failbrancharray.GetSize (); i++)
  544. {
  545. // AfxMessageBox("连接"+failbrancharray.ElementAt(i)+"服务器失败!", MB_ICONINFORMATION);
  546. }
  547. g_pMainWnd->OnDisconnect();
  548. g_bBranchModify=0;g_branchip=g_branchname="";
  549. }
  550. g_List1array.RemoveAll();
  551. g_List1array.SetSize(m_List2array.GetSize () , 1 );
  552. int size=0;
  553. for(int j=0; j<m_List2array.GetSize (); j++)
  554. {
  555. #ifdef CHILD_VERSION
  556. if(m_List2array.ElementAt (j).ElementAt(8)!=m_time2)continue;
  557. #else
  558. if(m_List2array.ElementAt (j).ElementAt(9)!=m_time2)continue;
  559. #endif
  560. g_List1array.ElementAt (size).Copy (m_List2array.ElementAt (j));
  561. size++;
  562. }
  563. g_List1array.SetSize(size , 1 );
  564. }
  565. m_List1.DeleteAllItems2 ();
  566. m_List1.m_arLabels.SetSize( g_List1array.GetSize (), 1 );
  567. int count=0;
  568. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  569. {
  570. m_List1.m_arLabels.ElementAt (count++).Copy (g_List1array.ElementAt (ii));
  571. }
  572. m_List1.m_arLabels.SetSize(count, 1);
  573. ii=count;
  574. m_List1.m_LabelCount=ii;
  575. m_List1.SetItemCountEx (ii);
  576. CString str;
  577. str.Format ("客人:%d", ii);
  578. SetDlgItemText(IDC_STATIC4, str);
  579. if(m_limitcount<=ii)
  580. AfxMessageBox("友情提醒:\r\n当日预约客人过多,请合理安排客人。");
  581. }
  582. void TakeControlDlg1::OnChangeEDITtime2()
  583. {
  584. // TODO: If this is a RICHEDIT control, the control will not
  585. // send this notification unless you override the CDialog::OnInitDialog()
  586. // function and call CRichEditCtrl().SetEventMask()
  587. // with the ENM_CHANGE flag ORed into the mask.
  588. DataChange();
  589. // TODO: Add your control notification handler code here
  590. }
  591. void TakeControlDlg1::OnSelchangeCombo11()
  592. {
  593. // TODO: Add your control notification handler code here
  594. int pos=m_combobox2.GetCurSel ();
  595. if(pos==-1)return;
  596. m_combobox2.GetLBText (pos, id);
  597. if(g_bAllBranch)
  598. {
  599. m_branch=m_pBranchArray->ElementAt(pos);
  600. GetDlgItem(IDC_EDITtime5)->SetWindowText(m_branch);
  601. }
  602. ClientChange();
  603. }
  604. void TakeControlDlg1::OnButton2()
  605. {
  606. // TODO: Add your control notification handler code here
  607. UpdateData();
  608. SelDress dlg;
  609. dlg.m_sel =m_dress;
  610. if(dlg.DoModal ()==IDOK)
  611. {
  612. m_dress=dlg.m_sel;
  613. UpdateData(0);
  614. }
  615. }