DigitalWork.cpp 28 KB

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