DinDanHistroy.cpp 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200
  1. // DinDanHistroy.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "DinDanHistroy.h"
  6. #include "MyMdi.h"
  7. #include "ModifyDinDan.h"
  8. #include "ClientDlg.h"
  9. #include "ClientDlg2.h"
  10. #include "./helper/ffsco.h"
  11. #include "Booking2.h"
  12. #include "SelExportType.h"
  13. #ifdef _DEBUG
  14. #define new DEBUG_NEW
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. #pragma comment(lib, "Shlwapi.lib")
  19. ////////////////////////////////////////////////////////////////////IDC_BUTprint
  20. // DinDanHistroy IDC_COMBO5
  21. IMPLEMENT_DYNCREATE(DinDanHistroy, MyFormView)
  22. DinDanHistroy::DinDanHistroy()
  23. : MyFormView(DinDanHistroy::IDD)
  24. {
  25. //{{AFX_DATA_INIT(DinDanHistroy)
  26. m_filter = _T("");
  27. m_radio1 = 3;
  28. //}}AFX_DATA_INIT
  29. }
  30. DinDanHistroy::~DinDanHistroy()
  31. {
  32. }
  33. void DinDanHistroy::DoDataExchange(CDataExchange* pDX)
  34. {
  35. MyFormView::DoDataExchange(pDX);
  36. //{{AFX_DATA_MAP(DinDanHistroy)
  37. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  38. DDX_Control(pDX, IDC_LIST2, m_List1);
  39. DDX_Control(pDX, IDC_STATIC1, m_static1);
  40. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  41. DDX_Radio(pDX, IDC_RADIO1, m_radio1);
  42. //}}AFX_DATA_MAP
  43. }
  44. BEGIN_MESSAGE_MAP(DinDanHistroy, MyFormView)
  45. //{{AFX_MSG_MAP(DinDanHistroy)
  46. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  47. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  48. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  49. ON_WM_TIMER()
  50. ON_BN_CLICKED(IDC_BUTmodify3, OnBUTmodify3)
  51. ON_BN_CLICKED(IDC_BUTmodify4, OnBUTmodify4)
  52. ON_BN_CLICKED(IDC_BUTmodify, OnBUTmodify)
  53. ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
  54. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  55. ON_BN_CLICKED(IDC_BUTclient, OnBUTclient)
  56. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  57. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  58. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList1)
  59. ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
  60. ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
  61. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  62. ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
  63. ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
  64. ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
  65. //}}AFX_MSG_MAP
  66. END_MESSAGE_MAP()
  67. /////////////////////////////////////////////////////////////////////////////
  68. // DinDanHistroy diagnostics
  69. #ifdef _DEBUG
  70. void DinDanHistroy::AssertValid() const
  71. {
  72. MyFormView::AssertValid();
  73. }
  74. void DinDanHistroy::Dump(CDumpContext& dc) const
  75. {
  76. MyFormView::Dump(dc);
  77. }
  78. #endif //_DEBUG
  79. /////////////////////////////////////////////////////////////////////////////
  80. // DinDanHistroy message handlers
  81. extern void SetComboHei(CComboBox *pCombo, int hei);
  82. void DinDanHistroy::OnInitialUpdate()
  83. {
  84. MyFormView::OnInitialUpdate();
  85. CMyMdi Mdi;
  86. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  87. #ifndef LKAY_VERSION
  88. GetDlgItem(IDC_STATIC4)->ShowWindow(0);
  89. GetDlgItem(IDC_RADIO1)->ShowWindow(0);
  90. GetDlgItem(IDC_RADIO3)->ShowWindow(0);
  91. GetDlgItem(IDC_RADIO4)->ShowWindow(0);
  92. GetDlgItem(IDC_RADIO6)->ShowWindow(0);
  93. GetDlgItem(IDC_RADIO7)->ShowWindow(0);
  94. #endif
  95. CRect rc2;
  96. GetWindowRect(rc2);
  97. int dty = g_screenhei - 768;
  98. if (dty > 0)
  99. {
  100. g_rc.bottom -= dty;
  101. MoveWindow(g_rc);
  102. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  103. g_rc.bottom += dty;
  104. MoveWindow(g_rc);
  105. }
  106. else
  107. {
  108. MoveWindow(g_rc);
  109. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  110. }
  111. int idarray[] = { IDC_BUTmodify, IDC_BUTclient, IDC_BUTprint3, IDC_BUTmodify3, IDC_BUTclose };
  112. int idcount = 5;
  113. int btnwid;
  114. CRect prerc;
  115. for (int a = idcount - 2; a >= 0; a--)
  116. {
  117. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  118. ScreenToClient(prerc);
  119. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  120. ScreenToClient(rc2);
  121. btnwid = rc2.Width();
  122. rc2.right = prerc.left;
  123. rc2.left = rc2.right - btnwid;
  124. GetDlgItem(idarray[a])->MoveWindow(rc2);
  125. }
  126. m_static1.SetFont(&g_titlefont);
  127. #ifdef CHILD_VERSION
  128. #ifdef LKAY_VERSION
  129. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;宝宝性别,100;生日,100;历别,100;类别,100;折扣,100;拍照,100;初修,100;选片,100;精修,100;设计,100;看设计,100;取件,100;预约时间,100;拍照时间,100;选片时间,100;看设计时间,100;取件时间,100;接单人,100;套系名称,100;套系价格,100;摄影师,100;化妆师,100;初修,100;选片,100;精修,100;设计师,100;看设计,100;录单,100;手机,100;固定电话,100;拍摄合同,100;选片合同,100" );
  130. #else
  131. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;类别,100;来源,100;拍照,100;初修,100;选片,100;精修,100;设计,100;看设计,100;取件,100;预约时间,100;拍照时间,100;选片时间,100;看设计时间,100;取件时间,100;接单人,100;套系名称,100;套系价格,100;摄影师,100;化妆师,100;初修,100;选片,100;精修,100;设计师,100;看设计,100;录单,100;折扣,100;授权,100;折扣(后),100;授权(后),100;手机,100;固定电话,100");
  132. #endif
  133. #else
  134. #ifdef ZHIAI_VERSION
  135. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;预约点,100;类别,100;折扣,100;拍照,100;初修,100;选片,100;精修,100;设计,100;看设计,100;取件,100;预约时间,100;拍照时间,100;选片时间,100;看设计时间,100;取件时间,100;接单人,100;套系名称,100;套系价格,100;摄影师,100;化妆师,100;初修,100;选片,100;精修,100;设计师,100;看设计,100;录单,100;男宾电话,100;女宾电话,100" );
  136. #else
  137. #ifdef LYFZ_VERSION
  138. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;类别,100;来源,100;拍照,100;初修,100;选片,100;精修,100;设计,100;看设计,100;取件,100;预约时间,100;年服务费日期,100;选片时间,100;看设计时间,100;取件时间,100;接单人,100;套系名称,100;套系价格,100;摄影师,100;化妆师,100;初修,100;选片,100;精修,100;设计师,100;看设计,100;录单,100;折扣,100;授权,100;折扣(后),100;授权(后),100;男宾电话,100;女宾电话,100" );
  139. #else
  140. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;类别,100;来源,100;拍照,100;初修,100;选片,100;精修,100;设计,100;看设计,100;取件,100;预约时间,100;拍照时间,100;选片时间,100;看设计时间,100;取件时间,100;接单人,100;套系名称,100;套系价格,100;摄影师,100;化妆师,100;初修,100;选片,100;精修,100;设计师,100;看设计,100;录单,100;折扣,100;授权,100;折扣(后),100;授权(后),100;男宾电话,100;女宾电话,100" );
  141. #endif
  142. #endif
  143. #endif
  144. m_List1.LoadColumnInfo(109);
  145. #ifdef ZHIAI_VERSION
  146. m_nadd=2;
  147. #else
  148. m_nadd = 1;
  149. #endif
  150. GetData();
  151. m_combo1.AddString(g_user.name);
  152. for (int i = 0; i < g_userarray.GetSize(); i++)
  153. {
  154. m_combo1.AddString(g_userarray.ElementAt(i).ElementAt(1));
  155. }
  156. FillGrid();
  157. m_combo1.GetWindowRect(rc2);
  158. ScreenToClient(rc2);
  159. rc2.bottom += 200;
  160. m_combo1.MoveWindow(rc2);
  161. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  162. SetComboHei(&m_combo1, rc2.Height());
  163. GetDlgItem(IDC_BUTprint3)->EnableWindow(IsHasRights2new(49));
  164. GetDlgItem(IDC_BUTprint)->EnableWindow(IsHasRights2new(3));
  165. GetDlgItem(IDC_BUTclient)->EnableWindow(IsHasRights2new(1));
  166. }
  167. void DinDanHistroy::FillGrid2()
  168. {
  169. int m_nadd2 = m_nadd;
  170. m_nadd2 -= 3;
  171. if (g_bSearchFilter)
  172. {
  173. m_List1.DeleteAllItems2();
  174. int ii = 0;
  175. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  176. int count = 0;
  177. {
  178. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  179. {
  180. if (g_filterdate1 != "")
  181. {
  182. if (m_List1array.ElementAt(ii).ElementAt(14 + m_nadd2) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(14 + m_nadd2) > g_filterdate2)
  183. continue;
  184. }
  185. if (g_waiter1 != "")
  186. {
  187. if (m_List1array.ElementAt(ii).ElementAt(19 + m_nadd2) != g_waiter1)
  188. continue;
  189. }
  190. if (g_waiter2 != "")
  191. {
  192. if (m_List1array.ElementAt(ii).ElementAt(22 + m_nadd2) != g_waiter2)
  193. continue;
  194. }
  195. if (g_waiter3 != "")
  196. {
  197. if (m_List1array.ElementAt(ii).ElementAt(23 + m_nadd2) != g_waiter3)
  198. continue;
  199. }
  200. if (1)
  201. {
  202. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  203. }
  204. }
  205. }
  206. m_List1.m_arLabels.SetSize(count, 1);
  207. ii = count;
  208. m_List1.m_LabelCount = ii;
  209. m_List1.SetItemCountEx(ii);
  210. CString str;
  211. str.Format("单数:%d", ii);
  212. SetDlgItemText(IDC_STATIC2, str);
  213. }
  214. else
  215. {
  216. m_List1.DeleteAllItems2();
  217. int ii = 0;
  218. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  219. int count = 0;
  220. if (m_filter.IsEmpty())
  221. {
  222. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  223. {
  224. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  225. }
  226. }
  227. else
  228. {
  229. int type = GetType(m_filter);
  230. if (type == 1)//电话
  231. {
  232. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  233. {
  234. if (m_List1array.ElementAt(ii).ElementAt(30 + m_nadd2).Find(m_filter) != -1 || \
  235. m_List1array.ElementAt(ii).ElementAt(31 + m_nadd2).Find(m_filter) != -1)
  236. {
  237. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  238. }
  239. }
  240. }
  241. else if (type == 2)//拼音
  242. {
  243. m_filter.MakeUpper();
  244. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  245. {
  246. if (m_List1array.ElementAt(ii).ElementAt(32 + m_nadd2).Find(m_filter) != -1 || \
  247. m_List1array.ElementAt(ii).ElementAt(33 + m_nadd2).Find(m_filter) != -1)
  248. {
  249. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  250. }
  251. }
  252. }
  253. else
  254. {
  255. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  256. {
  257. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  258. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  259. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  260. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  261. m_List1array.ElementAt(ii).ElementAt(19 + m_nadd2).Find(m_filter) != -1 || \
  262. m_List1array.ElementAt(ii).ElementAt(20 + m_nadd2).Find(m_filter) != -1 || \
  263. m_List1array.ElementAt(ii).ElementAt(22 + m_nadd2).Find(m_filter) != -1 || \
  264. m_List1array.ElementAt(ii).ElementAt(23 + m_nadd2).Find(m_filter) != -1 || \
  265. m_List1array.ElementAt(ii).ElementAt(33 + m_nadd2).Find(m_filter) != -1 || \
  266. m_List1array.ElementAt(ii).ElementAt(30 + m_nadd2).Find(m_filter) != -1 || \
  267. m_List1array.ElementAt(ii).ElementAt(31 + m_nadd2).Find(m_filter) != -1 || \
  268. m_List1array.ElementAt(ii).ElementAt(32 + m_nadd2).Find(m_filter) != -1)
  269. {
  270. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  271. }
  272. }
  273. }
  274. }
  275. m_List1.m_arLabels.SetSize(count, 1);
  276. ii = count;
  277. m_List1.m_LabelCount = ii;
  278. m_List1.SetItemCountEx(ii);
  279. CString str;
  280. str.Format("单数:%d", ii);
  281. SetDlgItemText(IDC_STATIC2, str);
  282. }
  283. }
  284. void DinDanHistroy::FillGrid()
  285. {
  286. #ifdef ZHIAI_VERSION
  287. FillGrid2();return;
  288. #endif
  289. int m_nadd2 = 0;
  290. #ifdef LKAY_VERSION
  291. m_nadd2+=2;
  292. #endif
  293. if (g_bSearchFilter)
  294. {
  295. m_List1.DeleteAllItems2();
  296. int ii = 0;
  297. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  298. int count = 0;
  299. {
  300. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  301. {
  302. if (g_filterdate1 != "")
  303. {
  304. if (m_List1array.ElementAt(ii).ElementAt(11 + m_nadd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(11 + m_nadd) > g_filterdate2)
  305. continue;
  306. }
  307. if (g_waiter1 != "")
  308. {
  309. if (m_List1array.ElementAt(ii).ElementAt(16 + m_nadd) != g_waiter1)
  310. continue;
  311. }
  312. if (g_waiter2 != "")
  313. {
  314. if (m_List1array.ElementAt(ii).ElementAt(19 + m_nadd) != g_waiter2)
  315. continue;
  316. }
  317. if (g_waiter3 != "")
  318. {
  319. if (m_List1array.ElementAt(ii).ElementAt(20 + m_nadd) != g_waiter3)
  320. continue;
  321. }
  322. if (g_waiter4 != "")
  323. {
  324. if (m_List1array.ElementAt(ii).ElementAt(3) != g_waiter4)
  325. continue;
  326. }
  327. if (g_waiter5 != "")
  328. {
  329. if (m_List1array.ElementAt(ii).ElementAt(4) != g_waiter5)
  330. continue;
  331. }
  332. if (1)
  333. {
  334. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  335. }
  336. }
  337. }
  338. m_List1.m_arLabels.SetSize(count, 1);
  339. ii = count;
  340. m_List1.m_LabelCount = ii;
  341. m_List1.SetItemCountEx(ii);
  342. CString str;
  343. str.Format("单数:%d", ii);
  344. SetDlgItemText(IDC_STATIC2, str);
  345. }
  346. else
  347. {
  348. m_List1.DeleteAllItems2();
  349. int ii = 0;
  350. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  351. int count = 0;
  352. if (m_filter.IsEmpty())
  353. {
  354. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  355. {
  356. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  357. }
  358. }
  359. else
  360. {
  361. int type = GetType(m_filter);
  362. if (type == 1)//电话
  363. {
  364. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  365. {
  366. if (m_List1array.ElementAt(ii).ElementAt(32 + m_nadd).Find(m_filter) != -1 || \
  367. m_List1array.ElementAt(ii).ElementAt(31 + m_nadd).Find(m_filter) != -1)
  368. {
  369. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  370. }
  371. }
  372. }
  373. else if (type == 2)//拼音
  374. {
  375. m_filter.MakeUpper();
  376. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  377. {
  378. if (m_List1array.ElementAt(ii).ElementAt(34 + m_nadd + m_nadd2).Find(m_filter) != -1 || \
  379. m_List1array.ElementAt(ii).ElementAt(33 + m_nadd + m_nadd2).Find(m_filter) != -1)
  380. {
  381. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  382. }
  383. }
  384. }
  385. else
  386. {
  387. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  388. {
  389. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  390. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  391. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  392. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  393. m_List1array.ElementAt(ii).ElementAt(16 + m_nadd).Find(m_filter) != -1 || \
  394. m_List1array.ElementAt(ii).ElementAt(17 + m_nadd).Find(m_filter) != -1 || \
  395. m_List1array.ElementAt(ii).ElementAt(19 + m_nadd).Find(m_filter) != -1 || \
  396. m_List1array.ElementAt(ii).ElementAt(20 + m_nadd).Find(m_filter) != -1 || \
  397. m_List1array.ElementAt(ii).ElementAt(34 + m_nadd).Find(m_filter) != -1 || \
  398. m_List1array.ElementAt(ii).ElementAt(31 + m_nadd).Find(m_filter) != -1 || \
  399. m_List1array.ElementAt(ii).ElementAt(32 + m_nadd).Find(m_filter) != -1 || \
  400. m_List1array.ElementAt(ii).ElementAt(33 + m_nadd).Find(m_filter) != -1)
  401. {
  402. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  403. }
  404. }
  405. }
  406. }
  407. m_List1.m_arLabels.SetSize(count, 1);
  408. ii = count;
  409. m_List1.m_LabelCount = ii;
  410. m_List1.SetItemCountEx(ii);
  411. CString str;
  412. str.Format("单数:%d", ii);
  413. SetDlgItemText(IDC_STATIC2, str);
  414. }
  415. if (!g_id.IsEmpty())
  416. {
  417. for (int i = 0; i < m_List1.GetItemCount(); i++)
  418. {
  419. if (g_id == m_List1.GetItemText(i, 0))
  420. {
  421. m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  422. m_List1.EnsureVisible(i, FALSE);
  423. break;
  424. }
  425. }
  426. }
  427. }
  428. void DinDanHistroy::OnBUTclose()
  429. {
  430. // TODO: Add your control notification handler code here
  431. GetParent()->SendMessage(WM_CLOSE);
  432. }
  433. extern void SaveImageToFile(Image *img, CString path);
  434. void DinDanHistroy::OnButton1()
  435. {
  436. // TODO: Add your control notification handler code here
  437. /*
  438. Image *img=NULL;
  439. ::LoadImageFromBuf (&img, "e:\\1x.jpg");
  440. if(img->GetWidth())
  441. {
  442. CRect rc(0,0,1000,1000);
  443. RectFitDes(img->GetWidth(), img->GetHeight(), rc);
  444. Image *simg= img->GetThumbnailImage(rc.Width (), rc.Height (), NULL, NULL);
  445. Graphics graphic(simg);//防止GetThumbnailImage影响质量
  446. graphic.DrawImage(img, 0,0,simg->GetWidth(), simg->GetHeight() );
  447. delete img;
  448. ::SaveImageToFile(simg, "e:\\1x2.jpg");
  449. delete simg;
  450. }*/
  451. UpdateData();
  452. m_filter.TrimLeft();
  453. m_filter.TrimRight();
  454. FillGrid();
  455. }
  456. void DinDanHistroy::OnSelchangeCombo1()
  457. {
  458. // TODO: Add your control notification handler code here
  459. SetTimer(1, 100, NULL);
  460. }
  461. void DinDanHistroy::OnTimer(UINT nIDEvent)
  462. {
  463. // TODO: Add your message handler code here and/or call default
  464. KillTimer(nIDEvent);
  465. OnButton1();
  466. }
  467. void DinDanHistroy::OnBUTmodify3()
  468. {
  469. #ifdef LYFZ_VERSION
  470. return;
  471. #endif
  472. POSITION pos;
  473. pos = m_List1.GetFirstSelectedItemPosition();
  474. if (pos == NULL)
  475. {
  476. return;
  477. }
  478. int iItem = m_List1.GetNextSelectedItem(pos);
  479. int g_nYearposTemp = g_nYearpos;
  480. g_nYearpos = atoi(m_List1.GetItemText(iItem, 36));
  481. g_pMainWnd->PrintDinDan(m_List1.GetItemText(iItem, 0));
  482. g_nYearpos = g_nYearposTemp;
  483. }
  484. void DinDanHistroy::OnBUTmodify4()
  485. {
  486. POSITION pos;
  487. pos = m_List1.GetFirstSelectedItemPosition();
  488. if (pos == NULL)
  489. {
  490. return;
  491. }
  492. int iItem = m_List1.GetNextSelectedItem(pos);
  493. if (AfxMessageBox("完成后此单将存入历史数据库并不可修改, 确认吗?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
  494. CString m_id = m_List1.GetItemText(iItem, 0);
  495. {
  496. CString sql = "update dindan set [status3]='OK',[time5]='" + g_date + "' where id='" + m_id + "'";
  497. g_sendhead.bsql = 1;
  498. g_pMainWnd->ProcessChatMessageRequest2(sql);
  499. if (g_bSendOK == 0)return;
  500. #if JEFF_TEST_ON
  501. // 2015-05-30 若取件状态OK,写日志;
  502. CString strLog;
  503. strLog.Format(_T(" 订单:%s 在预约修改中被设置为取件OK"),m_id);
  504. WriteLog(_T("预约修改"), strLog);
  505. #endif
  506. }
  507. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  508. GetData();
  509. FillGrid();
  510. }
  511. BOOL DinDanHistroy::PreTranslateMessage(MSG* pMsg)
  512. {
  513. // TODO: Add your c code here and/or call the base class
  514. try
  515. {
  516. if (pMsg->message == WM_KEYDOWN)
  517. {
  518. // CString ss;
  519. // ss.Format ("%d", pMsg->wParam);
  520. // MessageBox(ss);
  521. switch (pMsg->wParam)
  522. {
  523. case VK_RETURN:
  524. OnButton1();
  525. return 1;
  526. case VK_F9:
  527. // GetClientPhone();
  528. return 1;
  529. case 0x43: // copy
  530. if ((GetKeyState(VK_CONTROL) & 0x80))
  531. {
  532. GetFocus()->SendMessage(WM_COPY);
  533. return TRUE;
  534. }
  535. break;
  536. case 0x56: //Ctrl + V:
  537. if ((GetKeyState(VK_CONTROL) & 0x80))
  538. {
  539. GetFocus()->SendMessage(WM_PASTE);
  540. return TRUE;
  541. }
  542. break;
  543. case 0x58: // cut
  544. if ((GetKeyState(VK_CONTROL) & 0x80))
  545. {
  546. GetFocus()->SendMessage(WM_CUT);
  547. return TRUE;
  548. }
  549. break;
  550. case 0x5A: //undo
  551. case 0x59: //redo
  552. if ((GetKeyState(VK_CONTROL) & 0x80))
  553. {
  554. GetFocus()->SendMessage(WM_UNDO);
  555. return TRUE;
  556. }
  557. break;
  558. }
  559. }
  560. return MyFormView::PreTranslateMessage(pMsg);
  561. }
  562. catch (...)
  563. {
  564. }
  565. }
  566. //extern void DeleteDirectory(CString strDir);
  567. void DinDanHistroy::OnBUTprint()
  568. {
  569. // TODO: Add your control notification handler code here
  570. if (IsHasRights2new(3) == 0)return;
  571. POSITION pos;
  572. pos = m_List1.GetFirstSelectedItemPosition();
  573. if (pos == NULL)
  574. {
  575. return;
  576. }
  577. int iItem = m_List1.GetNextSelectedItem(pos);
  578. if (AfxMessageBox("警告! 此单相关资料将全部被删除? 确定吗?", MB_YESNO | MB_ICONSTOP) != IDYES)return;
  579. CString id = m_List1.GetItemText(iItem, 0);
  580. CString name1 = m_List1.GetItemText(iItem, 1);
  581. CString name2 = m_List1.GetItemText(iItem, 2);
  582. CString sql;
  583. sql = "delete from dindan where id='" + id + "'";
  584. sql += "***delete from dindansp where id='" + id + "'";
  585. sql += "***delete from dindansp2 where id='" + id + "'";
  586. sql += "***delete from dindansp3 where id='" + id + "'";
  587. sql += "***delete from photoprint where id='" + id + "'";
  588. sql += "***delete from dindanbukuan where id='" + id + "'";
  589. sql += "***delete from dindanbukuan2 where id='" + id + "'";
  590. sql += "***delete from client where [id]='" + id + "'";
  591. sql += "***delete from burncdreg where [id]='" + id + "'";
  592. sql += "***delete from digitalwork where [id]='" + id + "'";
  593. sql += "***delete from mywork where [id]='" + id + "'";
  594. sql += "***delete from dindanjd where [id]='" + id + "'";
  595. sql += "***" + GetLogStr("删除客人" + name1 + name2 + id + "订单!");
  596. g_sendhead.bsql = 1;
  597. g_pMainWnd->ProcessChatMessageRequest2(sql);
  598. id.TrimLeft();
  599. id.TrimRight();
  600. if (id.GetLength() > 3)
  601. {
  602. CString path;
  603. path = g_path1 + "\\";
  604. path += id;
  605. DeleteDirectory(path); // 递归删除原片;
  606. path = g_path2 + "\\";
  607. path += id;
  608. DeleteDirectory(path); // 递归删除初修;
  609. path = g_path3 + "\\";
  610. path += id;
  611. DeleteDirectory(path); // 递归删除精修;
  612. path = g_path4 + "\\";
  613. path += id;
  614. DeleteDirectory(path); // 递归删除设计;
  615. }
  616. GetData();
  617. FillGrid();
  618. }
  619. /*
  620. dindan
  621. dindansp
  622. dindansp2
  623. dindansp3
  624. photoprint
  625. dindanbukuan
  626. dindanbukuan2
  627. client
  628. burncdreg
  629. digitalwork
  630. mywork
  631. dindanjd
  632. delete from dindan
  633. delete from dindansp
  634. delete from dindansp2
  635. delete from dindansp3
  636. delete from photoprint
  637. delete from dindanbukuan
  638. delete from dindanbukuan2
  639. delete from client
  640. delete from burncdreg
  641. delete from digitalwork
  642. delete from mywork
  643. delete from dindanjd
  644. */
  645. void DinDanHistroy::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  646. {
  647. // TODO: Add your control notification handler code here
  648. OnBUTmodify();
  649. *pResult = 0;
  650. }
  651. void DinDanHistroy::OnBUTclient()
  652. {
  653. // TODO: Add your control notification handler code here
  654. POSITION pos;
  655. pos = m_List1.GetFirstSelectedItemPosition();
  656. if (pos == NULL)
  657. {
  658. return;
  659. }
  660. int iItem = m_List1.GetNextSelectedItem(pos);
  661. #ifdef CHILD_VERSION
  662. CClientDlg2 dlg;
  663. #else
  664. CClientDlg dlg;
  665. #endif
  666. dlg.m_bHistory = 1;
  667. dlg.m_bAdd = 0;
  668. dlg.id = m_List1.GetItemText(iItem, 0);
  669. dlg.m_name1 = m_List1.GetItemText(iItem, 1);
  670. dlg.m_name2 = m_List1.GetItemText(iItem, 2);
  671. int g_nYearposTemp = g_nYearpos;
  672. g_nYearpos = atoi(m_List1.GetItemText(iItem, 36));
  673. dlg.DoModal();
  674. g_nYearpos = g_nYearposTemp;
  675. }
  676. void DinDanHistroy::GetClientPhone()
  677. {
  678. SelExportType dlg;
  679. if (dlg.DoModal() != IDOK)return;
  680. if (dlg.m_type == 1)
  681. {
  682. ListToXLS(&m_List1, "c:\\历史订单.xls", 0);
  683. // Import2Excle(&m_List1, "E:\\历史订单.xls",0 , 0, -1, 10000);
  684. // Import2Excle(&m_List1, "E:\\历史订单1.xls",0 , 10000, -1, 12000);
  685. // Import2Excle(&m_List1, "E:\\历史订单2.xls",0 , 12000, -1, 14000);
  686. // Import2Excle(&m_List1, "E:\\历史订单3.xls",0 , 14000, -1, 16000);
  687. // Import2Excle(&m_List1, "E:\\历史订单4.xls",0 , 16000, -1, 18000);
  688. //Import2Excle(&m_List1, "C:\\历史订单.xls",0 , 0, -1, -1);
  689. return;
  690. }
  691. #ifdef LYFZ_VERSION
  692. CStdioFile fp;
  693. fp.Open ("c:\\clientphone.txt", CFile::modeCreate|CFile::modeWrite);
  694. CString str;
  695. CString name,m_name1,m_name2;
  696. CString phone,m_phone1,m_phone2;
  697. CString txname,txprice,mensi;
  698. int leng1=50;
  699. int leng2=40;
  700. int leng3=20;
  701. name="姓名";
  702. mensi="门市";
  703. phone="电话";
  704. FillLength(name, leng1);
  705. FillLength(mensi, leng3);
  706. FillLength(phone, leng2);
  707. str=name+phone+mensi+"\n";
  708. fp.WriteString (str);
  709. for(int i=0; i<m_List1.GetItemCount (); i++)
  710. {
  711. name.Empty ();
  712. phone.Empty ();
  713. m_name1=m_List1.GetItemText (i, 1);
  714. m_name2=m_List1.GetItemText (i, 2);
  715. m_phone1=m_List1.GetItemText (i, 31+m_nadd);
  716. m_phone2=m_List1.GetItemText (i, 32+m_nadd);
  717. mensi=m_List1.GetItemText (i, 16+m_nadd);
  718. if(!m_name1.IsEmpty ())
  719. name=m_name1+",";
  720. name+=m_name2;
  721. name.TrimRight (",");
  722. if(!m_phone1.IsEmpty ())
  723. phone=m_phone1+",";
  724. phone+=m_phone2;phone.TrimRight (",");
  725. FillLength(name, leng1);
  726. FillLength(mensi, leng3);
  727. FillLength(phone, leng2);
  728. str=name+phone+mensi+"\n";
  729. fp.WriteString (str);
  730. }
  731. fp.Close ();
  732. MessageBox("电话已保存到c:\\clientphone.txt");
  733. ShellExecute(NULL, _T("open"), _T("c:\\clientphone.txt"), NULL, NULL, SW_SHOWMAXIMIZED);
  734. #else
  735. #ifdef LKAY_VERSION
  736. CStdioFile fp;
  737. fp.Open ("c:\\clientphone.txt", CFile::modeCreate|CFile::modeWrite);
  738. CString str;
  739. CString name,m_name1,m_name2;
  740. CString phone,m_phone1,m_phone2;
  741. CString txname,txprice,mensi,sex,birthday,date;
  742. int leng1=23;
  743. int leng2=10;
  744. int leng3=18;
  745. int leng4=13;
  746. int leng5=30;
  747. int leng6=30;
  748. int leng7=13;
  749. int leng8=20;
  750. name="姓名";
  751. sex="性别";
  752. birthday="生日";
  753. mensi="门市";
  754. phone="电话";
  755. txname="套系";
  756. txprice="价格";
  757. date="拍摄日期";
  758. FillLength(name, leng1);
  759. FillLength(sex, leng2);
  760. FillLength(birthday, leng3);
  761. FillLength(mensi, leng4);
  762. FillLength(phone, leng5);
  763. FillLength(txname, leng6);
  764. FillLength(txprice,leng7);
  765. FillLength(date,leng8);
  766. str=name+sex+birthday+mensi+phone+txname+txprice+date+"\n";
  767. fp.WriteString (str);
  768. for(int i=0; i<m_List1.m_arLabels.GetSize (); i++)
  769. {
  770. // if(atof(m_List1.GetItemText (i, 15))<600)continue;
  771. name.Empty ();
  772. phone.Empty ();
  773. m_name1=m_List1.m_arLabels.ElementAt(i).ElementAt(1);
  774. m_name2=m_List1.m_arLabels.ElementAt(i).ElementAt(2);
  775. m_phone1=m_List1.m_arLabels.ElementAt(i).ElementAt(30+m_nadd);
  776. m_phone2=m_List1.m_arLabels.ElementAt(i).ElementAt(31+m_nadd);
  777. mensi=m_List1.m_arLabels.ElementAt(i).ElementAt(19+m_nadd);
  778. txname=m_List1.m_arLabels.ElementAt(i).ElementAt(20+m_nadd);
  779. txprice=m_List1.m_arLabels.ElementAt(i).ElementAt(21+m_nadd);
  780. date=m_List1.m_arLabels.ElementAt(i).ElementAt(16);
  781. sex=m_List1.m_arLabels.ElementAt(i).ElementAt(3);
  782. birthday=m_List1.m_arLabels.ElementAt(i).ElementAt(4);
  783. if(birthday!="" && m_List1.m_arLabels.ElementAt(i).ElementAt(5)=="农历")
  784. birthday+="(农)";
  785. if(!m_name1.IsEmpty ())
  786. name=m_name1+",";
  787. name+=m_name2;
  788. name.TrimRight (",");
  789. if(!m_phone1.IsEmpty ())
  790. phone=m_phone1+",";
  791. phone+=m_phone2;phone.TrimRight (",");
  792. FillLength(name, leng1);
  793. FillLength(sex, leng2);
  794. FillLength(birthday, leng3);
  795. FillLength(mensi, leng4);
  796. FillLength(phone, leng5);
  797. FillLength(txname, leng6);
  798. FillLength(txprice,leng7);
  799. FillLength(date,leng8);
  800. str=name+sex+birthday+mensi+phone+txname+txprice+date+"\n";
  801. fp.WriteString (str);
  802. }
  803. fp.Close ();
  804. MessageBox("电话已保存到c:\\clientphone.txt");
  805. ShellExecute(NULL, _T("open"), _T("c:\\clientphone.txt"), NULL, NULL, SW_SHOWMAXIMIZED);
  806. #else
  807. CStdioFile fp;
  808. fp.Open("c:\\clientphone.txt", CFile::modeCreate | CFile::modeWrite);
  809. CString str;
  810. CString name, m_name1, m_name2;
  811. CString phone, m_phone1, m_phone2;
  812. CString txname, txprice, mensi, type, from;
  813. int leng1 = 26;
  814. int leng2 = 20;
  815. int leng3 = 30;
  816. int leng4 = 20;
  817. int leng5 = 20;
  818. int leng6 = 20;
  819. int leng7 = 20;
  820. name = "姓名";
  821. mensi = "门市";
  822. phone = "电话";
  823. txname = "套系";
  824. txprice = "价格";
  825. type = "套系类别";
  826. from = "来源";
  827. FillLength(name, leng1);
  828. FillLength(mensi, leng2);
  829. FillLength(phone, leng3);
  830. FillLength(txname, leng4);
  831. FillLength(txprice, leng5);
  832. FillLength(type, leng6);
  833. FillLength(from, leng7);
  834. str = name + mensi + phone + txname + txprice + type + from + "\n";
  835. fp.WriteString(str);
  836. for (int i = 0; i < m_List1.GetItemCount(); i++)
  837. {
  838. // if(atof(m_List1.GetItemText (i, 15))<600)continue;
  839. name.Empty();
  840. phone.Empty();
  841. m_name1 = m_List1.GetItemText(i, 1);
  842. m_name2 = m_List1.GetItemText(i, 2);
  843. m_phone1 = m_List1.GetItemText(i, 31 + m_nadd);
  844. m_phone2 = m_List1.GetItemText(i, 32 + m_nadd);
  845. mensi = m_List1.GetItemText(i, 16 + m_nadd);
  846. txname = m_List1.GetItemText(i, 17 + m_nadd);
  847. txprice = m_List1.GetItemText(i, 18 + m_nadd);
  848. type = m_List1.GetItemText(i, 3);
  849. from = m_List1.GetItemText(i, 4);
  850. if (!m_name1.IsEmpty())
  851. name = m_name1 + ",";
  852. name += m_name2;
  853. name.TrimRight(",");
  854. if (!m_phone1.IsEmpty())
  855. phone = m_phone1 + ",";
  856. phone += m_phone2; phone.TrimRight(",");
  857. FillLength(name, leng1);
  858. FillLength(mensi, leng2);
  859. FillLength(phone, leng3);
  860. FillLength(txname, leng4);
  861. FillLength(txprice, leng5);
  862. FillLength(type, leng6);
  863. FillLength(from, leng7);
  864. str = name + mensi + phone + txname + txprice + type + from + "\n";
  865. fp.WriteString(str);
  866. }
  867. fp.Close();
  868. MessageBox("电话已保存到c:\\clientphone.txt");
  869. ShellExecute(NULL, _T("open"), _T("c:\\clientphone.txt"), NULL, NULL, SW_SHOWMAXIMIZED);
  870. #endif
  871. #endif
  872. }
  873. void DinDanHistroy::OnBUTmodify()
  874. {
  875. POSITION pos;
  876. pos = m_List1.GetFirstSelectedItemPosition();
  877. if (pos == NULL)
  878. {
  879. return;
  880. }
  881. int iItem = m_List1.GetNextSelectedItem(pos);
  882. Booking2 dlg;
  883. dlg.m_id = m_List1.GetItemText(iItem, 0);
  884. dlg.m_bModify = 2;
  885. int g_nYearposTemp = g_nYearpos;
  886. g_nYearpos = atoi(m_List1.GetItemText(iItem, 36));
  887. dlg.DoModal();
  888. g_nYearpos = g_nYearposTemp;
  889. }
  890. void DinDanHistroy::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  891. {
  892. // TODO: Add your control notification handler code here
  893. *pResult = 0;
  894. }
  895. void DinDanHistroy::OnBUTprint3()
  896. {
  897. // TODO: Add your control notification handler code here
  898. GetClientPhone();
  899. }
  900. void DinDanHistroy::OnCustomdrawList1(NMHDR* pNMHDR, LRESULT* pResult)
  901. {
  902. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  903. // Take the default processing unless we set this to something else below.
  904. *pResult = 0;
  905. // First thing - check the draw stage. If it's the control's prepaint
  906. // stage, then tell Windows we want messages for every item.
  907. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  908. {
  909. *pResult = CDRF_NOTIFYITEMDRAW;
  910. }
  911. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  912. {
  913. // This is the prepaint stage for an item. Here's where we set the
  914. // item's text color. Our return value will tell Windows to draw the
  915. // item itself, but it will use the new color we set here.
  916. // We'll cycle the colors through red, green, and light blue.
  917. #ifdef ZHIAI_VERSION
  918. if(atof(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (5))<5.0 || (atof(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7))<5.0)&&m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7)!="" )
  919. {
  920. pLVCD->clrText = RGB(220,0,0);
  921. }
  922. else if(atof(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (5))<8.0 || (atof(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7))<8.0)&&m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7)!="" )
  923. {
  924. pLVCD->clrText = RGB(255,255,0);
  925. }
  926. else if(atof(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (5))==0 && atof(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7))==0)
  927. {
  928. pLVCD->clrText = RGB(0,0,0);
  929. }
  930. #else
  931. if (atof(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(28)) < 5.0 || (atof(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(30)) < 5.0) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(30) != "")
  932. {
  933. pLVCD->clrText = RGB(220, 0, 0);
  934. }
  935. else if (atof(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(28)) < 8.0 || (atof(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(30)) < 8.0) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(30) != "")
  936. {
  937. pLVCD->clrText = RGB(255, 255, 0);
  938. }
  939. else if (atof(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(28)) == 0 && atof(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(30)) == 0)
  940. {
  941. pLVCD->clrText = RGB(0, 0, 0);
  942. }
  943. #endif
  944. else
  945. {
  946. pLVCD->clrText = RGB(20, 133, 20);
  947. }
  948. if (pLVCD->nmcd.dwItemSpec % 2)
  949. pLVCD->clrTextBk = g_gridcol1;
  950. else
  951. pLVCD->clrTextBk = g_gridcol2;
  952. // Store the color back in the NMLVCUSTOMDRAW struct.
  953. // Tell Windows to paint the control itself.
  954. *pResult = CDRF_DODEFAULT;
  955. }
  956. }
  957. void DinDanHistroy::HidePrice()
  958. {
  959. #ifdef LKAY_VERSION
  960. if(IsHasRights2new(31))return;
  961. for(int i=0; i< m_List1array.GetSize (); i++)
  962. {
  963. m_List1array.ElementAt (i).SetAt (21, "***");
  964. m_List1array.ElementAt (i).SetAt (22, "***");
  965. m_List1array.ElementAt (i).SetAt (31, "***");
  966. m_List1array.ElementAt (i).SetAt (32, "***");
  967. }
  968. #else
  969. if (IsHasRights2new(31) == 0)
  970. {
  971. for (int i = 0; i < m_List1array.GetSize(); i++)
  972. {
  973. m_List1array.ElementAt(i).SetAt(32, "***");
  974. m_List1array.ElementAt(i).SetAt(33, "***");
  975. }
  976. }
  977. if (IsHasRights2new(50) == 0)
  978. {
  979. for (int i = 0; i < m_List1array.GetSize(); i++)
  980. {
  981. m_List1array.ElementAt(i).SetAt(28, "***");
  982. m_List1array.ElementAt(i).SetAt(29, "***");
  983. m_List1array.ElementAt(i).SetAt(30, "***");
  984. m_List1array.ElementAt(i).SetAt(31, "***");
  985. }
  986. }
  987. #endif
  988. #ifdef LYFZ_VERSION
  989. if(IsHasRights2new(49))return;
  990. for(int i=0; i< m_List1array.GetSize (); i++)
  991. {
  992. m_List1array.ElementAt (i).SetAt (28, "");
  993. m_List1array.ElementAt (i).SetAt (19, "");
  994. }
  995. #endif
  996. }
  997. void DinDanHistroy::OnRadio1()
  998. {
  999. UpdateData(); GetData(); FillGrid();
  1000. }
  1001. void DinDanHistroy::OnRadio3()
  1002. {
  1003. OnRadio1();
  1004. }
  1005. void DinDanHistroy::OnRadio4()
  1006. {
  1007. OnRadio1();
  1008. }
  1009. void DinDanHistroy::OnRadio6()
  1010. {
  1011. OnRadio1();
  1012. }
  1013. void DinDanHistroy::OnRadio7()
  1014. {
  1015. OnRadio1();
  1016. }
  1017. extern CString GetDindanType(int type);
  1018. void DinDanHistroy::GetData()
  1019. {
  1020. #ifdef ZHIAI_VERSION
  1021. if(g_bShowOK==0)
  1022. {
  1023. CString filter="status3='未取'";
  1024. g_sendhead.bsql=0;
  1025. g_sendhead.code[0]=151;
  1026. g_sendhead.tabcount=1;
  1027. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  1028. }
  1029. else
  1030. {
  1031. g_sendhead.bsql=0;
  1032. g_sendhead.code[0]=151;
  1033. g_sendhead.tabcount=1;
  1034. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  1035. }
  1036. #else
  1037. #ifdef LKAY_VERSION
  1038. g_sendhead.bsql=0;
  1039. g_sendhead.code[0]=217;
  1040. g_sendhead.tabcount=1;
  1041. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  1042. #else
  1043. g_sendhead.bsql = 0;
  1044. g_sendhead.code[0] = 226;
  1045. g_sendhead.tabcount = 1;
  1046. g_pMainWnd->ProcessChatMessageRequest2(1);
  1047. if (g_bSendOK == 0)return;
  1048. #endif
  1049. #endif
  1050. DataToArray(&m_List1array);
  1051. HidePrice();
  1052. if (g_sInfo == "")
  1053. {
  1054. CString m_edit1 = (g_cominfoarray.ElementAt(0).ElementAt(10));
  1055. CString m_edit2 = (g_cominfoarray.ElementAt(0).ElementAt(11));
  1056. CString m_edit3 = (g_cominfoarray.ElementAt(0).ElementAt(12));
  1057. CString m_edit4 = (g_cominfoarray.ElementAt(0).ElementAt(14));
  1058. CString m_edit5 = g_cominfoarray.ElementAt(0).ElementAt(0);
  1059. CString separator = "*%!X";
  1060. g_sInfo.Format("%s%s%s%s%s%s%s%s%s%s%s%scurdan/%d",
  1061. g_domain, separator, m_edit1, separator, m_edit2,
  1062. separator, m_edit3,
  1063. separator, m_edit4,
  1064. separator, m_edit5,
  1065. separator, m_List1array.GetSize());
  1066. g_ncot = m_List1array.GetSize();
  1067. }
  1068. }
  1069. void DinDanHistroy::OnBtnsearchfilter()
  1070. {
  1071. SearchFilter dlg;
  1072. dlg.m_mode = 0;
  1073. if (dlg.DoModal() == IDOK)FillGrid();
  1074. g_bSearchFilter = 0;
  1075. }