DigitalWork.cpp 29 KB

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