BookingPage4.cpp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. // BookingPage4.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "BookingPage4.h"
  6. #include "Booking2.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // BookingPage4 dialog IDC_STATIC2
  14. BookingPage4::BookingPage4(CWnd* pParent /*=NULL*/)
  15. : CDialog(BookingPage4::IDD, pParent)
  16. {
  17. m_time1 = g_date;
  18. m_time2 = _T("");
  19. m_time3 = _T("");
  20. m_time4 = _T("");
  21. m_time5 = _T("");
  22. m_time6 = _T("");
  23. m_check3 = FALSE;
  24. m_time7 = _T("");
  25. m_time10 = _T("");
  26. m_time8 = _T("");
  27. m_time9 = _T("");
  28. m_waiter3_old = _T("");//Jeff add;
  29. //}}AFX_DATA_INIT
  30. }
  31. void BookingPage4::DoDataExchange(CDataExchange* pDX)
  32. {
  33. CDialog::DoDataExchange(pDX);
  34. DDX_Control(pDX, IDC_EDITtime9, m_datectrl9);
  35. DDX_Control(pDX, IDC_EDITtime88, m_datectrl8);
  36. DDX_Control(pDX, IDC_EDITtime10, m_datectrl10);
  37. DDX_Control(pDX, IDC_COMBOwaiter14, m_combowaiter14);
  38. DDX_Control(pDX, IDC_COMBOwaiter13, m_combowaiter13);
  39. DDX_Control(pDX, IDC_COMBOwaiter12, m_combowaiter12);
  40. DDX_Control(pDX, IDC_EDITtime7, m_datectrl7);
  41. DDX_Control(pDX, IDC_EDITtime6, m_datectrl6);
  42. DDX_Control(pDX, IDC_EDITtime5, m_datectrl5);
  43. DDX_Control(pDX, IDC_EDITtime4, m_m_datectrl4);
  44. DDX_Control(pDX, IDC_EDITtime3, m_datectrl3);
  45. DDX_Control(pDX, IDC_EDITtime2, m_datectrl2);
  46. DDX_Control(pDX, IDC_COMBOwaiter9, m_combowaiter8);
  47. DDX_Control(pDX, IDC_COMBOwaiter7, m_combowaiter7);
  48. DDX_Control(pDX, IDC_COMBOwaiter5, m_combowaiter5);
  49. DDX_Control(pDX, IDC_COMBOwaiter4, m_combowaiter4);
  50. DDX_Control(pDX, IDC_COMBOwaiter3, m_combowaiter3);
  51. DDX_Control(pDX, IDC_COMBOwaiter2, m_combowaiter2);
  52. DDX_Control(pDX, IDC_COMBOwaiter1, m_combowaiter1);
  53. DDX_Control(pDX, IDC_COMBOstatus7, m_combostatus8);
  54. DDX_Control(pDX, IDC_COMBOstatus5, m_combostatus5);
  55. DDX_Control(pDX, IDC_COMBOstatus6, m_combostatus6);
  56. DDX_Control(pDX, IDC_COMBOstatus4, m_combostatus4);
  57. DDX_Control(pDX, IDC_COMBOstatus3, m_combostatus3);
  58. DDX_Control(pDX, IDC_COMBOstatus2, m_combostatus2);
  59. DDX_Control(pDX, IDC_COMBOstatus1, m_combostatus1);
  60. DDX_Text(pDX, IDC_EDITtime1, m_time1);
  61. DDX_Text(pDX, IDC_EDITtime2, m_time2);
  62. DDX_Text(pDX, IDC_EDITtime3, m_time3);
  63. DDX_Text(pDX, IDC_EDITtime4, m_time4);
  64. DDX_Text(pDX, IDC_EDITtime5, m_time5);
  65. DDX_Text(pDX, IDC_EDITtime6, m_time6);
  66. DDX_Check(pDX, IDC_CHECK5, m_check3);
  67. DDX_Text(pDX, IDC_EDITtime7, m_time7);
  68. DDX_Text(pDX, IDC_EDITtime10, m_time10);
  69. DDX_Text(pDX, IDC_EDITtime88, m_time8);
  70. DDX_Text(pDX, IDC_EDITtime9, m_time9);
  71. //}}AFX_DATA_MAP
  72. }
  73. BEGIN_MESSAGE_MAP(BookingPage4, CDialog)
  74. //{{AFX_MSG_MAP(BookingPage4)
  75. //}}AFX_MSG_MAP
  76. END_MESSAGE_MAP()
  77. /////////////////////////////////////////////////////////////////////////////
  78. // BookingPage4 message handlers
  79. void BookingPage4::OnOK()
  80. {
  81. // TODO: Add extra validation here
  82. }
  83. void BookingPage4::OnCancel()
  84. {
  85. // TODO: Add extra cleanup her
  86. }
  87. extern BOOL CALLBACK EnumChildProc3(HWND hwnd,LPARAM lParam);
  88. BOOL BookingPage4::OnInitDialog()
  89. {
  90. CDialog::OnInitDialog();
  91. m_time2old=m_time2;
  92. m_time4old=m_time4;
  93. m_time5old=m_time5;
  94. m_time6old=m_time6;
  95. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(121)) && ((Booking2*)GetParent())->m_bModify==0)
  96. {
  97. ((CEdit*)GetDlgItem(IDC_EDITtime1))->SetReadOnly (0);
  98. }
  99. // TODO: Add extra initialization here
  100. #ifdef LYFZ_VERSION
  101. GetDlgItem(IDC_STATIC3)->SetWindowText("年服务费日期:");
  102. m_combostatus5.EnableWindow(0);
  103. #endif
  104. #ifndef LKAY_VERSION
  105. GetDlgItem(IDC_STATIC12)->ShowWindow (0);
  106. GetDlgItem(IDC_STATIC16)->ShowWindow (0);
  107. GetDlgItem(IDC_STATIC24)->ShowWindow (0);
  108. GetDlgItem(IDC_STATIC25)->ShowWindow (0);
  109. GetDlgItem(IDC_EDITtime7)->ShowWindow (0);
  110. GetDlgItem(IDC_COMBOwaiter12)->ShowWindow (0);
  111. GetDlgItem(IDC_COMBOwaiter13)->ShowWindow (0);
  112. GetDlgItem(IDC_COMBOwaiter14)->ShowWindow (0);
  113. #endif
  114. CRect rc2;
  115. GetWindowRect(rc2);
  116. MoveWindow(m_rc);
  117. g_WidthScale2 = (float)m_rc.Width()/(float)rc2.Width(); // new/Old
  118. g_HeightScale2 = (float)m_rc.Height()/(float)rc2.Height();
  119. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc3,0);
  120. m_combowaiter1.RefDroppedWidth();
  121. m_combowaiter2.RefDroppedWidth();
  122. m_combowaiter3.RefDroppedWidth();
  123. m_combowaiter4.RefDroppedWidth();
  124. m_combowaiter5.RefDroppedWidth();
  125. m_combowaiter7.RefDroppedWidth();
  126. m_combowaiter8.RefDroppedWidth(); // add by Jeff 2014.05.23
  127. m_combowaiter12.RefDroppedWidth();
  128. m_combowaiter13.RefDroppedWidth();
  129. m_combowaiter14.RefDroppedWidth();
  130. #ifndef CHILD_VERSION
  131. GetDlgItem(IDC_STATIC2)->SetWindowText("化妆师:");
  132. #endif
  133. /* m_combowaiter1.AddString ("");
  134. m_combowaiter2.AddString ("");
  135. m_combowaiter3.AddString ("");
  136. m_combowaiter4.AddString ("");
  137. m_combowaiter5.AddString ("");
  138. m_combowaiter7.AddString ("");
  139. for(int i=0; i<g_userarray.GetSize (); i++)
  140. {
  141. m_combowaiter1.AddString (g_userarray.ElementAt (i).ElementAt (1));
  142. m_combowaiter2.AddString (g_userarray.ElementAt (i).ElementAt (1));
  143. m_combowaiter3.AddString (g_userarray.ElementAt (i).ElementAt (1));
  144. m_combowaiter4.AddString (g_userarray.ElementAt (i).ElementAt (1));
  145. m_combowaiter5.AddString (g_userarray.ElementAt (i).ElementAt (1));
  146. m_combowaiter7.AddString (g_userarray.ElementAt (i).ElementAt (1));
  147. m_combowaiter12.AddString (g_userarray.ElementAt (i).ElementAt (1));
  148. m_combowaiter13.AddString (g_userarray.ElementAt (i).ElementAt (1));
  149. m_combowaiter14.AddString (g_userarray.ElementAt (i).ElementAt (1));
  150. }*/
  151. m_combostatus1.AddString ("未拍");
  152. m_combostatus1.AddString ("拍摄中");
  153. m_combostatus1.AddString ("OK");
  154. m_combostatus2.AddString ("未选");
  155. m_combostatus2.AddString ("OK");
  156. m_combostatus3.AddString ("未取");
  157. m_combostatus3.AddString ("OK");
  158. m_combostatus4.AddString ("未修");
  159. m_combostatus4.AddString ("修片中");
  160. m_combostatus4.AddString ("OK");
  161. m_combostatus5.AddString ("未设计");
  162. m_combostatus5.AddString ("设计中");
  163. m_combostatus5.AddString ("OK");
  164. m_combostatus6.AddString ("未修");
  165. m_combostatus6.AddString ("修片中");
  166. m_combostatus6.AddString ("OK");
  167. // add by Jeff 2014.05.23
  168. m_combostatus8.AddString ("未看");
  169. m_combostatus8.AddString ("修改中");
  170. m_combostatus8.AddString ("OK");
  171. if(((Booking2*)GetParent())->m_bModify) //订单报表 - 预约单-修改;
  172. {
  173. if ( m_status1 == "OK") // Jeff add:2014.07.02,若拍照状态OK,禁用三个控件;
  174. {
  175. GetDlgItem(IDC_EDITtime2)->EnableWindow(FALSE); // 禁用拍照日期;
  176. GetDlgItem(IDC_COMBOwaiter1)->EnableWindow(FALSE); // 禁用摄影师;
  177. GetDlgItem(IDC_COMBOstatus1)->EnableWindow(FALSE); // 禁用拍照状态;
  178. }
  179. if ( m_status2 == "OK")
  180. {
  181. GetDlgItem(IDC_EDITtime4)->EnableWindow(FALSE); // 禁用选片日期;
  182. GetDlgItem(IDC_COMBOwaiter3)->EnableWindow(FALSE); // 禁用选片人;
  183. GetDlgItem(IDC_COMBOstatus2)->EnableWindow(FALSE); // 禁用选片状态;
  184. }
  185. m_combostatus1.SetCurSel (m_combostatus1.FindString (0, m_status1));
  186. m_combostatus2.SetCurSel (m_combostatus2.FindString (0, m_status2));
  187. m_combostatus3.SetCurSel (m_combostatus3.FindString (0, m_status3));
  188. m_combostatus4.SetCurSel (m_combostatus4.FindString (0, m_status4));
  189. m_combostatus5.SetCurSel (m_combostatus5.FindString (0, m_status5));
  190. m_combostatus6.SetCurSel (m_combostatus6.FindString (0, m_status6));
  191. m_combostatus8.SetCurSel (m_combostatus8.FindString (0, m_status8)); // add by Jeff
  192. if(m_combowaiter1.FindString (0, m_waiter1)==-1)
  193. m_combowaiter1.AddString (m_waiter1);
  194. if(m_combowaiter2.FindString (0, m_waiter2)==-1)
  195. m_combowaiter2.AddString (m_waiter2);
  196. if(m_combowaiter3.FindString (0, m_waiter3)==-1)
  197. m_combowaiter3.AddString (m_waiter3);
  198. if(m_combowaiter4.FindString (0, m_waiter4)==-1)
  199. m_combowaiter4.AddString (m_waiter4);
  200. if(m_combowaiter5.FindString (0, m_waiter5)==-1)
  201. m_combowaiter5.AddString (m_waiter5);
  202. if(m_combowaiter7.FindString (0, m_waiter7)==-1)
  203. m_combowaiter7.AddString (m_waiter7);
  204. // add by Jeff
  205. if(m_combowaiter8.FindString (0, m_waiter8)==-1)
  206. m_combowaiter8.AddString (m_waiter8);
  207. m_combowaiter1.SetCurSel (m_combowaiter1.FindString (0, m_waiter1));
  208. m_combowaiter2.SetCurSel (m_combowaiter2.FindString (0, m_waiter2));
  209. m_combowaiter3.SetCurSel (m_combowaiter3.FindString (0, m_waiter3));
  210. m_combowaiter4.SetCurSel (m_combowaiter4.FindString (0, m_waiter4));
  211. m_combowaiter5.SetCurSel (m_combowaiter5.FindString (0, m_waiter5));
  212. m_combowaiter7.SetCurSel (m_combowaiter7.FindString (0, m_waiter7));
  213. // add by Jeff
  214. m_combowaiter8.SetCurSel (m_combowaiter8.FindString (0, m_waiter8));
  215. m_waiter3_old = m_waiter3;//Jeff add;
  216. #ifdef LKAY_VERSION
  217. if(m_combowaiter12.FindString (0, m_waiter12)==-1)
  218. m_combowaiter12.AddString (m_waiter12);
  219. m_combowaiter12.SetCurSel (m_combowaiter12.FindString (0, m_waiter12));
  220. if(m_combowaiter13.FindString (0, m_waiter13)==-1)
  221. m_combowaiter13.AddString (m_waiter13);
  222. m_combowaiter13.SetCurSel (m_combowaiter13.FindString (0, m_waiter13));
  223. if(m_combowaiter14.FindString (0, m_waiter14)==-1)
  224. m_combowaiter14.AddString (m_waiter14);
  225. m_combowaiter14.SetCurSel (m_combowaiter14.FindString (0, m_waiter14));
  226. #endif
  227. }
  228. #ifdef CHILD_VERSION
  229. GetDlgItem(IDC_CHECK5)->ShowWindow(0);
  230. GetDlgItem(IDC_STATIC1)->ShowWindow(0);
  231. GetDlgItem(IDC_EDITtime3)->ShowWindow(0);
  232. #endif
  233. #ifdef LYFZ_VERSION
  234. GetDlgItem(IDC_STATIC10)->SetWindowText("一次上门:");
  235. GetDlgItem(IDC_STATIC2)->SetWindowText("二次上门:");
  236. GetDlgItem(IDC_STATIC11)->SetWindowText("三次上门:");
  237. GetDlgItem(IDC_STATIC13)->SetWindowText("回访:");
  238. GetDlgItem(IDC_STATIC15)->SetWindowText("一次上门:");
  239. GetDlgItem(IDC_STATIC17)->SetWindowText("二次上门:");
  240. GetDlgItem(IDC_STATIC18)->SetWindowText("三次上门:");
  241. GetDlgItem(IDC_STATIC19)->SetWindowText("回访:");
  242. #endif
  243. return TRUE; // return TRUE unless you set the focus to a control
  244. // EXCEPTION: OCX Property Pages should return FALSE
  245. }
  246. BOOL BookingPage4::CheckOK()
  247. {
  248. UpdateData();
  249. if(!CheckDateOK(m_time1))return 0;
  250. if(!CheckDateOK(m_time2))return 0;
  251. if(!CheckDateOK(m_time3))return 0;
  252. if(!CheckDateOK(m_time4))return 0;
  253. if(!CheckDateOK(m_time5))return 0;
  254. if(!CheckDateOK(m_time6))return 0;
  255. if(!CheckDateOK(m_time8))return 0;
  256. if(!CheckDateOK(m_time9))return 0;
  257. if(!CheckDateOK(m_time10))return 0;
  258. int pos=m_combowaiter1.GetCurSel ();
  259. if(pos!=-1)
  260. {
  261. m_combowaiter1.GetLBText (pos, m_waiter1);
  262. }
  263. pos=m_combowaiter2.GetCurSel ();
  264. if(pos!=-1)
  265. {
  266. m_combowaiter2.GetLBText (pos, m_waiter2);
  267. }
  268. pos=m_combowaiter3.GetCurSel ();
  269. if(pos!=-1)
  270. {
  271. m_combowaiter3.GetLBText (pos, m_waiter3);
  272. }
  273. pos=m_combowaiter4.GetCurSel ();
  274. if(pos!=-1)
  275. {
  276. m_combowaiter4.GetLBText (pos, m_waiter4);
  277. }
  278. pos=m_combowaiter5.GetCurSel ();
  279. if(pos!=-1)
  280. {
  281. m_combowaiter5.GetLBText (pos, m_waiter5);
  282. }
  283. pos=m_combowaiter7.GetCurSel ();
  284. if(pos!=-1)
  285. {
  286. m_combowaiter7.GetLBText (pos, m_waiter7);
  287. }
  288. pos=m_combowaiter8.GetCurSel ();
  289. if(pos!=-1)
  290. {
  291. m_combowaiter8.GetLBText (pos, m_waiter8);
  292. }
  293. #ifdef LKAY_VERSION
  294. pos=m_combowaiter12.GetCurSel ();
  295. if(pos!=-1)
  296. {
  297. m_combowaiter12.GetLBText (pos, m_waiter12);
  298. }
  299. pos=m_combowaiter13.GetCurSel ();
  300. if(pos!=-1)
  301. {
  302. m_combowaiter13.GetLBText (pos, m_waiter13);
  303. }
  304. pos=m_combowaiter14.GetCurSel ();
  305. if(pos!=-1)
  306. {
  307. m_combowaiter14.GetLBText (pos, m_waiter14);
  308. }
  309. #endif
  310. pos=m_combostatus1.GetCurSel ();
  311. if(pos!=-1)
  312. {
  313. m_combostatus1.GetLBText (pos, m_status1);
  314. }
  315. pos=m_combostatus2.GetCurSel ();
  316. if(pos!=-1)
  317. {
  318. m_combostatus2.GetLBText (pos, m_status2);
  319. }
  320. pos=m_combostatus3.GetCurSel ();
  321. if(pos!=-1)
  322. {
  323. m_combostatus3.GetLBText (pos, m_status3);
  324. }
  325. pos=m_combostatus4.GetCurSel ();
  326. if(pos!=-1)
  327. {
  328. m_combostatus4.GetLBText (pos, m_status4);
  329. }
  330. pos=m_combostatus5.GetCurSel ();
  331. if(pos!=-1)
  332. {
  333. m_combostatus5.GetLBText (pos, m_status5);
  334. }
  335. pos=m_combostatus6.GetCurSel ();
  336. if(pos!=-1)
  337. {
  338. m_combostatus6.GetLBText (pos, m_status6);
  339. }
  340. pos=m_combostatus8.GetCurSel ();
  341. if(pos!=-1)
  342. {
  343. m_combostatus8.GetLBText (pos, m_status8);
  344. }
  345. if(m_status1.IsEmpty())m_status1="未拍";
  346. if(m_status2.IsEmpty())m_status2="未选";
  347. if(m_status3.IsEmpty())m_status3="未取";
  348. if(m_status4.IsEmpty())m_status4="未修";
  349. if(m_status5.IsEmpty())m_status5="未设计";
  350. if(m_status6.IsEmpty())m_status6="未修";
  351. if(m_status6.IsEmpty())m_status6="未看";
  352. if(m_status3=="OK" && m_time5=="")
  353. {
  354. AfxMessageBox("已取件的单请录入取件日期!", MB_ICONINFORMATION);
  355. return 0;
  356. }
  357. return 1;
  358. }
  359. void BookingPage4::NewDan()
  360. {
  361. m_time2 = _T("");
  362. m_time3 = _T("");
  363. m_time4 = _T("");
  364. m_time5 = _T("");
  365. m_time6 = _T("");
  366. UpdateData(0);
  367. m_combowaiter1.SetCurSel (-1);
  368. m_combowaiter2.SetCurSel (-1);
  369. m_combowaiter3.SetCurSel (-1);
  370. m_combowaiter4.SetCurSel (-1);
  371. m_combowaiter5.SetCurSel (-1);
  372. m_combowaiter7.SetCurSel (-1);
  373. m_combowaiter8.SetCurSel (-1);
  374. m_combostatus1.SetCurSel (-1);
  375. m_combostatus2.SetCurSel (-1);
  376. m_combostatus3.SetCurSel (-1);
  377. m_combostatus4.SetCurSel (-1);
  378. m_combostatus5.SetCurSel (-1);
  379. m_combostatus6.SetCurSel (-1);
  380. m_combostatus8.SetCurSel (-1);
  381. }