TodayForm2.cpp 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818
  1. // TodayForm2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "TodayForm2.h"
  6. #include "MyMdi.H"
  7. #include "TakeControlDlg1.h"
  8. #include "TakeControlDlg2.h"
  9. #include "TakeControlDlg3.h"
  10. #include "TakeControlDlg4.h"
  11. #include "TakeControlDlg9.h"
  12. #include "SendMsgDlg.h"
  13. #include "SearchTake.h"
  14. #include "ChooseDesignSkin.h"
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20. extern CTime g_todaytm;
  21. extern int g_todayradio;
  22. extern int g_todaycheck;
  23. /////////////////////////////////////////////////////////////////////////////
  24. // TodayForm2 IDC_STATIC2
  25. IMPLEMENT_DYNCREATE(TodayForm2, MyFormView)
  26. TodayForm2::TodayForm2()
  27. : MyFormView(TodayForm2::IDD)
  28. {
  29. //{{AFX_DATA_INIT(TodayForm2)
  30. m_radio = g_todayradio;
  31. m_check = FALSE;
  32. m_check2 = FALSE;
  33. m_nscrollpos = 0;
  34. //}}AFX_DATA_INIT
  35. m_mode = 0;
  36. m_year = g_todaytm.GetYear();
  37. m_month = g_todaytm.GetMonth();
  38. m_day = g_todaytm.GetDay();
  39. m_bInit = 0;
  40. if (g_todaycheck == 1)
  41. m_check = 1;
  42. else if (g_todaycheck == 2)
  43. m_check2 = 1;
  44. }
  45. TodayForm2::~TodayForm2()
  46. {
  47. }
  48. void TodayForm2::DoDataExchange(CDataExchange* pDX)
  49. {
  50. MyFormView::DoDataExchange(pDX);
  51. //{{AFX_DATA_MAP(TodayForm2)
  52. DDX_Control(pDX, IDC_COMBO6, m_combo1);
  53. DDX_Control(pDX, IDC_SCROLLBAR1, m_scrollbar);
  54. DDX_Control(pDX, IDC_LIST10, m_List6);
  55. DDX_Control(pDX, IDC_LIST8, m_List5);
  56. DDX_Control(pDX, IDC_LIST7, m_List4);
  57. DDX_Control(pDX, IDC_LIST4, m_List3);
  58. DDX_Control(pDX, IDC_LIST3, m_List2);
  59. DDX_Control(pDX, IDC_LIST2, m_List1);
  60. DDX_Control(pDX, IDC_SPIN3, m_spinday);
  61. DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
  62. DDX_Control(pDX, IDC_SPIN1, m_spinyear);
  63. DDX_Control(pDX, IDC_STATIC1, m_static1);
  64. DDX_Text(pDX, IDC_EDITyear, m_year);
  65. DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
  66. DDX_Text(pDX, IDC_EDITmonth, m_month);
  67. DDV_MinMaxUInt(pDX, m_month, 1, 12);
  68. DDX_Text(pDX, IDC_EDITday, m_day);
  69. DDV_MinMaxUInt(pDX, m_day, 1, 31);
  70. DDX_Radio(pDX, IDC_RADIO3, m_radio);
  71. DDX_Check(pDX, IDC_CHECK1, m_check);
  72. DDX_Check(pDX, IDC_CHECK2, m_check2);
  73. DDX_Scroll(pDX, IDC_SCROLLBAR1, m_nscrollpos);
  74. //}}AFX_DATA_MAP
  75. }
  76. BEGIN_MESSAGE_MAP(TodayForm2, MyFormView)
  77. //{{AFX_MSG_MAP(TodayForm2)
  78. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  79. ON_BN_CLICKED(IDC_BUTtake, OnBUTtake)
  80. ON_BN_CLICKED(IDC_BUTchoose, OnBUTchoose)
  81. ON_BN_CLICKED(IDC_BUTtakeaway, OnBUTtakeaway)
  82. ON_BN_CLICKED(IDC_BUTall, OnBUTall)
  83. ON_BN_CLICKED(IDC_BUTchoose3, OnBUTchoose3)
  84. ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  85. ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
  86. ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
  87. ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
  88. ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
  89. ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
  90. ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
  91. ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
  92. ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
  93. ON_BN_CLICKED(IDC_BUTmsg, OnBUTmsg)
  94. ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
  95. ON_BN_CLICKED(IDC_BUTtake3, OnBUTtake3)
  96. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  97. ON_NOTIFY(NM_CLICK, IDC_LIST3, OnClickList3)
  98. ON_NOTIFY(NM_CLICK, IDC_LIST4, OnClickList4)
  99. ON_NOTIFY(NM_CLICK, IDC_LIST7, OnClickList7)
  100. ON_NOTIFY(NM_CLICK, IDC_LIST8, OnClickList8)
  101. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  102. ON_NOTIFY(NM_DBLCLK, IDC_LIST3, OnDblclkList3)
  103. ON_NOTIFY(NM_DBLCLK, IDC_LIST4, OnDblclkList4)
  104. ON_NOTIFY(NM_DBLCLK, IDC_LIST7, OnDblclkList7)
  105. ON_BN_CLICKED(IDC_RADIO8, OnRadio8)
  106. ON_NOTIFY(NM_CLICK, IDC_LIST10, OnClickList10)
  107. ON_WM_VSCROLL()
  108. ON_WM_MOUSEWHEEL()
  109. //}}AFX_MSG_MAP
  110. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST7, OnCustomdrawList4)
  111. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST4, OnCustomdrawList3)
  112. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList1)
  113. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST3, OnCustomdrawList2)
  114. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST8, OnCustomdrawList5)
  115. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST10, OnCustomdrawList6)
  116. END_MESSAGE_MAP()
  117. /////////////////////////////////////////////////////////////////////////////
  118. // TodayForm2 diagnostics
  119. #ifdef _DEBUG
  120. void TodayForm2::AssertValid() const
  121. {
  122. MyFormView::AssertValid();
  123. }
  124. void TodayForm2::Dump(CDumpContext& dc) const
  125. {
  126. MyFormView::Dump(dc);
  127. }
  128. #endif //_DEBUG
  129. /////////////////////////////////////////////////////////////////////////////
  130. // TodayForm2 message handlers
  131. void TodayForm2::OnInitialUpdate()
  132. {
  133. MyFormView::OnInitialUpdate();
  134. m_List5.m_bSortSupport = 0;
  135. m_List2.ShowWindow(SW_HIDE);
  136. m_List3.ShowWindow(SW_HIDE);
  137. m_List4.ShowWindow(SW_HIDE);
  138. m_List5.ShowWindow(SW_HIDE);
  139. m_List6.ShowWindow(SW_HIDE);
  140. // TODO: Add your specialized code here and/or call the base class
  141. GetDlgItem(IDC_BUTtake)->EnableWindow(IsHasRights2new(2));
  142. GetDlgItem(IDC_BUTtake3)->EnableWindow(IsHasRights2new(2));
  143. GetDlgItem(IDC_BUTchoose)->EnableWindow(IsHasRights2new(2));
  144. CMyMdi Mdi;
  145. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  146. // Here we create the outbar control using the splitter as its parent
  147. // and setting its id to the first pane.
  148. CRect rc2;
  149. GetWindowRect(rc2);
  150. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  151. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  152. int idarray[] = { IDC_BUTtake3, IDC_BUTtake, IDC_BUTchoose, IDC_BUTmsg, IDC_BUTclose };
  153. int idcount = 5;
  154. int btnwid;
  155. CRect prerc;
  156. for (int a = idcount - 2; a >= 0; a--)
  157. {
  158. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  159. ScreenToClient(prerc);
  160. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  161. ScreenToClient(rc2);
  162. btnwid = rc2.Width();
  163. rc2.right = prerc.left;
  164. rc2.left = rc2.right - btnwid;
  165. GetDlgItem(idarray[a])->MoveWindow(rc2);
  166. }
  167. m_spinyear.SetRange(1900, 3000);
  168. m_spinmonth.SetRange(1, 12);
  169. m_spinday.SetRange(1, 31);
  170. m_static1.SetFont(&g_titlefont);
  171. #ifdef CHILD_VERSION
  172. GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
  173. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;景点,100;拍照日期,100;时间,100;摄影师,100;化妆师,100;状态,100;接单人,100;套系名称,100;套系价格,100");
  174. m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;接单人,100;套系名称,100;套系价格,100");
  175. m_List3.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;接单人,100;套系名称,100;套系价格,100");
  176. m_List4.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;接单人,100;套系名称,100;套系价格,100");
  177. #else
  178. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;景点,100;拍照日期,100;时间,100;婚期,100;摄影师,100;化妆师,100;状态,100;接单人,100;套系名称,100;套系价格,100" );
  179. m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;接单人,100;套系名称,100;套系价格,100" );
  180. m_List3.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;接单人,100;套系名称,100;套系价格,100" );
  181. m_List4.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;接单人,100;套系名称,100;套系价格,100" );
  182. m_List5.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚庆内容,100;婚庆日期,100;时间,100;婚期,100;摄影师,100;化妆师,100;接单人,100;套系名称,100;套系价格,100" );
  183. m_List5.LoadColumnInfo (172);
  184. #endif
  185. #ifdef CHILD_VERSION
  186. m_List6.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
  187. #else
  188. m_List6.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
  189. #endif
  190. m_List6.LoadColumnInfo(169);
  191. m_List1.LoadColumnInfo(110);
  192. m_List2.LoadColumnInfo(161);
  193. m_List3.LoadColumnInfo(162);
  194. m_List4.LoadColumnInfo(163);
  195. m_List1.ShowWindow(0);
  196. m_List1.GetWindowRect(rc2);
  197. ScreenToClient(rc2);
  198. m_childdlg.Create(IDD_DLGTodayFormChild, this);
  199. rc2.right -= 20;
  200. CRect rc = rc2;
  201. rc2.top += 30;
  202. rc2.bottom += 256 * 19 - 30;
  203. m_childdlg.List1array = &m_List1array;
  204. m_childdlg.pClientarray = &m_Clientarray;
  205. m_childdlg.pTxtypearray = &m_Txtypearray;
  206. m_childdlg.MoveWindow(rc2);
  207. m_childdlg.ShowWindow(SW_SHOW);
  208. m_bInit = 1;
  209. DateChange();
  210. rc2.top -= 30;
  211. rc2.right += 20;
  212. rc2.left = rc2.right - 20; rc2.bottom -= 256 * 19 - 30;
  213. m_scrollbar.MoveWindow(rc2);
  214. rc.bottom = rc.top + 30;
  215. m_table.Create(rc, this, WS_HSCROLL);
  216. m_table.m_bFocusFrame = 0;
  217. m_table.Test2();
  218. m_page = rc2.Height() - 40;
  219. m_scrollbar.SetScrollRange(0, 256 * 20);
  220. m_scrollbar.SetScrollPos(0);
  221. if (m_radio == 0 || m_radio == 1 || m_radio == 2 || m_radio == 3 || m_radio == 4)
  222. {
  223. m_childdlg.m_table.ModeChange(m_radio);
  224. m_table.ModeChange(m_radio);
  225. m_table.Test2();
  226. m_table.ShowWindow(SW_SHOW);
  227. m_childdlg.ShowWindow(SW_SHOW);
  228. m_combo1.m_mode = 1;
  229. m_combo1.m_pMsgParent = &(m_childdlg.m_table);
  230. m_childdlg.m_table.m_pComboBox = &m_combo1;
  231. m_scrollbar.ShowWindow(SW_SHOW);
  232. GetDlgItem(IDC_BUTtake3)->ShowWindow(SW_HIDE);
  233. GetDlgItem(IDC_BUTtake)->ShowWindow(SW_HIDE);
  234. GetDlgItem(IDC_BUTchoose)->SetWindowText("另约日期");
  235. GetDlgItem(IDC_BUTmsg)->SetWindowText("删除");
  236. GetDlgItem(IDC_BUTchoose)->Invalidate();
  237. GetDlgItem(IDC_BUTmsg)->Invalidate();
  238. }
  239. else
  240. {
  241. m_table.ShowWindow(SW_HIDE);
  242. m_childdlg.ShowWindow(SW_HIDE);
  243. m_scrollbar.ShowWindow(SW_HIDE);
  244. // GetDlgItem(IDC_BUTtake3)->ShowWindow(SW_SHOW);
  245. // GetDlgItem(IDC_BUTtake)->ShowWindow(SW_SHOW);
  246. // GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排");
  247. // GetDlgItem(IDC_BUTmsg)->SetWindowText("发送短信");
  248. GetDlgItem(IDC_BUTchoose)->Invalidate();
  249. GetDlgItem(IDC_BUTmsg)->Invalidate();
  250. }
  251. }
  252. void TodayForm2::FillGrid()
  253. {
  254. UpdateData();
  255. int ii = 0;
  256. if (m_radio == 0)
  257. {
  258. // m_List1.ShowWindow (SW_SHOW);
  259. m_List2.ShowWindow(SW_HIDE);
  260. m_List3.ShowWindow(SW_HIDE);
  261. m_List4.ShowWindow(SW_HIDE);
  262. m_List5.ShowWindow(SW_HIDE);
  263. m_List6.ShowWindow(SW_HIDE);
  264. return;
  265. m_List1.DeleteAllItems2();
  266. m_datearray1.RemoveAll();
  267. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  268. int count = 0;
  269. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  270. {
  271. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  272. if (::FindArray(&m_datearray1, m_List1array.ElementAt(ii).ElementAt(6)) == -1)
  273. m_datearray1.Add(m_List1array.ElementAt(ii).ElementAt(6));
  274. }
  275. m_List1.m_arLabels.SetSize(count, 1);
  276. ii = count;
  277. m_List1.m_LabelCount = ii;
  278. m_List1.SetItemCountEx(ii);
  279. }
  280. else if (m_radio == 1)
  281. {
  282. // m_List2.ShowWindow (SW_SHOW);
  283. m_List1.ShowWindow(SW_HIDE);
  284. m_List3.ShowWindow(SW_HIDE);
  285. m_List4.ShowWindow(SW_HIDE);
  286. m_List5.ShowWindow(SW_HIDE);
  287. m_List6.ShowWindow(SW_HIDE);
  288. return;
  289. m_List2.DeleteAllItems2(); m_datearray2.RemoveAll();
  290. m_List2.m_arLabels.SetSize(m_List2array.GetSize(), 1);
  291. int count = 0;
  292. for (ii = 0; ii < m_List2.m_arLabels.GetSize(); ii++)
  293. {
  294. m_List2.m_arLabels.ElementAt(count++).Copy(m_List2array.ElementAt(ii));
  295. if (::FindArray(&m_datearray2, m_List2array.ElementAt(ii).ElementAt(5)) == -1)
  296. m_datearray2.Add(m_List2array.ElementAt(ii).ElementAt(5));
  297. }
  298. m_List2.m_arLabels.SetSize(count, 1);
  299. ii = count;
  300. m_List2.m_LabelCount = ii;
  301. m_List2.SetItemCountEx(ii);
  302. }
  303. else if (m_radio == 2)
  304. {
  305. // m_List3.ShowWindow (SW_SHOW);
  306. m_List2.ShowWindow(SW_HIDE);
  307. m_List1.ShowWindow(SW_HIDE);
  308. m_List4.ShowWindow(SW_HIDE);
  309. m_List5.ShowWindow(SW_HIDE);
  310. m_List6.ShowWindow(SW_HIDE); return;
  311. m_List3.DeleteAllItems2(); m_datearray3.RemoveAll();
  312. m_List3.m_arLabels.SetSize(m_List3array.GetSize(), 1);
  313. int count = 0;
  314. for (ii = 0; ii < m_List3.m_arLabels.GetSize(); ii++)
  315. {
  316. m_List3.m_arLabels.ElementAt(count++).Copy(m_List3array.ElementAt(ii));
  317. if (::FindArray(&m_datearray3, m_List3array.ElementAt(ii).ElementAt(5)) == -1)
  318. m_datearray3.Add(m_List3array.ElementAt(ii).ElementAt(5));
  319. }
  320. m_List3.m_arLabels.SetSize(count, 1);
  321. ii = count;
  322. m_List3.m_LabelCount = ii;
  323. m_List3.SetItemCountEx(ii);
  324. }
  325. else if (m_radio == 3)
  326. {
  327. // m_List4.ShowWindow (SW_SHOW);
  328. m_List2.ShowWindow(SW_HIDE);
  329. m_List3.ShowWindow(SW_HIDE);
  330. m_List1.ShowWindow(SW_HIDE);
  331. m_List5.ShowWindow(SW_HIDE);
  332. m_List6.ShowWindow(SW_HIDE); return;
  333. m_List4.DeleteAllItems2(); m_datearray4.RemoveAll();
  334. m_List4.m_arLabels.SetSize(m_List4array.GetSize(), 1);
  335. int count = 0;
  336. for (ii = 0; ii < m_List4.m_arLabels.GetSize(); ii++)
  337. {
  338. m_List4.m_arLabels.ElementAt(count++).Copy(m_List4array.ElementAt(ii));
  339. if (::FindArray(&m_datearray4, m_List4array.ElementAt(ii).ElementAt(5)) == -1)
  340. m_datearray4.Add(m_List4array.ElementAt(ii).ElementAt(5));
  341. }
  342. m_List4.m_arLabels.SetSize(count, 1);
  343. ii = count;
  344. m_List4.m_LabelCount = ii;
  345. m_List4.SetItemCountEx(ii);
  346. }
  347. else if (m_radio == 4)
  348. {
  349. // m_List5.ShowWindow (SW_SHOW);
  350. m_List2.ShowWindow(SW_HIDE);
  351. m_List3.ShowWindow(SW_HIDE);
  352. m_List4.ShowWindow(SW_HIDE);
  353. m_List1.ShowWindow(SW_HIDE);
  354. m_List6.ShowWindow(SW_HIDE); return;
  355. m_List5.DeleteAllItems2(); m_datearray5.RemoveAll();
  356. m_List5.m_arLabels.SetSize(m_List5array.GetSize(), 1);
  357. int count = 0;
  358. for (ii = 0; ii < m_List5.m_arLabels.GetSize(); ii++)
  359. {
  360. m_List5.m_arLabels.ElementAt(count++).Copy(m_List5array.ElementAt(ii));
  361. if (::FindArray(&m_datearray5, m_List5array.ElementAt(ii).ElementAt(6)) == -1)
  362. m_datearray5.Add(m_List5array.ElementAt(ii).ElementAt(6));
  363. }
  364. m_List5.m_arLabels.SetSize(count, 1);
  365. ii = count;
  366. m_List5.m_LabelCount = ii;
  367. m_List5.SetItemCountEx(ii);
  368. }
  369. else if (m_radio == 5)
  370. {
  371. m_List6.ShowWindow(SW_SHOW);
  372. m_List2.ShowWindow(SW_HIDE);
  373. m_List3.ShowWindow(SW_HIDE);
  374. m_List4.ShowWindow(SW_HIDE);
  375. m_List1.ShowWindow(SW_HIDE);
  376. m_List5.ShowWindow(SW_HIDE);
  377. m_List6.DeleteAllItems2(); m_datearray6.RemoveAll();
  378. m_List6.m_arLabels.SetSize(m_List6array.GetSize(), 1);
  379. int count = 0;
  380. for (ii = 0; ii < m_List6.m_arLabels.GetSize(); ii++)
  381. {
  382. m_List6.m_arLabels.ElementAt(count++).Copy(m_List6array.ElementAt(ii));
  383. if (::FindArray(&m_datearray6, m_List6array.ElementAt(ii).ElementAt(9)) == -1)
  384. m_datearray6.Add(m_List6array.ElementAt(ii).ElementAt(9));
  385. }
  386. m_List6.m_arLabels.SetSize(count, 1);
  387. ii = count;
  388. m_List6.m_LabelCount = ii;
  389. m_List6.SetItemCountEx(ii);
  390. }
  391. // CString str;
  392. // str.Format ("单数:%d", ii);
  393. // SetDlgItemText(IDC_STATIC2, str);
  394. }
  395. void TodayForm2::OnBUTclose()
  396. {
  397. // TODO: Add your control notification handler code here
  398. GetParent()->SendMessage(WM_CLOSE);
  399. }
  400. void TodayForm2::OnBUTchoose3() //看设计
  401. {
  402. // TODO: Add your control notification handler code here
  403. m_mode = 3;
  404. FillGrid();
  405. }
  406. void TodayForm2::OnBUTtakeaway()
  407. {
  408. // TODO: Add your control notification handler code here
  409. m_mode = 4;
  410. FillGrid();
  411. /* CRect rc;
  412. m_static1.GetWindowRect (rc);
  413. ScreenToClient(rc);
  414. InvalidateRect(rc);
  415. m_static1.SetWindowText ("今天取件客户");*/
  416. }
  417. void TodayForm2::OnBUTall()
  418. {
  419. // TODO: Add your control notification handler code here
  420. m_mode = 0;
  421. FillGrid();
  422. /* CRect rc;
  423. m_static1.GetWindowRect (rc);
  424. ScreenToClient(rc);
  425. InvalidateRect(rc);
  426. m_static1.SetWindowText ("今拍,今选,今取"); */
  427. }
  428. extern int __cdecl CompareByLabel3(const void *elem1, const void *elem2);
  429. void TodayForm2::DateChange()
  430. {
  431. if (m_bInit == 0)return;
  432. m_spinyear.EnableWindow(0);
  433. m_spinmonth.EnableWindow(0);
  434. m_spinday.EnableWindow(0);
  435. UpdateData();
  436. if (m_radio == 0 || m_radio == 1 || m_radio == 2 || m_radio == 3 || m_radio == 4)
  437. {
  438. m_childdlg.m_table.ModeChange(m_radio);
  439. m_table.ModeChange(m_radio);
  440. m_table.Test2();
  441. m_table.ShowWindow(SW_SHOW);
  442. m_childdlg.ShowWindow(SW_SHOW);
  443. m_scrollbar.ShowWindow(SW_SHOW);
  444. GetDlgItem(IDC_BUTtake3)->ShowWindow(SW_HIDE);
  445. GetDlgItem(IDC_BUTtake)->ShowWindow(SW_HIDE);
  446. GetDlgItem(IDC_BUTchoose)->SetWindowText("另约日期");
  447. GetDlgItem(IDC_BUTmsg)->SetWindowText("删除");
  448. GetDlgItem(IDC_BUTchoose)->Invalidate();
  449. GetDlgItem(IDC_BUTmsg)->Invalidate();
  450. }
  451. else
  452. {
  453. m_table.ShowWindow(SW_HIDE);
  454. m_childdlg.ShowWindow(SW_HIDE);
  455. m_scrollbar.ShowWindow(SW_HIDE);
  456. // GetDlgItem(IDC_BUTtake3)->ShowWindow(SW_SHOW);
  457. // GetDlgItem(IDC_BUTtake)->ShowWindow(SW_SHOW);
  458. // GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排");
  459. // GetDlgItem(IDC_BUTmsg)->SetWindowText("发送短信");
  460. GetDlgItem(IDC_BUTchoose)->Invalidate();
  461. GetDlgItem(IDC_BUTmsg)->Invalidate();
  462. }
  463. if (m_radio == 5)
  464. {
  465. GetDlgItem(IDC_CHECK1)->SetWindowText("近半个月");
  466. GetDlgItem(IDC_CHECK2)->SetWindowText("近一个月");
  467. }
  468. else
  469. {
  470. GetDlgItem(IDC_CHECK1)->SetWindowText("近一个星期");
  471. GetDlgItem(IDC_CHECK2)->SetWindowText("近半个月");
  472. }
  473. // if(m_radio==0)
  474. // GetDlgItem(IDC_BUTtake3)->ShowWindow(1);
  475. // else
  476. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  477. g_todayradio = m_radio;
  478. g_todaycheck = 0;
  479. CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0);
  480. g_todaytm = tm;
  481. CString strdate, strdate2;
  482. strdate.Format("%04d-%02d-%02d", m_year, m_month, m_day);
  483. if (m_check)
  484. {
  485. CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0);
  486. if (m_radio == 5)
  487. tm += CTimeSpan(15, 0, 0, 0);
  488. else
  489. tm += CTimeSpan(7, 0, 0, 0);
  490. strdate2 = tm.Format("%Y-%m-%d");
  491. g_todaycheck = 1;
  492. }
  493. else if (m_check2)
  494. {
  495. CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0);
  496. if (m_radio == 5)
  497. tm += CTimeSpan(31, 0, 0, 0);
  498. else
  499. tm += CTimeSpan(15, 0, 0, 0);
  500. strdate2 = tm.Format("%Y-%m-%d");
  501. g_todaycheck = 2;
  502. }
  503. else
  504. strdate2 = strdate;
  505. COleDateTime dtDay(m_year, m_month, m_day, 0, 0, 0);
  506. int nDayWeek = dtDay.GetDayOfWeek() - 1; //得到星期几,1=Sunday, 2=Monday,
  507. CString DayOfWeek[7] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
  508. CString sdate;
  509. if (nDayWeek >= 0 && nDayWeek <= 6)
  510. sdate = DayOfWeek[nDayWeek];
  511. else
  512. sdate = "无效日期";
  513. //LOG4C((LOG_NOTICE,"TodayForm2:%s,%s",strdate,sdate));
  514. m_static1.SetWindowText(strdate + "(" + sdate + ")小秘书");
  515. if (m_radio == 0)
  516. {
  517. m_List1array.RemoveAll();
  518. g_sendhead.code[0] = 178;
  519. g_sendhead.code[1] = 179;
  520. g_sendhead.code[2] = 157;
  521. g_sendhead.tabcount = 3;
  522. g_sendhead.bsql = 0;
  523. CString sql;
  524. sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='0';;");
  525. g_pMainWnd->ProcessChatMessageRequest2(sql);
  526. if (g_bSendOK == 0)
  527. {
  528. m_childdlg.ShowTable(); return;
  529. }
  530. DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable();
  531. int temp = m_nscrollpos;
  532. int nscrollpos = m_scrollbar.GetScrollPos();
  533. m_nscrollpos = 0;
  534. m_scrollbar.SetScrollPos(m_nscrollpos);
  535. m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
  536. }
  537. else if (m_radio == 1)
  538. {
  539. m_List1array.RemoveAll();
  540. g_sendhead.code[0] = 178;
  541. g_sendhead.code[1] = 179;
  542. g_sendhead.code[2] = 157;
  543. g_sendhead.tabcount = 3;
  544. g_sendhead.bsql = 0;
  545. CString sql;
  546. sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='1';;");
  547. g_pMainWnd->ProcessChatMessageRequest2(sql);
  548. if (g_bSendOK == 0)
  549. {
  550. m_childdlg.ShowTable(); return;
  551. }
  552. DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable();
  553. int temp = m_nscrollpos;
  554. int nscrollpos = m_scrollbar.GetScrollPos();
  555. m_nscrollpos = 0;
  556. m_scrollbar.SetScrollPos(m_nscrollpos);
  557. m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
  558. }
  559. else if (m_radio == 2)
  560. {
  561. m_List1array.RemoveAll();
  562. g_sendhead.code[0] = 178;
  563. g_sendhead.code[1] = 179;
  564. g_sendhead.code[2] = 157;
  565. g_sendhead.tabcount = 3;
  566. g_sendhead.bsql = 0;
  567. CString sql;
  568. sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='2';;");
  569. g_pMainWnd->ProcessChatMessageRequest2(sql);
  570. if (g_bSendOK == 0)
  571. {
  572. m_childdlg.ShowTable(); return;
  573. }
  574. DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable();
  575. int temp = m_nscrollpos;
  576. int nscrollpos = m_scrollbar.GetScrollPos();
  577. m_nscrollpos = 0;
  578. m_scrollbar.SetScrollPos(m_nscrollpos);
  579. m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
  580. }
  581. else if (m_radio == 3)
  582. {
  583. m_List1array.RemoveAll();
  584. g_sendhead.code[0] = 178;
  585. g_sendhead.code[1] = 179;
  586. g_sendhead.code[2] = 157;
  587. g_sendhead.tabcount = 3;
  588. g_sendhead.bsql = 0;
  589. CString sql;
  590. sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='3';;");
  591. g_pMainWnd->ProcessChatMessageRequest2(sql);
  592. if (g_bSendOK == 0)
  593. {
  594. m_childdlg.ShowTable(); return;
  595. }
  596. DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable();
  597. int temp = m_nscrollpos;
  598. int nscrollpos = m_scrollbar.GetScrollPos();
  599. m_nscrollpos = 0;
  600. m_scrollbar.SetScrollPos(m_nscrollpos);
  601. m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
  602. }
  603. else if (m_radio == 4)
  604. {
  605. m_List1array.RemoveAll();
  606. g_sendhead.code[0] = 180;
  607. g_sendhead.code[1] = 179;
  608. g_sendhead.code[2] = 157;
  609. g_sendhead.tabcount = 3;
  610. g_sendhead.bsql = 0;
  611. CString sql;
  612. sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='4';;");
  613. g_pMainWnd->ProcessChatMessageRequest2(sql);
  614. if (g_bSendOK == 0)
  615. {
  616. m_childdlg.ShowTable(); return;
  617. }
  618. DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable();
  619. int temp = m_nscrollpos;
  620. int nscrollpos = m_scrollbar.GetScrollPos();
  621. m_nscrollpos = 0;
  622. m_scrollbar.SetScrollPos(m_nscrollpos);
  623. m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
  624. }
  625. else if (m_radio == 5)
  626. {
  627. int i = 0;
  628. g_sendhead.bsql = 0;
  629. g_sendhead.code[0] = 135;
  630. g_sendhead.code[1] = 136;
  631. g_sendhead.tabcount = 2;
  632. CString sql;
  633. sql.Format("time5>='" + strdate + "' and time5<='" + strdate2 + "' and [status3]='未取'");
  634. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  635. DataToArray(&m_List6array, &g_List1array);
  636. for ( i = 0; i < g_List1array.GetSize(); i++)
  637. {
  638. for (int j = 0; j < m_List6array.GetSize(); j++)
  639. {
  640. if (g_List1array.ElementAt(i).ElementAt(0) == m_List6array.ElementAt(j).ElementAt(0))
  641. {
  642. if (g_List1array.ElementAt(i).ElementAt(1) != "" && g_List1array.ElementAt(i).ElementAt(3) != "" && g_List1array.ElementAt(i).ElementAt(5) != "")
  643. {
  644. m_List6array.ElementAt(j).SetAt(4, "已安排");
  645. }
  646. else
  647. {
  648. m_List6array.ElementAt(j).SetAt(4, m_List6array.ElementAt(j).ElementAt(4) + g_List1array.ElementAt(i).ElementAt(1));
  649. m_List6array.ElementAt(j).SetAt(6, m_List6array.ElementAt(j).ElementAt(6) + g_List1array.ElementAt(i).ElementAt(3));
  650. m_List6array.ElementAt(j).SetAt(7, m_List6array.ElementAt(j).ElementAt(7) + g_List1array.ElementAt(i).ElementAt(5));
  651. }
  652. }
  653. }
  654. }
  655. for (i = m_List6array.GetSize() - 1; i >= 0; i--)
  656. {
  657. if (m_List6array.ElementAt(i).ElementAt(4) == "已安排")
  658. m_List6array.RemoveAt(i);
  659. }
  660. qsort(static_cast<void*>(&m_List6array[0]), m_List6array.GetSize(), sizeof(m_List6array[0]), CompareByLabel3);
  661. }
  662. FillGrid();
  663. m_spinyear.EnableWindow(1);
  664. m_spinmonth.EnableWindow(1);
  665. m_spinday.EnableWindow(1);
  666. }
  667. void TodayForm2::OnCheck1()
  668. {
  669. // TODO: Add your control notification handler code here
  670. UpdateData();
  671. m_check2 = 0; UpdateData(false);
  672. DateChange();
  673. }
  674. void TodayForm2::OnCheck2()
  675. {
  676. // TODO: Add your control notification handler code here
  677. UpdateData();
  678. m_check = 0; UpdateData(false);
  679. DateChange();
  680. }
  681. void TodayForm2::OnChangeEDITyear()
  682. {
  683. // TODO: If this is a RICHEDIT control, the control will not
  684. // send this notification unless you override the MyFormView::OnInitDialog()
  685. // function and call CRichEditCtrl().SetEventMask()
  686. // with the ENM_CHANGE flag ORed into the mask.
  687. DateChange();
  688. // TODO: Add your control notification handler code here
  689. }
  690. void TodayForm2::OnChangeEDITmonth()
  691. {
  692. // TODO: If this is a RICHEDIT control, the control will not
  693. // send this notification unless you override the MyFormView::OnInitDialog()
  694. // function and call CRichEditCtrl().SetEventMask()
  695. // with the ENM_CHANGE flag ORed into the mask.
  696. DateChange();
  697. // TODO: Add your control notification handler code here
  698. }
  699. void TodayForm2::OnChangeEDITday()
  700. {
  701. // TODO: If this is a RICHEDIT control, the control will not
  702. // send this notification unless you override the MyFormView::OnInitDialog()
  703. // function and call CRichEditCtrl().SetEventMask()
  704. // with the ENM_CHANGE flag ORed into the mask.
  705. DateChange();
  706. // TODO: Add your control notification handler code her
  707. }
  708. void TodayForm2::OnRadio3()
  709. {
  710. // TODO: Add your control notification handler code here
  711. DateChange();
  712. }
  713. void TodayForm2::OnRadio4()
  714. {
  715. // TODO: Add your control notification handler code here
  716. DateChange();
  717. }
  718. void TodayForm2::OnRadio5()
  719. {
  720. // TODO: Add your control notification handler code here
  721. DateChange();
  722. }
  723. void TodayForm2::OnRadio6()
  724. {
  725. // TODO: Add your control notification handler code here
  726. DateChange();
  727. }
  728. void TodayForm2::OnRadio7()
  729. {
  730. // TODO: Add your control notification handler code here
  731. DateChange();
  732. }
  733. void TodayForm2::OnRadio8()
  734. {
  735. // TODO: Add your control notification handler code here
  736. DateChange();
  737. }
  738. void TodayForm2::OnBUTtake()
  739. {
  740. // TODO: Add your control notification handler code here
  741. if (IsHasRights2new(2) == 0)return;
  742. UpdateData();
  743. if (m_radio == 0)
  744. {
  745. TakeControlDlg1 dlg;
  746. dlg.DoModal(); DateChange();
  747. }
  748. else if (m_radio == 1)
  749. {
  750. TakeControlDlg2 dlg;
  751. if (dlg.DoModal() == IDOK)DateChange();
  752. }
  753. else if (m_radio == 2)
  754. {
  755. TakeControlDlg3 dlg;
  756. if (dlg.DoModal() == IDOK)DateChange();
  757. }
  758. else if (m_radio == 3)
  759. {
  760. TakeControlDlg4 dlg;
  761. if (dlg.DoModal() == IDOK)DateChange();
  762. }
  763. else if (m_radio == 4)
  764. {
  765. TakeControlDlg9 dlg;
  766. dlg.DoModal();
  767. DateChange();
  768. }
  769. }
  770. void TodayForm2::OnBUTchoose()
  771. {
  772. // TODO: Add your control notification handler code here
  773. UpdateData();
  774. if (m_radio == 0)
  775. {
  776. if (IsHasRightsnew(2) == 0)return;
  777. m_childdlg.OtherDate(); return;
  778. }
  779. if (m_radio == 1)
  780. {
  781. if (IsHasRightsnew(2) == 0)return;
  782. m_childdlg.OtherDate(); return;
  783. }
  784. else if (m_radio == 2)
  785. {
  786. if (IsHasRightsnew(2) == 0)return;
  787. m_childdlg.OtherDate(); return;
  788. }
  789. else if (m_radio == 3)
  790. {
  791. if (IsHasRightsnew(2) == 0)return;
  792. m_childdlg.OtherDate(); return;
  793. }
  794. else if (m_radio == 4)
  795. {
  796. if (IsHasRightsnew(2) == 0)return;
  797. m_childdlg.OtherDate(); return;
  798. }
  799. }
  800. void TodayForm2::OnCustomdrawList4(NMHDR* pNMHDR, LRESULT* pResult)
  801. {
  802. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  803. // Take the default processing unless we set this to something else below.
  804. *pResult = 0;
  805. // First thing - check the draw stage. If it's the control's prepaint
  806. // stage, then tell Windows we want messages for every item.
  807. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  808. {
  809. *pResult = CDRF_NOTIFYITEMDRAW;
  810. }
  811. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  812. {
  813. // This is the prepaint stage for an item. Here's where we set the
  814. // item's text color. Our return value will tell Windows to draw the
  815. // item itself, but it will use the new color we set here.
  816. // We'll cycle the colors through red, green, and light blue.
  817. #ifdef CHILD_VERSION
  818. if (m_List4.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8) != "OK")
  819. #else
  820. if(m_List4.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9)!="OK")
  821. #endif
  822. pLVCD->clrText = RGB(220, 0, 0);
  823. else
  824. pLVCD->clrText = RGB(20, 133, 20);
  825. if (pLVCD->nmcd.dwItemSpec % 2)
  826. pLVCD->clrTextBk = g_gridcol1;
  827. else
  828. pLVCD->clrTextBk = g_gridcol2;
  829. // Store the color back in the NMLVCUSTOMDRAW struct.
  830. // Tell Windows to paint the control itself.
  831. *pResult = CDRF_DODEFAULT;
  832. }
  833. }
  834. void TodayForm2::OnCustomdrawList3(NMHDR* pNMHDR, LRESULT* pResult)
  835. {
  836. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  837. // Take the default processing unless we set this to something else below.
  838. *pResult = 0;
  839. // First thing - check the draw stage. If it's the control's prepaint
  840. // stage, then tell Windows we want messages for every item.
  841. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  842. {
  843. *pResult = CDRF_NOTIFYITEMDRAW;
  844. }
  845. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  846. {
  847. // This is the prepaint stage for an item. Here's where we set the
  848. // item's text color. Our return value will tell Windows to draw the
  849. // item itself, but it will use the new color we set here.
  850. // We'll cycle the colors through red, green, and light blue.
  851. #ifdef CHILD_VERSION
  852. if (m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8) != "OK" && m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(7) != "OK")
  853. #else
  854. if(m_List3.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9)!="OK" && m_List3.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (8)!="OK")
  855. #endif
  856. {
  857. pLVCD->clrText = RGB(220, 0, 0);
  858. }
  859. else
  860. {
  861. pLVCD->clrText = RGB(20, 133, 20);
  862. }
  863. if (pLVCD->nmcd.dwItemSpec % 2)
  864. pLVCD->clrTextBk = g_gridcol1;
  865. else
  866. pLVCD->clrTextBk = g_gridcol2;
  867. // Store the color back in the NMLVCUSTOMDRAW struct.
  868. // Tell Windows to paint the control itself.
  869. *pResult = CDRF_DODEFAULT;
  870. }
  871. }
  872. void TodayForm2::OnBUTmsg()
  873. {
  874. // TODO: Add your control notification handler code here
  875. UpdateData();
  876. POSITION pos;
  877. CStringArray array;
  878. if (m_radio == 0)
  879. {
  880. if (IsHasRightsnew(2) == 0)return;
  881. m_childdlg.DeleteCur();
  882. return;
  883. }
  884. else if (m_radio == 1)
  885. {
  886. if (IsHasRightsnew(2) == 0)return;
  887. m_childdlg.DeleteCur();
  888. return;
  889. }
  890. else if (m_radio == 2)
  891. {
  892. if (IsHasRightsnew(2) == 0)return;
  893. m_childdlg.DeleteCur();
  894. return;
  895. }
  896. else if (m_radio == 3)
  897. {
  898. if (IsHasRightsnew(2) == 0)return;
  899. m_childdlg.DeleteCur();
  900. return;
  901. }
  902. else if (m_radio == 4)
  903. {
  904. if (IsHasRightsnew(2) == 0)return;
  905. m_childdlg.DeleteCur();
  906. return;
  907. }
  908. else if (m_radio == 5)
  909. {
  910. return;
  911. pos = m_List6.GetFirstSelectedItemPosition();
  912. if (pos == NULL)
  913. {
  914. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  915. return;
  916. }
  917. int iItem;
  918. while (pos)
  919. {
  920. iItem = m_List6.GetNextSelectedItem(pos);
  921. array.Add(m_List6.GetItemText(iItem, 16));
  922. array.Add(m_List6.GetItemText(iItem, 17));
  923. }
  924. }
  925. SendMsgDlg dlg;
  926. dlg.m_pArray = &array;
  927. dlg.DoModal();
  928. }
  929. void TodayForm2::OnBUTtake3()
  930. {
  931. // TODO: Add your control notification handler code here
  932. if (IsHasRights2new(2) == 0)return;
  933. SearchTake dlg;
  934. dlg.DoModal();
  935. DateChange();
  936. }
  937. void TodayForm2::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  938. {
  939. // TODO: Add your control notification handler code here
  940. POSITION pos;
  941. pos = m_List1.GetFirstSelectedItemPosition();
  942. if (pos == NULL)return;
  943. int iItem = m_List1.GetNextSelectedItem(pos);
  944. g_id = m_List1.GetItemText(iItem, 0);
  945. *pResult = 0;
  946. }
  947. void TodayForm2::OnClickList3(NMHDR* pNMHDR, LRESULT* pResult)
  948. {
  949. // TODO: Add your control notification handler code here
  950. POSITION pos;
  951. pos = m_List2.GetFirstSelectedItemPosition();
  952. if (pos == NULL)return;
  953. int iItem = m_List2.GetNextSelectedItem(pos);
  954. g_id = m_List2.GetItemText(iItem, 0);
  955. *pResult = 0;
  956. }
  957. void TodayForm2::OnClickList4(NMHDR* pNMHDR, LRESULT* pResult)
  958. {
  959. // TODO: Add your control notification handler code here
  960. POSITION pos;
  961. pos = m_List3.GetFirstSelectedItemPosition();
  962. if (pos == NULL)return;
  963. int iItem = m_List3.GetNextSelectedItem(pos);
  964. g_id = m_List3.GetItemText(iItem, 0);
  965. *pResult = 0;
  966. }
  967. void TodayForm2::OnClickList7(NMHDR* pNMHDR, LRESULT* pResult)
  968. {
  969. // TODO: Add your control notification handler code here
  970. POSITION pos;
  971. pos = m_List4.GetFirstSelectedItemPosition();
  972. if (pos == NULL)return;
  973. int iItem = m_List4.GetNextSelectedItem(pos);
  974. g_id = m_List4.GetItemText(iItem, 0);
  975. *pResult = 0;
  976. }
  977. void TodayForm2::OnClickList8(NMHDR* pNMHDR, LRESULT* pResult)
  978. {
  979. // TODO: Add your control notification handler code here
  980. POSITION pos;
  981. pos = m_List5.GetFirstSelectedItemPosition();
  982. if (pos == NULL)return;
  983. int iItem = m_List5.GetNextSelectedItem(pos);
  984. g_id = m_List5.GetItemText(iItem, 0);
  985. *pResult = 0;
  986. }
  987. void TodayForm2::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  988. {
  989. // TODO: Add your control notification handler code here
  990. if (IsHasRights2new(1) == 0)return;
  991. g_pMainWnd->OnOutbarNotify("拍照");
  992. *pResult = 0;
  993. }
  994. void TodayForm2::OnDblclkList3(NMHDR* pNMHDR, LRESULT* pResult)
  995. {
  996. // TODO: Add your control notification handler code here
  997. if (IsHasRights2new(15) == 0)return;
  998. // TODO: Add your control notification handler code here
  999. POSITION pos;
  1000. pos = m_List2.GetFirstSelectedItemPosition();
  1001. if (pos == NULL)
  1002. {
  1003. return;
  1004. }
  1005. int iItem = m_List2.GetNextSelectedItem(pos);
  1006. CString id = m_List2.GetItemText(iItem, 0);
  1007. ChooseDesignSkin dlg;
  1008. dlg.SetLiaPath("3.lia");
  1009. dlg.m_strOrderNumber = id;
  1010. dlg.m_path = g_path2 + "\\";
  1011. dlg.m_path += dlg.m_strOrderNumber;
  1012. dlg.m_path += "\\";
  1013. dlg.DoModal();
  1014. *pResult = 0;
  1015. }
  1016. void TodayForm2::OnDblclkList4(NMHDR* pNMHDR, LRESULT* pResult)
  1017. {
  1018. // TODO: Add your control notification handler code here
  1019. if (IsHasRights2new(15) == 0)return;
  1020. // TODO: Add your control notification handler code here
  1021. POSITION pos;
  1022. pos = m_List3.GetFirstSelectedItemPosition();
  1023. if (pos == NULL)
  1024. {
  1025. return;
  1026. }
  1027. int iItem = m_List3.GetNextSelectedItem(pos);
  1028. CString id = m_List3.GetItemText(iItem, 0);
  1029. ChooseDesignSkin dlg;
  1030. dlg.SetLiaPath("3.lia");
  1031. dlg.m_strOrderNumber = id;
  1032. dlg.m_path = g_path3 + "\\";
  1033. dlg.m_path += id;
  1034. dlg.m_path += "\\";
  1035. dlg.DoModal();
  1036. *pResult = 0;
  1037. }
  1038. void TodayForm2::OnDblclkList7(NMHDR* pNMHDR, LRESULT* pResult)
  1039. {
  1040. // TODO: Add your control notification handler code here
  1041. if (IsHasRights2new(3) == 0)return;
  1042. g_pMainWnd->OnOutbarNotify("发片/取件");
  1043. *pResult = 0;
  1044. }
  1045. void TodayForm2::OnCustomdrawList1(NMHDR* pNMHDR, LRESULT* pResult)
  1046. {
  1047. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  1048. // Take the default processing unless we set this to something else below.
  1049. *pResult = 0;
  1050. // First thing - check the draw stage. If it's the control's prepaint
  1051. // stage, then tell Windows we want messages for every item.
  1052. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  1053. {
  1054. *pResult = CDRF_NOTIFYITEMDRAW;
  1055. }
  1056. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  1057. {
  1058. // This is the prepaint stage for an item. Here's where we set the
  1059. // item's text color. Our return value will tell Windows to draw the
  1060. // item itself, but it will use the new color we set here.
  1061. // We'll cycle the colors through red, green, and light blue.
  1062. if (::FindArray(&m_datearray1, m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6)) % 2)
  1063. pLVCD->clrText = RGB(0, 0, 220);
  1064. else
  1065. pLVCD->clrText = RGB(0, 0, 50);
  1066. if (pLVCD->nmcd.dwItemSpec % 2)
  1067. pLVCD->clrTextBk = g_gridcol1;
  1068. else
  1069. pLVCD->clrTextBk = g_gridcol2;
  1070. // Store the color back in the NMLVCUSTOMDRAW struct.
  1071. // Tell Windows to paint the control itself.
  1072. *pResult = CDRF_DODEFAULT;
  1073. }
  1074. }
  1075. void TodayForm2::OnCustomdrawList2(NMHDR* pNMHDR, LRESULT* pResult)
  1076. {
  1077. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  1078. // Take the default processing unless we set this to something else below.
  1079. *pResult = 0;
  1080. // First thing - check the draw stage. If it's the control's prepaint
  1081. // stage, then tell Windows we want messages for every item.
  1082. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  1083. {
  1084. *pResult = CDRF_NOTIFYITEMDRAW;
  1085. }
  1086. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  1087. {
  1088. // This is the prepaint stage for an item. Here's where we set the
  1089. // item's text color. Our return value will tell Windows to draw the
  1090. // item itself, but it will use the new color we set here.
  1091. // We'll cycle the colors through red, green, and light blue.
  1092. if (::FindArray(&m_datearray2, m_List2.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(5)) % 2)
  1093. pLVCD->clrText = RGB(0, 0, 220);
  1094. else
  1095. pLVCD->clrText = RGB(0, 0, 50);
  1096. if (pLVCD->nmcd.dwItemSpec % 2)
  1097. pLVCD->clrTextBk = g_gridcol1;
  1098. else
  1099. pLVCD->clrTextBk = g_gridcol2;
  1100. // Store the color back in the NMLVCUSTOMDRAW struct.
  1101. // Tell Windows to paint the control itself.
  1102. *pResult = CDRF_DODEFAULT;
  1103. }
  1104. }
  1105. void TodayForm2::OnCustomdrawList5(NMHDR* pNMHDR, LRESULT* pResult)
  1106. {
  1107. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  1108. // Take the default processing unless we set this to something else below.
  1109. *pResult = 0;
  1110. // First thing - check the draw stage. If it's the control's prepaint
  1111. // stage, then tell Windows we want messages for every item.
  1112. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  1113. {
  1114. *pResult = CDRF_NOTIFYITEMDRAW;
  1115. }
  1116. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  1117. {
  1118. // This is the prepaint stage for an item. Here's where we set the
  1119. // item's text color. Our return value will tell Windows to draw the
  1120. // item itself, but it will use the new color we set here.
  1121. // We'll cycle the colors through red, green, and light blue.
  1122. if (::FindArray(&m_datearray5, m_List5.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6)) % 2)
  1123. pLVCD->clrText = RGB(0, 0, 220);
  1124. else
  1125. pLVCD->clrText = RGB(0, 0, 50);
  1126. if (pLVCD->nmcd.dwItemSpec % 2)
  1127. pLVCD->clrTextBk = g_gridcol1;
  1128. else
  1129. pLVCD->clrTextBk = g_gridcol2;
  1130. // Store the color back in the NMLVCUSTOMDRAW struct.
  1131. // Tell Windows to paint the control itself.
  1132. *pResult = CDRF_DODEFAULT;
  1133. }
  1134. }
  1135. void TodayForm2::OnCustomdrawList6(NMHDR* pNMHDR, LRESULT* pResult)
  1136. {
  1137. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  1138. // Take the default processing unless we set this to something else below.
  1139. *pResult = 0;
  1140. // First thing - check the draw stage. If it's the control's prepaint
  1141. // stage, then tell Windows we want messages for every item.
  1142. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  1143. {
  1144. *pResult = CDRF_NOTIFYITEMDRAW;
  1145. }
  1146. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  1147. {
  1148. // This is the prepaint stage for an item. Here's where we set the
  1149. // item's text color. Our return value will tell Windows to draw the
  1150. // item itself, but it will use the new color we set here.
  1151. // We'll cycle the colors through red, green, and light blue.
  1152. if (::FindArray(&m_datearray6, m_List6.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)) % 2)
  1153. pLVCD->clrText = RGB(0, 0, 220);
  1154. else
  1155. pLVCD->clrText = RGB(0, 0, 50);
  1156. if (pLVCD->nmcd.dwItemSpec % 2)
  1157. pLVCD->clrTextBk = g_gridcol1;
  1158. else
  1159. pLVCD->clrTextBk = g_gridcol2;
  1160. // Store the color back in the NMLVCUSTOMDRAW struct.
  1161. // Tell Windows to paint the control itself.
  1162. *pResult = CDRF_DODEFAULT;
  1163. }
  1164. }
  1165. BOOL TodayForm2::PreTranslateMessage(MSG* pMsg)
  1166. {
  1167. // TODO: Add your specialized code here and/or call the base class
  1168. if (pMsg->message == WM_KEYDOWN)
  1169. {
  1170. switch (pMsg->wParam)
  1171. {
  1172. case VK_F9:
  1173. GetClientPhone();
  1174. return 1;
  1175. case 0x43: // copy
  1176. if ((GetKeyState(VK_CONTROL) & 0x80))
  1177. {
  1178. GetFocus()->SendMessage(WM_COPY);
  1179. return TRUE;
  1180. }
  1181. break;
  1182. case 0x56: //Ctrl + V:
  1183. if ((GetKeyState(VK_CONTROL) & 0x80))
  1184. {
  1185. GetFocus()->SendMessage(WM_PASTE);
  1186. return TRUE;
  1187. }
  1188. break;
  1189. case 0x58: // cut
  1190. if ((GetKeyState(VK_CONTROL) & 0x80))
  1191. {
  1192. GetFocus()->SendMessage(WM_CUT);
  1193. return TRUE;
  1194. }
  1195. break;
  1196. case 0x5A: //undo
  1197. case 0x59: //redo
  1198. if ((GetKeyState(VK_CONTROL) & 0x80))
  1199. {
  1200. GetFocus()->SendMessage(WM_UNDO);
  1201. return TRUE;
  1202. }
  1203. break;
  1204. }
  1205. }
  1206. return MyFormView::PreTranslateMessage(pMsg);
  1207. }
  1208. void TodayForm2::GetClientPhone()
  1209. {
  1210. UpdateData();
  1211. if (m_radio == 1)
  1212. {
  1213. GetClientPhone2();
  1214. return;
  1215. }
  1216. else if (m_radio == 2)
  1217. {
  1218. GetClientPhone3();
  1219. return;
  1220. }
  1221. else if (m_radio == 3)
  1222. {
  1223. GetClientPhone4();
  1224. return;
  1225. }
  1226. else if (m_radio == 4)
  1227. {
  1228. GetClientPhone5();
  1229. return;
  1230. }
  1231. CString path;
  1232. if (m_radio == 0)
  1233. path = "c:\\拍照客人.txt";
  1234. else if (m_radio == 1)
  1235. path = "c:\\选片客人.txt";
  1236. else if (m_radio == 2)
  1237. path = "c:\\看设计客人.txt";
  1238. else if (m_radio == 3)
  1239. path = "c:\\取件客人.txt";
  1240. else if (m_radio == 4)
  1241. path = "c:\\婚庆客人.txt";
  1242. CStdioFile fp;
  1243. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1244. CString str;
  1245. CString name, m_name1, m_name2;
  1246. CString phone, m_phone1, m_phone2;
  1247. CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
  1248. int leng1 = 20;
  1249. int leng2 = 30;
  1250. int leng3 = 15;
  1251. int leng4 = 15;
  1252. int leng5 = 15;
  1253. int leng6 = 15;
  1254. int leng7 = 15;
  1255. int leng8 = 15;
  1256. int leng9 = 15;
  1257. str1 = "姓名";
  1258. str2 = "电话";
  1259. str3 = "景点";
  1260. str4 = "日期";
  1261. str5 = "时间";
  1262. str6 = "摄影";
  1263. str7 = "化妆";
  1264. str8 = "套系";
  1265. str9 = "价格";
  1266. FillLength(str1, leng1);
  1267. FillLength(str2, leng2);
  1268. FillLength(str3, leng3);
  1269. FillLength(str4, leng4);
  1270. FillLength(str5, leng5);
  1271. FillLength(str6, leng6);
  1272. FillLength(str7, leng7);
  1273. FillLength(str8, leng8);
  1274. FillLength(str9, leng9);
  1275. str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + "\n";
  1276. fp.WriteString(str);
  1277. for (int i = 0; i < m_List1.GetItemCount(); i++)
  1278. {
  1279. name.Empty();
  1280. phone.Empty();
  1281. m_name1 = m_List1.GetItemText(i, 1);
  1282. m_name2 = m_List1.GetItemText(i, 2);
  1283. m_phone1 = m_List1.GetItemText(i, 3);
  1284. m_phone2 = m_List1.GetItemText(i, 4);
  1285. str3 = m_List1.GetItemText(i, 5);
  1286. str4 = m_List1.GetItemText(i, 6);
  1287. str5 = m_List1.GetItemText(i, 7);
  1288. str6 = m_List1.GetItemText(i, 8);
  1289. str7 = m_List1.GetItemText(i, 9);
  1290. str8 = m_List1.GetItemText(i, 12);
  1291. str9 = m_List1.GetItemText(i, 13);
  1292. if (!m_name1.IsEmpty())
  1293. name = m_name1 + ",";
  1294. name += m_name2;
  1295. name.TrimRight(",");
  1296. if (!m_phone1.IsEmpty())
  1297. phone = m_phone1 + ",";
  1298. phone += m_phone2; phone.TrimRight(",");
  1299. str1 = name;
  1300. str2 = phone;
  1301. FillLength(str1, leng1);
  1302. FillLength(str2, leng2);
  1303. FillLength(str3, leng3);
  1304. FillLength(str4, leng4);
  1305. FillLength(str5, leng5);
  1306. FillLength(str6, leng6);
  1307. FillLength(str7, leng7);
  1308. FillLength(str8, leng8);
  1309. FillLength(str9, leng9);
  1310. str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + "\n";
  1311. fp.WriteString(str);
  1312. }
  1313. fp.Close();
  1314. MessageBox("资料已保存到" + path);
  1315. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  1316. }
  1317. void TodayForm2::GetClientPhone2()
  1318. {
  1319. CString path;
  1320. path = "c:\\选片客人.txt";
  1321. CStdioFile fp;
  1322. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1323. CString str;
  1324. CString name, m_name1, m_name2;
  1325. CString phone, m_phone1, m_phone2;
  1326. CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
  1327. int leng1 = 25;
  1328. int leng2 = 30;
  1329. int leng3 = 20;
  1330. int leng4 = 20;
  1331. int leng5 = 20;
  1332. int leng6 = 20;
  1333. str1 = "姓名";
  1334. str2 = "电话";
  1335. str3 = "日期";
  1336. str4 = "时间";
  1337. str5 = "套系";
  1338. str6 = "价格";
  1339. FillLength(str1, leng1);
  1340. FillLength(str2, leng2);
  1341. FillLength(str3, leng3);
  1342. FillLength(str4, leng4);
  1343. FillLength(str5, leng5);
  1344. FillLength(str6, leng6);
  1345. str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
  1346. fp.WriteString(str);
  1347. for (int i = 0; i < m_List2.GetItemCount(); i++)
  1348. {
  1349. name.Empty();
  1350. phone.Empty();
  1351. m_name1 = m_List2.GetItemText(i, 1);
  1352. m_name2 = m_List2.GetItemText(i, 2);
  1353. m_phone1 = m_List2.GetItemText(i, 3);
  1354. m_phone2 = m_List2.GetItemText(i, 4);
  1355. str3 = m_List2.GetItemText(i, 5);
  1356. str4 = m_List2.GetItemText(i, 6);
  1357. str5 = m_List2.GetItemText(i, 9);
  1358. str6 = m_List2.GetItemText(i, 10);
  1359. if (!m_name1.IsEmpty())
  1360. name = m_name1 + ",";
  1361. name += m_name2;
  1362. name.TrimRight(",");
  1363. if (!m_phone1.IsEmpty())
  1364. phone = m_phone1 + ",";
  1365. phone += m_phone2; phone.TrimRight(",");
  1366. str1 = name;
  1367. str2 = phone;
  1368. FillLength(str1, leng1);
  1369. FillLength(str2, leng2);
  1370. FillLength(str3, leng3);
  1371. FillLength(str4, leng4);
  1372. FillLength(str5, leng5);
  1373. FillLength(str6, leng6);
  1374. str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
  1375. fp.WriteString(str);
  1376. }
  1377. fp.Close();
  1378. MessageBox("资料已保存到" + path);
  1379. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  1380. }
  1381. void TodayForm2::GetClientPhone3()
  1382. {
  1383. CString path;
  1384. path = "c:\\看设计客人.txt";
  1385. CStdioFile fp;
  1386. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1387. CString str;
  1388. CString name, m_name1, m_name2;
  1389. CString phone, m_phone1, m_phone2;
  1390. CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
  1391. int leng1 = 25;
  1392. int leng2 = 30;
  1393. int leng3 = 20;
  1394. int leng4 = 20;
  1395. int leng5 = 20;
  1396. int leng6 = 20;
  1397. str1 = "姓名";
  1398. str2 = "电话";
  1399. str3 = "日期";
  1400. str4 = "时间";
  1401. str5 = "套系";
  1402. str6 = "价格";
  1403. FillLength(str1, leng1);
  1404. FillLength(str2, leng2);
  1405. FillLength(str3, leng3);
  1406. FillLength(str4, leng4);
  1407. FillLength(str5, leng5);
  1408. FillLength(str6, leng6);
  1409. str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
  1410. fp.WriteString(str);
  1411. for (int i = 0; i < m_List3.GetItemCount(); i++)
  1412. {
  1413. name.Empty();
  1414. phone.Empty();
  1415. m_name1 = m_List3.GetItemText(i, 1);
  1416. m_name2 = m_List3.GetItemText(i, 2);
  1417. m_phone1 = m_List3.GetItemText(i, 3);
  1418. m_phone2 = m_List3.GetItemText(i, 4);
  1419. str3 = m_List3.GetItemText(i, 5);
  1420. str4 = m_List3.GetItemText(i, 6);
  1421. str5 = m_List3.GetItemText(i, 10);
  1422. str6 = m_List3.GetItemText(i, 11);
  1423. if (!m_name1.IsEmpty())
  1424. name = m_name1 + ",";
  1425. name += m_name2;
  1426. name.TrimRight(",");
  1427. if (!m_phone1.IsEmpty())
  1428. phone = m_phone1 + ",";
  1429. phone += m_phone2; phone.TrimRight(",");
  1430. str1 = name;
  1431. str2 = phone;
  1432. FillLength(str1, leng1);
  1433. FillLength(str2, leng2);
  1434. FillLength(str3, leng3);
  1435. FillLength(str4, leng4);
  1436. FillLength(str5, leng5);
  1437. FillLength(str6, leng6);
  1438. str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
  1439. fp.WriteString(str);
  1440. }
  1441. fp.Close();
  1442. MessageBox("资料已保存到" + path);
  1443. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  1444. }
  1445. void TodayForm2::GetClientPhone4()
  1446. {
  1447. CString path;
  1448. path = "c:\\取件客人.txt";
  1449. CStdioFile fp;
  1450. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1451. CString str;
  1452. CString name, m_name1, m_name2;
  1453. CString phone, m_phone1, m_phone2;
  1454. CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
  1455. int leng1 = 25;
  1456. int leng2 = 30;
  1457. int leng3 = 20;
  1458. int leng4 = 20;
  1459. int leng5 = 20;
  1460. int leng6 = 20;
  1461. str1 = "姓名";
  1462. str2 = "电话";
  1463. str3 = "日期";
  1464. str4 = "时间";
  1465. str5 = "套系";
  1466. str6 = "价格";
  1467. FillLength(str1, leng1);
  1468. FillLength(str2, leng2);
  1469. FillLength(str3, leng3);
  1470. FillLength(str4, leng4);
  1471. FillLength(str5, leng5);
  1472. FillLength(str6, leng6);
  1473. str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
  1474. fp.WriteString(str);
  1475. for (int i = 0; i < m_List4.GetItemCount(); i++)
  1476. {
  1477. name.Empty();
  1478. phone.Empty();
  1479. m_name1 = m_List4.GetItemText(i, 1);
  1480. m_name2 = m_List4.GetItemText(i, 2);
  1481. m_phone1 = m_List4.GetItemText(i, 3);
  1482. m_phone2 = m_List4.GetItemText(i, 4);
  1483. str3 = m_List4.GetItemText(i, 5);
  1484. str4 = m_List4.GetItemText(i, 6);
  1485. str5 = m_List4.GetItemText(i, 10);
  1486. str6 = m_List4.GetItemText(i, 11);
  1487. if (!m_name1.IsEmpty())
  1488. name = m_name1 + ",";
  1489. name += m_name2;
  1490. name.TrimRight(",");
  1491. if (!m_phone1.IsEmpty())
  1492. phone = m_phone1 + ",";
  1493. phone += m_phone2; phone.TrimRight(",");
  1494. str1 = name;
  1495. str2 = phone;
  1496. FillLength(str1, leng1);
  1497. FillLength(str2, leng2);
  1498. FillLength(str3, leng3);
  1499. FillLength(str4, leng4);
  1500. FillLength(str5, leng5);
  1501. FillLength(str6, leng6);
  1502. str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
  1503. fp.WriteString(str);
  1504. }
  1505. fp.Close();
  1506. MessageBox("资料已保存到" + path);
  1507. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  1508. }
  1509. void TodayForm2::GetClientPhone5()
  1510. {
  1511. CString path;
  1512. path = "c:\\婚庆客人.txt";
  1513. CStdioFile fp;
  1514. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1515. CString str;
  1516. CString name, m_name1, m_name2;
  1517. CString phone, m_phone1, m_phone2;
  1518. CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
  1519. int leng1 = 25;
  1520. int leng2 = 30;
  1521. int leng3 = 20;
  1522. int leng4 = 20;
  1523. int leng5 = 20;
  1524. int leng6 = 20;
  1525. int leng7 = 20;
  1526. str1 = "姓名";
  1527. str2 = "电话";
  1528. str3 = "婚庆内容";
  1529. str4 = "日期";
  1530. str5 = "时间";
  1531. str6 = "套系";
  1532. str7 = "价格";
  1533. FillLength(str1, leng1);
  1534. FillLength(str2, leng2);
  1535. FillLength(str3, leng3);
  1536. FillLength(str4, leng4);
  1537. FillLength(str5, leng5);
  1538. FillLength(str6, leng6);
  1539. FillLength(str7, leng7);
  1540. str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + "\n";
  1541. fp.WriteString(str);
  1542. for (int i = 0; i < m_List5.GetItemCount(); i++)
  1543. {
  1544. name.Empty();
  1545. phone.Empty();
  1546. m_name1 = m_List5.GetItemText(i, 1);
  1547. m_name2 = m_List5.GetItemText(i, 2);
  1548. m_phone1 = m_List5.GetItemText(i, 3);
  1549. m_phone2 = m_List5.GetItemText(i, 4);
  1550. str3 = m_List5.GetItemText(i, 5);
  1551. str4 = m_List5.GetItemText(i, 6);
  1552. str5 = m_List5.GetItemText(i, 7);
  1553. str6 = m_List5.GetItemText(i, 12);
  1554. str7 = m_List5.GetItemText(i, 13);
  1555. if (!m_name1.IsEmpty())
  1556. name = m_name1 + ",";
  1557. name += m_name2;
  1558. name.TrimRight(",");
  1559. if (!m_phone1.IsEmpty())
  1560. phone = m_phone1 + ",";
  1561. phone += m_phone2; phone.TrimRight(",");
  1562. str1 = name;
  1563. str2 = phone;
  1564. FillLength(str1, leng1);
  1565. FillLength(str2, leng2);
  1566. FillLength(str3, leng3);
  1567. FillLength(str4, leng4);
  1568. FillLength(str5, leng5);
  1569. FillLength(str6, leng6);
  1570. FillLength(str7, leng7);
  1571. str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + "\n";
  1572. fp.WriteString(str);
  1573. }
  1574. fp.Close();
  1575. MessageBox("资料已保存到" + path);
  1576. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  1577. }
  1578. void TodayForm2::OnClickList10(NMHDR* pNMHDR, LRESULT* pResult)
  1579. {
  1580. // TODO: Add your control notification handler code here
  1581. POSITION pos;
  1582. pos = m_List6.GetFirstSelectedItemPosition();
  1583. if (pos == NULL)return;
  1584. int iItem = m_List6.GetNextSelectedItem(pos);
  1585. g_id = m_List6.GetItemText(iItem, 0);
  1586. *pResult = 0;
  1587. }
  1588. void TodayForm2::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
  1589. {
  1590. // TODO: Add your message handler code here and/or call default
  1591. int temp = m_nscrollpos;
  1592. int nscrollpos = pScrollBar->GetScrollPos();
  1593. switch (nSBCode)
  1594. {
  1595. case SB_LINEUP:
  1596. nscrollpos -= 20;
  1597. break;
  1598. case SB_LINEDOWN:
  1599. nscrollpos += 20;
  1600. break;
  1601. case SB_PAGEUP:
  1602. nscrollpos -= m_page;
  1603. break;
  1604. case SB_PAGEDOWN:
  1605. nscrollpos += m_page;
  1606. break;
  1607. case SB_THUMBTRACK:
  1608. nscrollpos = nPos;
  1609. break;
  1610. }
  1611. m_nscrollpos = nscrollpos;
  1612. pScrollBar->SetScrollPos(m_nscrollpos);
  1613. m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
  1614. MyFormView::OnVScroll(nSBCode, nPos, pScrollBar);
  1615. }
  1616. CString TodayForm2::GetDate()
  1617. {
  1618. UpdateData();
  1619. CString strdate;
  1620. strdate.Format("%04d-%02d-%02d", m_year, m_month, m_day);
  1621. return strdate;
  1622. }
  1623. void TodayForm2::ReLoad1()
  1624. {
  1625. DateChange();
  1626. }
  1627. BOOL TodayForm2::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
  1628. {
  1629. // TODO: Add your message handler code here and/or call default
  1630. if (zDelta > 0)
  1631. {
  1632. int temp = m_nscrollpos;
  1633. int nscrollpos = m_scrollbar.GetScrollPos();
  1634. nscrollpos -= 60; if (nscrollpos < 0)nscrollpos = 0;
  1635. m_nscrollpos = nscrollpos;
  1636. m_scrollbar.SetScrollPos(m_nscrollpos);
  1637. m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
  1638. }
  1639. else
  1640. {
  1641. int temp = m_nscrollpos;
  1642. int nscrollpos = m_scrollbar.GetScrollPos();
  1643. nscrollpos += 60;
  1644. m_nscrollpos = nscrollpos;
  1645. m_scrollbar.SetScrollPos(m_nscrollpos);
  1646. m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
  1647. }
  1648. return MyFormView::OnMouseWheel(nFlags, zDelta, pt);
  1649. }