DigitalWork.cpp 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. // DigitalWork.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "DigitalWork.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "InputPsw.h"
  9. #include "TakeMoney2.h"
  10. #include "ClientRequirement.h"
  11. #include "./helper/ffsco.h"
  12. #include "DigitalWorkSet.h"
  13. #include "DigitalWorkSet2.h"
  14. #include "SearchFilter3.h"
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20. #pragma comment(lib, "Shlwapi.lib")
  21. /////////////////////////////////////////////////////////////////////////////
  22. // DigitalWork
  23. IMPLEMENT_DYNCREATE(DigitalWork, MyFormView)
  24. DigitalWork::DigitalWork()
  25. : MyFormView(DigitalWork::IDD)
  26. {
  27. //{{AFX_DATA_INIT(DigitalWork)
  28. m_filter = _T("");
  29. m_nAdd=0;
  30. //}}AFX_DATA_INIT
  31. if(g_bAllBranch)
  32. {
  33. m_nAdd=1;
  34. }
  35. }
  36. DigitalWork::~DigitalWork()
  37. {
  38. }
  39. void DigitalWork::DoDataExchange(CDataExchange* pDX)
  40. {
  41. MyFormView::DoDataExchange(pDX);
  42. //{{AFX_DATA_MAP(DigitalWork)
  43. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  44. DDX_Control(pDX, IDC_LIST2, m_List1);
  45. DDX_Control(pDX, IDC_STATIC1, m_static1);
  46. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  47. //}}AFX_DATA_MAP
  48. }
  49. BEGIN_MESSAGE_MAP(DigitalWork, MyFormView)
  50. //{{AFX_MSG_MAP(DigitalWork)
  51. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  52. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  53. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  54. ON_WM_TIMER()
  55. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  56. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  57. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  58. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  59. ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
  60. ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
  61. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  62. ON_BN_CLICKED(IDC_BUTimportphoto2, OnBUTimportphoto2)
  63. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  64. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  65. //}}AFX_MSG_MAP
  66. END_MESSAGE_MAP()
  67. /////////////////////////////////////////////////////////////////////////////
  68. // DigitalWork diagnostics
  69. #ifdef _DEBUG
  70. void DigitalWork::AssertValid() const
  71. {
  72. MyFormView::AssertValid();
  73. }
  74. void DigitalWork::Dump(CDumpContext& dc) const
  75. {
  76. MyFormView::Dump(dc);
  77. }
  78. #endif //_DEBUG
  79. /////////////////////////////////////////////////////////////////////////////
  80. // DigitalWork message handlers
  81. void DigitalWork::OnInitialUpdate()
  82. {
  83. MyFormView::OnInitialUpdate();
  84. // TODO: Add your specialized code here and/or call the base class
  85. CMyMdi Mdi;
  86. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  87. // Here we create the outbar control using the splitter as its parent
  88. // and setting its id to the first pane.
  89. CRect rc2;
  90. GetWindowRect(rc2);
  91. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  92. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
  93. int idarray[]={IDC_BUTimportphoto,IDC_BUTexportphoto,IDC_BUTshowphoto,IDC_BUTclose};
  94. int idcount=4;
  95. int btnwid;
  96. CRect prerc;
  97. for(int a=idcount-2; a>=0; a--)
  98. {
  99. GetDlgItem(idarray[a+1])->GetWindowRect (prerc);
  100. ScreenToClient(prerc);
  101. GetDlgItem(idarray[a])->GetWindowRect (rc2);
  102. ScreenToClient(rc2);
  103. btnwid=rc2.Width ();
  104. rc2.right =prerc.left ;
  105. rc2.left =rc2.right -btnwid;
  106. GetDlgItem(idarray[a])->MoveWindow (rc2);
  107. }
  108. m_static1.SetFont (&g_titlefont);
  109. if(g_bAllBranch==0)
  110. {
  111. #ifdef CHILD_VERSION
  112. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  113. #else
  114. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
  115. #endif
  116. m_List1.LoadColumnInfo (169);
  117. }
  118. else
  119. {
  120. #ifdef CHILD_VERSION
  121. m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  122. #else
  123. m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
  124. #endif
  125. m_List1.LoadColumnInfo (200);
  126. }
  127. m_combo1.AddString (g_user.name);
  128. m_combo1.GetWindowRect (rc2);
  129. ScreenToClient(rc2);
  130. rc2.bottom +=200;
  131. m_combo1.MoveWindow (rc2);
  132. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  133. SetComboHei(&m_combo1, rc2.Height ());
  134. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(IsHasRights2new(14));
  135. GetData();
  136. }
  137. int DigitalWork::FindName(CString name, CArray<CStringArray, CStringArray>*List1array)
  138. {
  139. for(int i=0; i<List1array->GetSize (); i++)
  140. {
  141. if(name==List1array->ElementAt (i).ElementAt (0))return i;
  142. }
  143. return -1;
  144. }
  145. void DigitalWork::FillGrid(BOOL bStatus)
  146. {
  147. if(g_bSearchFilter)
  148. {
  149. m_List1.DeleteAllItems2 ();
  150. int ii=0;
  151. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  152. int count=0;
  153. {
  154. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  155. {
  156. if(g_filterdate1!="")
  157. {
  158. if(m_List1array.ElementAt (ii).ElementAt (11+m_nAdd)<g_filterdate1 || m_List1array.ElementAt (ii).ElementAt (11+m_nAdd)>g_filterdate2)
  159. continue;
  160. }
  161. if(g_filterdate3!="")
  162. {
  163. if(m_List1array.ElementAt (ii).ElementAt (12+m_nAdd)<g_filterdate3 || m_List1array.ElementAt (ii).ElementAt (12+m_nAdd)>g_filterdate4)
  164. continue;
  165. }
  166. if(g_filterdate5!="")
  167. {
  168. if(m_List1array.ElementAt (ii).ElementAt (9+m_nAdd)<g_filterdate5 || m_List1array.ElementAt (ii).ElementAt (9+m_nAdd)>g_filterdate6)
  169. continue;
  170. }
  171. if(g_waiter1!="")
  172. {
  173. if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find (g_waiter1)==-1 )
  174. continue;
  175. }
  176. if(g_waiter2!="")
  177. {
  178. if(m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_waiter2)==-1 )
  179. continue;
  180. }
  181. if(g_waiter3!="")
  182. {
  183. if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find (g_waiter3)==-1 )
  184. continue;
  185. }
  186. if(g_waiter4!="")
  187. {
  188. if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_waiter4)==-1 )
  189. continue;
  190. }
  191. if(g_bAllBranch && g_filterbranch!="")
  192. {
  193. if(m_List1array.ElementAt (ii).ElementAt (0)!=g_filterbranch)
  194. continue;
  195. }
  196. if(1)
  197. {
  198. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  199. }
  200. }
  201. }
  202. m_List1.m_arLabels.SetSize(count, 1);
  203. ii=count;
  204. m_List1.m_LabelCount=ii;
  205. m_List1.SetItemCountEx (ii);
  206. CString str;
  207. str.Format ("单数:%d", ii);
  208. SetDlgItemText(IDC_STATIC2, str);
  209. }
  210. else
  211. {
  212. m_List1.DeleteAllItems2 ();
  213. int ii=0;
  214. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  215. int count=0;
  216. if(m_filter.IsEmpty ())
  217. {
  218. if(bStatus==1)
  219. {
  220. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  221. {
  222. if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find("OK")==-1)
  223. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  224. }
  225. }
  226. else if(bStatus==2)
  227. {
  228. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  229. {
  230. if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find("OK")==-1)
  231. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  232. }
  233. }
  234. else if(bStatus==3)
  235. {
  236. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  237. {
  238. if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find("OK")==-1)
  239. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  240. }
  241. }
  242. else
  243. {
  244. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  245. {
  246. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  247. }
  248. }
  249. }
  250. else
  251. {
  252. if(bStatus==1)
  253. {
  254. int type=GetType(m_filter);
  255. if(type==1)//电话
  256. {
  257. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  258. {
  259. if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (16+m_nAdd).Find (m_filter)!=-1 || \
  260. m_List1array.ElementAt (ii).ElementAt (17+m_nAdd).Find (m_filter)!=-1))
  261. {
  262. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  263. }
  264. }
  265. }
  266. else if(type==2)//拼音
  267. {
  268. m_filter.MakeUpper ();
  269. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  270. {
  271. if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find("OK")==-1 && (m_List1array.ElementAt (ii).ElementAt (18+m_nAdd).Find (m_filter)!=-1 || \
  272. m_List1array.ElementAt (ii).ElementAt (19+m_nAdd).Find (m_filter)!=-1))
  273. {
  274. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  275. }
  276. }
  277. }
  278. else
  279. {
  280. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  281. {
  282. if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  283. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
  284. m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
  285. m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
  286. m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 || \
  287. m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1 || \
  288. m_List1array.ElementAt (ii).ElementAt (16).Find (m_filter)!=-1 || \
  289. m_List1array.ElementAt (ii).ElementAt (17).Find (m_filter)!=-1 || \
  290. m_List1array.ElementAt (ii).ElementAt (18).Find (m_filter)!=-1 ))
  291. {
  292. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  293. }
  294. }
  295. }
  296. }
  297. else if(bStatus==2)
  298. {
  299. int type=GetType(m_filter);
  300. if(type==1)//电话
  301. {
  302. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  303. {
  304. if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (16+m_nAdd).Find (m_filter)!=-1 || \
  305. m_List1array.ElementAt (ii).ElementAt (17+m_nAdd).Find (m_filter)!=-1))
  306. {
  307. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  308. }
  309. }
  310. }
  311. else if(type==2)//拼音
  312. {
  313. m_filter.MakeUpper ();
  314. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  315. {
  316. if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find("OK")==-1 && (m_List1array.ElementAt (ii).ElementAt (18+m_nAdd).Find (m_filter)!=-1 || \
  317. m_List1array.ElementAt (ii).ElementAt (19+m_nAdd).Find (m_filter)!=-1))
  318. {
  319. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  320. }
  321. }
  322. }
  323. else
  324. {
  325. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  326. {
  327. if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  328. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
  329. m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
  330. m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
  331. m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 || \
  332. m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1 || \
  333. m_List1array.ElementAt (ii).ElementAt (16).Find (m_filter)!=-1 || \
  334. m_List1array.ElementAt (ii).ElementAt (17).Find (m_filter)!=-1 || \
  335. m_List1array.ElementAt (ii).ElementAt (18).Find (m_filter)!=-1 ))
  336. {
  337. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  338. }
  339. }
  340. }
  341. }
  342. else if(bStatus==3)
  343. {
  344. int type=GetType(m_filter);
  345. if(type==1)//电话
  346. {
  347. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  348. {
  349. if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (16+m_nAdd).Find (m_filter)!=-1 || \
  350. m_List1array.ElementAt (ii).ElementAt (17+m_nAdd).Find (m_filter)!=-1))
  351. {
  352. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  353. }
  354. }
  355. }
  356. else if(type==2)//拼音
  357. {
  358. m_filter.MakeUpper ();
  359. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  360. {
  361. if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find("OK")==-1 && (m_List1array.ElementAt (ii).ElementAt (18+m_nAdd).Find (m_filter)!=-1 || \
  362. m_List1array.ElementAt (ii).ElementAt (19+m_nAdd).Find (m_filter)!=-1))
  363. {
  364. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  365. }
  366. }
  367. }
  368. else
  369. {
  370. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  371. {
  372. if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  373. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
  374. m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
  375. m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
  376. m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 || \
  377. m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1 || \
  378. m_List1array.ElementAt (ii).ElementAt (16).Find (m_filter)!=-1 || \
  379. m_List1array.ElementAt (ii).ElementAt (17).Find (m_filter)!=-1 || \
  380. m_List1array.ElementAt (ii).ElementAt (18).Find (m_filter)!=-1 ))
  381. {
  382. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  383. }
  384. }
  385. }
  386. }
  387. else
  388. {
  389. int type=GetType(m_filter);
  390. if(type==1)//电话
  391. {
  392. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  393. {
  394. if(m_List1array.ElementAt (ii).ElementAt (16+m_nAdd).Find (m_filter)!=-1 || \
  395. m_List1array.ElementAt (ii).ElementAt (17+m_nAdd).Find (m_filter)!=-1)
  396. {
  397. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  398. }
  399. }
  400. }
  401. else if(type==2)//拼音
  402. {
  403. m_filter.MakeUpper ();
  404. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  405. {
  406. if(m_List1array.ElementAt (ii).ElementAt (18+m_nAdd).Find (m_filter)!=-1 || \
  407. m_List1array.ElementAt (ii).ElementAt (19+m_nAdd).Find (m_filter)!=-1)
  408. {
  409. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  410. }
  411. }
  412. }
  413. else
  414. {
  415. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  416. {
  417. if(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  418. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
  419. m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
  420. m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
  421. m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 || \
  422. m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1 || \
  423. m_List1array.ElementAt (ii).ElementAt (16).Find (m_filter)!=-1 || \
  424. m_List1array.ElementAt (ii).ElementAt (17).Find (m_filter)!=-1 || \
  425. m_List1array.ElementAt (ii).ElementAt (18).Find (m_filter)!=-1 )
  426. {
  427. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  428. }
  429. }
  430. }
  431. }
  432. }
  433. m_List1.m_arLabels.SetSize(count, 1);
  434. ii=count;
  435. m_List1.m_LabelCount=ii;
  436. m_List1.SetItemCountEx (ii);
  437. CString str;
  438. str.Format ("单数:%d", ii);
  439. SetDlgItemText(IDC_STATIC2, str);
  440. }
  441. if(!g_id.IsEmpty ())
  442. {
  443. for(int i=0; i<m_List1.GetItemCount (); i++)
  444. {
  445. if(g_id==m_List1.GetItemText (i, 0+m_nAdd))
  446. {
  447. m_List1.SetItemState(i,LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED);
  448. m_List1.EnsureVisible(i,FALSE);
  449. break;
  450. }
  451. }
  452. }
  453. }
  454. void DigitalWork::OnBUTclose()
  455. {
  456. // TODO: Add your control notification handler code here
  457. GetParent()->SendMessage(WM_CLOSE);
  458. }
  459. void DigitalWork::OnSelchangeCombo1()
  460. {
  461. // TODO: Add your control notification handler code here
  462. SetTimer(1, 100, NULL);
  463. }
  464. void DigitalWork::OnTimer(UINT nIDEvent)
  465. {
  466. // TODO: Add your message handler code here and/or call default
  467. KillTimer(nIDEvent);
  468. OnButton1();
  469. }
  470. BOOL DigitalWork::PreTranslateMessage(MSG* pMsg)
  471. {
  472. // TODO: Add your specialized code here and/or call the base class
  473. try
  474. {
  475. if(pMsg->message==WM_KEYDOWN)
  476. {
  477. switch (pMsg->wParam)
  478. {
  479. case VK_RETURN:
  480. OnButton1();
  481. return 1;
  482. case 0x43: // copy
  483. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  484. {
  485. GetFocus()->SendMessage(WM_COPY);
  486. return TRUE;
  487. }
  488. break;
  489. case 0x56: //Ctrl + V:
  490. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  491. {
  492. GetFocus()->SendMessage(WM_PASTE);
  493. return TRUE;
  494. }
  495. break;
  496. case 0x58: // cut
  497. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  498. {
  499. GetFocus()->SendMessage(WM_CUT);
  500. return TRUE;
  501. }
  502. break;
  503. case 0x5A: //undo
  504. case 0x59: //redo
  505. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  506. {
  507. GetFocus()->SendMessage(WM_UNDO);
  508. return TRUE;
  509. }
  510. break;
  511. }
  512. }
  513. else if(pMsg->message==WM_LBUTTONDBLCLK)
  514. {
  515. CPoint pt;
  516. CRect rc,rc2;
  517. ::GetCursorPos (&pt);
  518. m_List1.GetWindowRect (rc2);
  519. if(rc2.PtInRect (pt)==0) return MyFormView::PreTranslateMessage(pMsg);
  520. pt.x-=rc2.left ;
  521. pt.y-=rc2.top ;
  522. POSITION pos;
  523. pos=m_List1.GetFirstSelectedItemPosition();
  524. if(pos==NULL)return MyFormView::PreTranslateMessage(pMsg);
  525. int iItem=m_List1.GetNextSelectedItem(pos);
  526. m_List1.GetSubItemRect( iItem, 8, LVIR_BOUNDS, rc);
  527. if(rc.PtInRect (pt))
  528. {
  529. CClientRequirement dlg;
  530. dlg.m_bz2=m_List1.GetItemText (iItem, 8);
  531. dlg.m_bSave =0;
  532. dlg.DoModal ();
  533. }
  534. }
  535. return MyFormView::PreTranslateMessage(pMsg);
  536. }
  537. catch(...)
  538. {
  539. }
  540. }
  541. void DigitalWork::GetSavePath(CString &path)
  542. {
  543. }
  544. int DigitalWork::FindArray(CStringArray *pArray, CString Str)
  545. {
  546. return -1;
  547. }
  548. void DigitalWork::GetNo(CString str, CStringArray &array)
  549. {
  550. }
  551. CString DigitalWork::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  552. {
  553. return "";
  554. }
  555. void DigitalWork::OnButton1()
  556. {
  557. // TODO: Add your control notification handler code here
  558. UpdateData();
  559. m_filter.TrimLeft ();
  560. m_filter.TrimRight ();
  561. FillGrid();
  562. }
  563. void DigitalWork::OnButton2()
  564. {
  565. // TODO: Add your control notification handler code here
  566. UpdateData();
  567. m_filter.TrimLeft ();
  568. m_filter.TrimRight ();
  569. FillGrid(1);
  570. }
  571. void DigitalWork::OnButton3()
  572. {
  573. // TODO: Add your control notification handler code here
  574. UpdateData();
  575. m_filter.TrimLeft ();
  576. m_filter.TrimRight ();
  577. FillGrid(2);
  578. }
  579. void DigitalWork::OnButton4()
  580. {
  581. // TODO: Add your control notification handler code here
  582. UpdateData();
  583. m_filter.TrimLeft ();
  584. m_filter.TrimRight ();
  585. FillGrid(3);
  586. }
  587. void DigitalWork::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  588. {
  589. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  590. // TODO: Add your control notification handler code here
  591. *pResult = 0;
  592. }
  593. void DigitalWork::OnBUTimportphoto2()
  594. {
  595. }
  596. void DigitalWork::OnBUTimportphoto()
  597. {
  598. if(IsHasRights2new(14)==0)return;
  599. // TODO: Add your control notification handler code here
  600. POSITION pos;
  601. pos=m_List1.GetFirstSelectedItemPosition();
  602. if(pos==NULL)
  603. {
  604. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  605. return;
  606. }
  607. int iItem;
  608. CStringArray idarray;
  609. CStringArray brancharray;
  610. CStringArray namearray1;
  611. CStringArray namearray2;
  612. while (pos)
  613. {
  614. iItem = m_List1.GetNextSelectedItem(pos);
  615. idarray.Add (m_List1.GetItemText (iItem, 0+m_nAdd));
  616. namearray1.Add (m_List1.GetItemText (iItem, 1+m_nAdd));
  617. namearray2.Add (m_List1.GetItemText (iItem, 2+m_nAdd));
  618. if(g_bAllBranch)
  619. brancharray.Add (m_List1.GetItemText (iItem, 0));
  620. }
  621. if(idarray.GetSize()>20)
  622. {
  623. AfxMessageBox("一次最多安排20个客人!", MB_ICONINFORMATION);
  624. return;
  625. }
  626. DigitalWorkSet dlg;
  627. dlg.m_pArray=&idarray;
  628. dlg.m_pArrayBranch=&brancharray;
  629. dlg.m_pArrayName1=&namearray1;
  630. dlg.m_pArrayName2=&namearray2;
  631. dlg.m_pExistWorkArray=&m_workarray;
  632. if(dlg.DoModal()==IDOK)
  633. {
  634. if(g_bAllBranch)
  635. {
  636. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  637. }
  638. GetData();
  639. }
  640. }
  641. void DigitalWork::OnBUTexportphoto()
  642. {
  643. DigitalWorkSet2 dlg;
  644. dlg.DoModal ();
  645. }
  646. void DigitalWork::OnBUTshowphoto()
  647. {
  648. DigitalWorkSet2 dlg;
  649. dlg.m_mode=1;
  650. dlg.DoModal ();
  651. }
  652. void DigitalWork::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  653. {
  654. // TODO: Add your control notification handler code here
  655. POSITION pos;
  656. pos=m_List1.GetFirstSelectedItemPosition();
  657. if(pos==NULL)return;
  658. int iItem=m_List1.GetNextSelectedItem(pos);
  659. g_id = m_List1.GetItemText (iItem, 0+m_nAdd);
  660. *pResult = 0;
  661. }
  662. void DigitalWork::GetData()
  663. {
  664. if(g_bAllBranch)
  665. {
  666. GetData2();
  667. return;
  668. }
  669. if(g_bShowOK==0)
  670. {
  671. #ifdef LKAY_VERSION
  672. CString filter="status3='未取' and status<>'未拍' and (dindantype<>'意向客户' or dindantype is null);";
  673. #else
  674. CString filter="status3='未取' and status<>'未拍';";
  675. #endif
  676. g_sendhead.bsql=0;
  677. g_sendhead.code[0]=135;
  678. g_sendhead.code[1]=136;
  679. g_sendhead.tabcount=2;
  680. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  681. }
  682. else
  683. {
  684. #ifdef LKAY_VERSION
  685. CString filter="status<>'未拍' and (dindantype<>'意向客户' or dindantype is null);";
  686. #else
  687. CString filter="status<>'未拍';";
  688. #endif
  689. g_sendhead.bsql=0;
  690. g_sendhead.code[0]=135;
  691. g_sendhead.code[1]=136;
  692. g_sendhead.tabcount=2;
  693. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  694. }
  695. DataToArray(&m_List1array,&g_List1array);
  696. HidePrice();
  697. for(int i=0; i<g_List1array.GetSize (); i++)
  698. {
  699. for(int j=0; j<m_List1array.GetSize (); j++)
  700. {
  701. if(g_List1array.ElementAt (i).ElementAt (0)==m_List1array.ElementAt (j).ElementAt (0))
  702. {
  703. m_List1array.ElementAt (j).SetAt (4, m_List1array.ElementAt (j).ElementAt (4)+g_List1array.ElementAt (i).ElementAt (1));
  704. m_List1array.ElementAt (j).SetAt (6, m_List1array.ElementAt (j).ElementAt (6)+g_List1array.ElementAt (i).ElementAt (3));
  705. m_List1array.ElementAt (j).SetAt (7, m_List1array.ElementAt (j).ElementAt (7)+g_List1array.ElementAt (i).ElementAt (5));
  706. }
  707. }
  708. }
  709. FillGrid();
  710. m_workarray.RemoveAll ();
  711. //m_workarray
  712. CString str,name;
  713. int pos;
  714. for( i=0; i<m_List1array.GetSize (); i++)
  715. {
  716. str=m_List1array.ElementAt (i).ElementAt (4);
  717. if(str.Find ("OK")==-1)
  718. {
  719. pos=str.Find ("/");
  720. str=str.Right (str.GetLength ()-pos-1);
  721. if(str!="")
  722. {
  723. pos=FindName(str, &m_workarray);
  724. if(pos==-1)
  725. {
  726. pos=m_workarray.GetSize ()+1;
  727. m_workarray.SetSize(pos, 1);
  728. pos--;
  729. m_workarray.ElementAt (pos).Add (str);
  730. m_workarray.ElementAt (pos).Add ("1");
  731. m_workarray.ElementAt (pos).Add ("0");
  732. m_workarray.ElementAt (pos).Add ("0");
  733. }
  734. else
  735. {
  736. str=m_workarray.ElementAt (pos).ElementAt (1);
  737. str.Format ("%d", atoi(str)+1);
  738. m_workarray.ElementAt (pos).SetAt (1, str);
  739. }
  740. }
  741. }
  742. str=m_List1array.ElementAt (i).ElementAt (6);
  743. if(str.Find ("OK")==-1)
  744. {
  745. pos=str.Find ("/");
  746. str=str.Right (str.GetLength ()-pos-1);
  747. if(str!="")
  748. {
  749. pos=FindName(str, &m_workarray);
  750. if(pos==-1)
  751. {
  752. pos=m_workarray.GetSize ()+1;
  753. m_workarray.SetSize(pos, 1);
  754. pos--;
  755. m_workarray.ElementAt (pos).Add (str);
  756. m_workarray.ElementAt (pos).Add ("0");
  757. m_workarray.ElementAt (pos).Add ("1");
  758. m_workarray.ElementAt (pos).Add ("0");
  759. }
  760. else
  761. {
  762. str=m_workarray.ElementAt (pos).ElementAt (2);
  763. str.Format ("%d", atoi(str)+1);
  764. m_workarray.ElementAt (pos).SetAt (2, str);
  765. }
  766. }
  767. }
  768. str=m_List1array.ElementAt (i).ElementAt (7);
  769. if(str.Find ("OK")==-1)
  770. {
  771. pos=str.Find ("/");
  772. str=str.Right (str.GetLength ()-pos-1);
  773. if(str!="")
  774. {
  775. pos=FindName(str, &m_workarray);
  776. if(pos==-1)
  777. {
  778. pos=m_workarray.GetSize ()+1;
  779. m_workarray.SetSize(pos, 1);
  780. pos--;
  781. m_workarray.ElementAt (pos).Add (str);
  782. m_workarray.ElementAt (pos).Add ("0");
  783. m_workarray.ElementAt (pos).Add ("0");
  784. m_workarray.ElementAt (pos).Add ("1");
  785. }
  786. else
  787. {
  788. str=m_workarray.ElementAt (pos).ElementAt (3);
  789. str.Format ("%d", atoi(str)+1);
  790. m_workarray.ElementAt (pos).SetAt (3, str);
  791. }
  792. }
  793. }
  794. }
  795. }
  796. void DigitalWork::HidePrice()
  797. {
  798. #ifdef LKAY_VERSION
  799. if(IsHasRights2new(31))return;
  800. for(int i=0; i< m_List1array.GetSize (); i++)
  801. {
  802. m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***");
  803. m_List1array.ElementAt (i).SetAt (15+m_nAdd, "***");
  804. m_List1array.ElementAt (i).SetAt (16+m_nAdd, "***");
  805. m_List1array.ElementAt (i).SetAt (17+m_nAdd, "***");
  806. }
  807. #else
  808. if(IsHasRights2new(31))return;
  809. for(int i=0; i< m_List1array.GetSize (); i++)
  810. {
  811. m_List1array.ElementAt (i).SetAt (16+m_nAdd, "***");
  812. m_List1array.ElementAt (i).SetAt (17+m_nAdd, "***");
  813. }
  814. #endif
  815. }
  816. void DigitalWork::GetData2()
  817. {
  818. g_List1array.RemoveAll ();
  819. m_List1array.RemoveAll ();
  820. CString branch;
  821. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  822. {
  823. if(i!=-1)
  824. {
  825. branch=g_brancharray.ElementAt (i).ElementAt (0);
  826. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  827. g_pMainWnd->OnDisconnect();
  828. g_branchname=branch;
  829. g_bBranchModify=1;
  830. }
  831. else
  832. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  833. if(g_bShowOK==0)
  834. {
  835. CString filter="status3='未取' and status<>'未拍';";
  836. g_sendhead.bsql=0;
  837. g_sendhead.code[0]=135;
  838. g_sendhead.code[1]=136;
  839. g_sendhead.tabcount=2;
  840. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
  841. }
  842. else
  843. {
  844. CString filter="status<>'未拍';";
  845. g_sendhead.bsql=0;
  846. g_sendhead.code[0]=135;
  847. g_sendhead.code[1]=136;
  848. g_sendhead.tabcount=2;
  849. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
  850. }
  851. CArray<CStringArray, CStringArray>List1array;
  852. CArray<CStringArray, CStringArray>List2array;
  853. DataToArray(&List1array,&List2array);
  854. int size=m_List1array.GetSize ();
  855. for(int j=0; j<List1array.GetSize (); j++)
  856. {
  857. size++;
  858. m_List1array.SetSize(size , 1 );
  859. size--;
  860. m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
  861. m_List1array.ElementAt (size).InsertAt (0, branch);
  862. size++;
  863. }
  864. size=g_List1array.GetSize ();
  865. for( j=0; j<List2array.GetSize (); j++)
  866. {
  867. size++;
  868. g_List1array.SetSize(size , 1 );
  869. size--;
  870. g_List1array.ElementAt (size).Copy (List2array.ElementAt (j));
  871. g_List1array.ElementAt (size).InsertAt (0, branch);
  872. size++;
  873. }
  874. }
  875. g_pMainWnd->OnDisconnect();
  876. g_bBranchModify=0;g_branchip=g_branchname="";
  877. HidePrice();
  878. for( i=0; i<g_List1array.GetSize (); i++)
  879. {
  880. for(int j=0; j<m_List1array.GetSize (); j++)
  881. {
  882. if(g_List1array.ElementAt (i).ElementAt (0)==m_List1array.ElementAt (j).ElementAt (0) && g_List1array.ElementAt (i).ElementAt (1)==m_List1array.ElementAt (j).ElementAt (1))
  883. {
  884. m_List1array.ElementAt (j).SetAt (4+m_nAdd, m_List1array.ElementAt (j).ElementAt (4+m_nAdd)+g_List1array.ElementAt (i).ElementAt (1+m_nAdd));
  885. m_List1array.ElementAt (j).SetAt (6+m_nAdd, m_List1array.ElementAt (j).ElementAt (6+m_nAdd)+g_List1array.ElementAt (i).ElementAt (3+m_nAdd));
  886. m_List1array.ElementAt (j).SetAt (7+m_nAdd, m_List1array.ElementAt (j).ElementAt (7+m_nAdd)+g_List1array.ElementAt (i).ElementAt (5+m_nAdd));
  887. }
  888. }
  889. }
  890. FillGrid();
  891. m_workarray.RemoveAll ();
  892. //m_workarray
  893. CString str,name;
  894. int pos;
  895. for( i=0; i<m_List1array.GetSize (); i++)
  896. {
  897. str=m_List1array.ElementAt (i).ElementAt (4+m_nAdd);
  898. if(str.Find ("OK")==-1)
  899. {
  900. pos=str.Find ("/");
  901. str=str.Right (str.GetLength ()-pos-1);
  902. if(str!="")
  903. {
  904. pos=FindName(str, &m_workarray);
  905. if(pos==-1)
  906. {
  907. pos=m_workarray.GetSize ()+1;
  908. m_workarray.SetSize(pos, 1);
  909. pos--;
  910. m_workarray.ElementAt (pos).Add (str);
  911. m_workarray.ElementAt (pos).Add ("1");
  912. m_workarray.ElementAt (pos).Add ("0");
  913. m_workarray.ElementAt (pos).Add ("0");
  914. }
  915. else
  916. {
  917. str=m_workarray.ElementAt (pos).ElementAt (1);
  918. str.Format ("%d", atoi(str)+1);
  919. m_workarray.ElementAt (pos).SetAt (1, str);
  920. }
  921. }
  922. }
  923. str=m_List1array.ElementAt (i).ElementAt (6+m_nAdd);
  924. if(str.Find ("OK")==-1)
  925. {
  926. pos=str.Find ("/");
  927. str=str.Right (str.GetLength ()-pos-1);
  928. if(str!="")
  929. {
  930. pos=FindName(str, &m_workarray);
  931. if(pos==-1)
  932. {
  933. pos=m_workarray.GetSize ()+1;
  934. m_workarray.SetSize(pos, 1);
  935. pos--;
  936. m_workarray.ElementAt (pos).Add (str);
  937. m_workarray.ElementAt (pos).Add ("0");
  938. m_workarray.ElementAt (pos).Add ("1");
  939. m_workarray.ElementAt (pos).Add ("0");
  940. }
  941. else
  942. {
  943. str=m_workarray.ElementAt (pos).ElementAt (2);
  944. str.Format ("%d", atoi(str)+1);
  945. m_workarray.ElementAt (pos).SetAt (2, str);
  946. }
  947. }
  948. }
  949. str=m_List1array.ElementAt (i).ElementAt (7+m_nAdd);
  950. if(str.Find ("OK")==-1)
  951. {
  952. pos=str.Find ("/");
  953. str=str.Right (str.GetLength ()-pos-1);
  954. if(str!="")
  955. {
  956. pos=FindName(str, &m_workarray);
  957. if(pos==-1)
  958. {
  959. pos=m_workarray.GetSize ()+1;
  960. m_workarray.SetSize(pos, 1);
  961. pos--;
  962. m_workarray.ElementAt (pos).Add (str);
  963. m_workarray.ElementAt (pos).Add ("0");
  964. m_workarray.ElementAt (pos).Add ("0");
  965. m_workarray.ElementAt (pos).Add ("1");
  966. }
  967. else
  968. {
  969. str=m_workarray.ElementAt (pos).ElementAt (3);
  970. str.Format ("%d", atoi(str)+1);
  971. m_workarray.ElementAt (pos).SetAt (3, str);
  972. }
  973. }
  974. }
  975. }
  976. }
  977. void DigitalWork::OnBtnsearchfilter()
  978. {
  979. // TODO: Add your control notification handler code here
  980. SearchFilter3 dlg;
  981. if(dlg.DoModal ()==IDOK)
  982. {
  983. FillGrid();
  984. }
  985. g_bSearchFilter=0;
  986. }