TodayForm2.cpp 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820
  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 "ChoosePhotoSkin2.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. g_sendhead.bsql = 0;
  628. g_sendhead.code[0] = 135;
  629. g_sendhead.code[1] = 136;
  630. g_sendhead.tabcount = 2;
  631. CString sql;
  632. sql.Format("time5>='" + strdate + "' and time5<='" + strdate2 + "' and [status3]='未取'");
  633. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  634. DataToArray(&m_List6array, &g_List1array);
  635. for (int i = 0; i < g_List1array.GetSize(); i++)
  636. {
  637. for (int j = 0; j < m_List6array.GetSize(); j++)
  638. {
  639. if (g_List1array.ElementAt(i).ElementAt(0) == m_List6array.ElementAt(j).ElementAt(0))
  640. {
  641. if (g_List1array.ElementAt(i).ElementAt(1) != "" && g_List1array.ElementAt(i).ElementAt(3) != "" && g_List1array.ElementAt(i).ElementAt(5) != "")
  642. {
  643. m_List6array.ElementAt(j).SetAt(4, "已安排");
  644. }
  645. else
  646. {
  647. m_List6array.ElementAt(j).SetAt(4, m_List6array.ElementAt(j).ElementAt(4) + g_List1array.ElementAt(i).ElementAt(1));
  648. m_List6array.ElementAt(j).SetAt(6, m_List6array.ElementAt(j).ElementAt(6) + g_List1array.ElementAt(i).ElementAt(3));
  649. m_List6array.ElementAt(j).SetAt(7, m_List6array.ElementAt(j).ElementAt(7) + g_List1array.ElementAt(i).ElementAt(5));
  650. }
  651. }
  652. }
  653. }
  654. for (i = m_List6array.GetSize() - 1; i >= 0; i--)
  655. {
  656. if (m_List6array.ElementAt(i).ElementAt(4) == "已安排")
  657. m_List6array.RemoveAt(i);
  658. }
  659. qsort(static_cast<void*>(&m_List6array[0]), m_List6array.GetSize(), sizeof(m_List6array[0]), CompareByLabel3);
  660. }
  661. FillGrid();
  662. m_spinyear.EnableWindow(1);
  663. m_spinmonth.EnableWindow(1);
  664. m_spinday.EnableWindow(1);
  665. }
  666. void TodayForm2::OnCheck1()
  667. {
  668. // TODO: Add your control notification handler code here
  669. UpdateData();
  670. m_check2 = 0; UpdateData(false);
  671. DateChange();
  672. }
  673. void TodayForm2::OnCheck2()
  674. {
  675. // TODO: Add your control notification handler code here
  676. UpdateData();
  677. m_check = 0; UpdateData(false);
  678. DateChange();
  679. }
  680. void TodayForm2::OnChangeEDITyear()
  681. {
  682. // TODO: If this is a RICHEDIT control, the control will not
  683. // send this notification unless you override the MyFormView::OnInitDialog()
  684. // function and call CRichEditCtrl().SetEventMask()
  685. // with the ENM_CHANGE flag ORed into the mask.
  686. DateChange();
  687. // TODO: Add your control notification handler code here
  688. }
  689. void TodayForm2::OnChangeEDITmonth()
  690. {
  691. // TODO: If this is a RICHEDIT control, the control will not
  692. // send this notification unless you override the MyFormView::OnInitDialog()
  693. // function and call CRichEditCtrl().SetEventMask()
  694. // with the ENM_CHANGE flag ORed into the mask.
  695. DateChange();
  696. // TODO: Add your control notification handler code here
  697. }
  698. void TodayForm2::OnChangeEDITday()
  699. {
  700. // TODO: If this is a RICHEDIT control, the control will not
  701. // send this notification unless you override the MyFormView::OnInitDialog()
  702. // function and call CRichEditCtrl().SetEventMask()
  703. // with the ENM_CHANGE flag ORed into the mask.
  704. DateChange();
  705. // TODO: Add your control notification handler code her
  706. }
  707. void TodayForm2::OnRadio3()
  708. {
  709. // TODO: Add your control notification handler code here
  710. DateChange();
  711. }
  712. void TodayForm2::OnRadio4()
  713. {
  714. // TODO: Add your control notification handler code here
  715. DateChange();
  716. }
  717. void TodayForm2::OnRadio5()
  718. {
  719. // TODO: Add your control notification handler code here
  720. DateChange();
  721. }
  722. void TodayForm2::OnRadio6()
  723. {
  724. // TODO: Add your control notification handler code here
  725. DateChange();
  726. }
  727. void TodayForm2::OnRadio7()
  728. {
  729. // TODO: Add your control notification handler code here
  730. DateChange();
  731. }
  732. void TodayForm2::OnRadio8()
  733. {
  734. // TODO: Add your control notification handler code here
  735. DateChange();
  736. }
  737. void TodayForm2::OnBUTtake()
  738. {
  739. // TODO: Add your control notification handler code here
  740. if (IsHasRights2new(2) == 0)return;
  741. UpdateData();
  742. if (m_radio == 0)
  743. {
  744. TakeControlDlg1 dlg;
  745. dlg.DoModal(); DateChange();
  746. }
  747. else if (m_radio == 1)
  748. {
  749. TakeControlDlg2 dlg;
  750. if (dlg.DoModal() == IDOK)DateChange();
  751. }
  752. else if (m_radio == 2)
  753. {
  754. TakeControlDlg3 dlg;
  755. if (dlg.DoModal() == IDOK)DateChange();
  756. }
  757. else if (m_radio == 3)
  758. {
  759. TakeControlDlg4 dlg;
  760. if (dlg.DoModal() == IDOK)DateChange();
  761. }
  762. else if (m_radio == 4)
  763. {
  764. TakeControlDlg9 dlg;
  765. dlg.DoModal();
  766. DateChange();
  767. }
  768. }
  769. void TodayForm2::OnBUTchoose()
  770. {
  771. // TODO: Add your control notification handler code here
  772. UpdateData();
  773. if (m_radio == 0)
  774. {
  775. if (IsHasRightsnew(2) == 0)return;
  776. m_childdlg.OtherDate(); return;
  777. }
  778. if (m_radio == 1)
  779. {
  780. if (IsHasRightsnew(2) == 0)return;
  781. m_childdlg.OtherDate(); return;
  782. }
  783. else if (m_radio == 2)
  784. {
  785. if (IsHasRightsnew(2) == 0)return;
  786. m_childdlg.OtherDate(); return;
  787. }
  788. else if (m_radio == 3)
  789. {
  790. if (IsHasRightsnew(2) == 0)return;
  791. m_childdlg.OtherDate(); return;
  792. }
  793. else if (m_radio == 4)
  794. {
  795. if (IsHasRightsnew(2) == 0)return;
  796. m_childdlg.OtherDate(); return;
  797. }
  798. }
  799. void TodayForm2::OnCustomdrawList4(NMHDR* pNMHDR, LRESULT* pResult)
  800. {
  801. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  802. // Take the default processing unless we set this to something else below.
  803. *pResult = 0;
  804. // First thing - check the draw stage. If it's the control's prepaint
  805. // stage, then tell Windows we want messages for every item.
  806. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  807. {
  808. *pResult = CDRF_NOTIFYITEMDRAW;
  809. }
  810. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  811. {
  812. // This is the prepaint stage for an item. Here's where we set the
  813. // item's text color. Our return value will tell Windows to draw the
  814. // item itself, but it will use the new color we set here.
  815. // We'll cycle the colors through red, green, and light blue.
  816. #ifdef CHILD_VERSION
  817. if (m_List4.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8) != "OK")
  818. #else
  819. if(m_List4.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9)!="OK")
  820. #endif
  821. pLVCD->clrText = RGB(220, 0, 0);
  822. else
  823. pLVCD->clrText = RGB(20, 133, 20);
  824. if (pLVCD->nmcd.dwItemSpec % 2)
  825. pLVCD->clrTextBk = g_gridcol1;
  826. else
  827. pLVCD->clrTextBk = g_gridcol2;
  828. // Store the color back in the NMLVCUSTOMDRAW struct.
  829. // Tell Windows to paint the control itself.
  830. *pResult = CDRF_DODEFAULT;
  831. }
  832. }
  833. void TodayForm2::OnCustomdrawList3(NMHDR* pNMHDR, LRESULT* pResult)
  834. {
  835. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  836. // Take the default processing unless we set this to something else below.
  837. *pResult = 0;
  838. // First thing - check the draw stage. If it's the control's prepaint
  839. // stage, then tell Windows we want messages for every item.
  840. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  841. {
  842. *pResult = CDRF_NOTIFYITEMDRAW;
  843. }
  844. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  845. {
  846. // This is the prepaint stage for an item. Here's where we set the
  847. // item's text color. Our return value will tell Windows to draw the
  848. // item itself, but it will use the new color we set here.
  849. // We'll cycle the colors through red, green, and light blue.
  850. #ifdef CHILD_VERSION
  851. if (m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8) != "OK" && m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(7) != "OK")
  852. #else
  853. if(m_List3.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9)!="OK" && m_List3.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (8)!="OK")
  854. #endif
  855. {
  856. pLVCD->clrText = RGB(220, 0, 0);
  857. }
  858. else
  859. {
  860. pLVCD->clrText = RGB(20, 133, 20);
  861. }
  862. if (pLVCD->nmcd.dwItemSpec % 2)
  863. pLVCD->clrTextBk = g_gridcol1;
  864. else
  865. pLVCD->clrTextBk = g_gridcol2;
  866. // Store the color back in the NMLVCUSTOMDRAW struct.
  867. // Tell Windows to paint the control itself.
  868. *pResult = CDRF_DODEFAULT;
  869. }
  870. }
  871. void TodayForm2::OnBUTmsg()
  872. {
  873. // TODO: Add your control notification handler code here
  874. UpdateData();
  875. POSITION pos;
  876. CStringArray array;
  877. if (m_radio == 0)
  878. {
  879. if (IsHasRightsnew(2) == 0)return;
  880. m_childdlg.DeleteCur();
  881. return;
  882. }
  883. else if (m_radio == 1)
  884. {
  885. if (IsHasRightsnew(2) == 0)return;
  886. m_childdlg.DeleteCur();
  887. return;
  888. }
  889. else if (m_radio == 2)
  890. {
  891. if (IsHasRightsnew(2) == 0)return;
  892. m_childdlg.DeleteCur();
  893. return;
  894. }
  895. else if (m_radio == 3)
  896. {
  897. if (IsHasRightsnew(2) == 0)return;
  898. m_childdlg.DeleteCur();
  899. return;
  900. }
  901. else if (m_radio == 4)
  902. {
  903. if (IsHasRightsnew(2) == 0)return;
  904. m_childdlg.DeleteCur();
  905. return;
  906. }
  907. else if (m_radio == 5)
  908. {
  909. return;
  910. pos = m_List6.GetFirstSelectedItemPosition();
  911. if (pos == NULL)
  912. {
  913. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  914. return;
  915. }
  916. int iItem;
  917. while (pos)
  918. {
  919. iItem = m_List6.GetNextSelectedItem(pos);
  920. array.Add(m_List6.GetItemText(iItem, 16));
  921. array.Add(m_List6.GetItemText(iItem, 17));
  922. }
  923. }
  924. SendMsgDlg dlg;
  925. dlg.m_pArray = &array;
  926. dlg.DoModal();
  927. }
  928. void TodayForm2::OnBUTtake3()
  929. {
  930. // TODO: Add your control notification handler code here
  931. if (IsHasRights2new(2) == 0)return;
  932. SearchTake dlg;
  933. dlg.DoModal();
  934. DateChange();
  935. }
  936. void TodayForm2::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  937. {
  938. // TODO: Add your control notification handler code here
  939. POSITION pos;
  940. pos = m_List1.GetFirstSelectedItemPosition();
  941. if (pos == NULL)return;
  942. int iItem = m_List1.GetNextSelectedItem(pos);
  943. g_id = m_List1.GetItemText(iItem, 0);
  944. *pResult = 0;
  945. }
  946. void TodayForm2::OnClickList3(NMHDR* pNMHDR, LRESULT* pResult)
  947. {
  948. // TODO: Add your control notification handler code here
  949. POSITION pos;
  950. pos = m_List2.GetFirstSelectedItemPosition();
  951. if (pos == NULL)return;
  952. int iItem = m_List2.GetNextSelectedItem(pos);
  953. g_id = m_List2.GetItemText(iItem, 0);
  954. *pResult = 0;
  955. }
  956. void TodayForm2::OnClickList4(NMHDR* pNMHDR, LRESULT* pResult)
  957. {
  958. // TODO: Add your control notification handler code here
  959. POSITION pos;
  960. pos = m_List3.GetFirstSelectedItemPosition();
  961. if (pos == NULL)return;
  962. int iItem = m_List3.GetNextSelectedItem(pos);
  963. g_id = m_List3.GetItemText(iItem, 0);
  964. *pResult = 0;
  965. }
  966. void TodayForm2::OnClickList7(NMHDR* pNMHDR, LRESULT* pResult)
  967. {
  968. // TODO: Add your control notification handler code here
  969. POSITION pos;
  970. pos = m_List4.GetFirstSelectedItemPosition();
  971. if (pos == NULL)return;
  972. int iItem = m_List4.GetNextSelectedItem(pos);
  973. g_id = m_List4.GetItemText(iItem, 0);
  974. *pResult = 0;
  975. }
  976. void TodayForm2::OnClickList8(NMHDR* pNMHDR, LRESULT* pResult)
  977. {
  978. // TODO: Add your control notification handler code here
  979. POSITION pos;
  980. pos = m_List5.GetFirstSelectedItemPosition();
  981. if (pos == NULL)return;
  982. int iItem = m_List5.GetNextSelectedItem(pos);
  983. g_id = m_List5.GetItemText(iItem, 0);
  984. *pResult = 0;
  985. }
  986. void TodayForm2::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  987. {
  988. // TODO: Add your control notification handler code here
  989. if (IsHasRights2new(1) == 0)return;
  990. g_pMainWnd->OnOutbarNotify("拍照");
  991. *pResult = 0;
  992. }
  993. void TodayForm2::OnDblclkList3(NMHDR* pNMHDR, LRESULT* pResult)
  994. {
  995. // TODO: Add your control notification handler code here
  996. if (IsHasRights2new(15) == 0)return;
  997. // TODO: Add your control notification handler code here
  998. POSITION pos;
  999. pos = m_List2.GetFirstSelectedItemPosition();
  1000. if (pos == NULL)
  1001. {
  1002. return;
  1003. }
  1004. int iItem = m_List2.GetNextSelectedItem(pos);
  1005. CString id = m_List2.GetItemText(iItem, 0);
  1006. ChoosePhotoSkin2 dlg;
  1007. dlg.SetLiaPath("3.lia");
  1008. dlg.m_strOrderNumber = id;
  1009. dlg.m_path = g_path2 + "\\";
  1010. dlg.m_path += dlg.m_strOrderNumber;
  1011. dlg.m_path += "\\";
  1012. dlg.DoModal();
  1013. *pResult = 0;
  1014. }
  1015. void TodayForm2::OnDblclkList4(NMHDR* pNMHDR, LRESULT* pResult)
  1016. {
  1017. // TODO: Add your control notification handler code here
  1018. if (IsHasRights2new(15) == 0)return;
  1019. // TODO: Add your control notification handler code here
  1020. POSITION pos;
  1021. pos = m_List3.GetFirstSelectedItemPosition();
  1022. if (pos == NULL)
  1023. {
  1024. return;
  1025. }
  1026. int iItem = m_List3.GetNextSelectedItem(pos);
  1027. CString id = m_List3.GetItemText(iItem, 0);
  1028. ChoosePhotoSkin2 dlg;
  1029. dlg.m_Runingmode = 1;
  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. }