DigitalWork.cpp 28 KB

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