DigitalWork.cpp 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  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. int i = 0;
  701. for( i=0; i<g_List1array.GetSize (); i++)
  702. {
  703. for(int j=0; j<m_List1array.GetSize (); j++)
  704. {
  705. if(g_List1array.ElementAt (i).ElementAt (0)==m_List1array.ElementAt (j).ElementAt (0))
  706. {
  707. m_List1array.ElementAt (j).SetAt (4, m_List1array.ElementAt (j).ElementAt (4)+g_List1array.ElementAt (i).ElementAt (1));
  708. m_List1array.ElementAt (j).SetAt (6, m_List1array.ElementAt (j).ElementAt (6)+g_List1array.ElementAt (i).ElementAt (3));
  709. m_List1array.ElementAt (j).SetAt (7, m_List1array.ElementAt (j).ElementAt (7)+g_List1array.ElementAt (i).ElementAt (5));
  710. }
  711. }
  712. }
  713. FillGrid();
  714. m_workarray.RemoveAll ();
  715. //m_workarray
  716. CString str,name;
  717. int pos;
  718. for( i=0; i<m_List1array.GetSize (); i++)
  719. {
  720. str=m_List1array.ElementAt (i).ElementAt (4);
  721. if(str.Find ("OK")==-1)
  722. {
  723. pos=str.Find ("/");
  724. str=str.Right (str.GetLength ()-pos-1);
  725. if(str!="")
  726. {
  727. pos=FindName(str, &m_workarray);
  728. if(pos==-1)
  729. {
  730. pos=m_workarray.GetSize ()+1;
  731. m_workarray.SetSize(pos, 1);
  732. pos--;
  733. m_workarray.ElementAt (pos).Add (str);
  734. m_workarray.ElementAt (pos).Add ("1");
  735. m_workarray.ElementAt (pos).Add ("0");
  736. m_workarray.ElementAt (pos).Add ("0");
  737. }
  738. else
  739. {
  740. str=m_workarray.ElementAt (pos).ElementAt (1);
  741. str.Format ("%d", atoi(str)+1);
  742. m_workarray.ElementAt (pos).SetAt (1, str);
  743. }
  744. }
  745. }
  746. str=m_List1array.ElementAt (i).ElementAt (6);
  747. if(str.Find ("OK")==-1)
  748. {
  749. pos=str.Find ("/");
  750. str=str.Right (str.GetLength ()-pos-1);
  751. if(str!="")
  752. {
  753. pos=FindName(str, &m_workarray);
  754. if(pos==-1)
  755. {
  756. pos=m_workarray.GetSize ()+1;
  757. m_workarray.SetSize(pos, 1);
  758. pos--;
  759. m_workarray.ElementAt (pos).Add (str);
  760. m_workarray.ElementAt (pos).Add ("0");
  761. m_workarray.ElementAt (pos).Add ("1");
  762. m_workarray.ElementAt (pos).Add ("0");
  763. }
  764. else
  765. {
  766. str=m_workarray.ElementAt (pos).ElementAt (2);
  767. str.Format ("%d", atoi(str)+1);
  768. m_workarray.ElementAt (pos).SetAt (2, str);
  769. }
  770. }
  771. }
  772. str=m_List1array.ElementAt (i).ElementAt (7);
  773. if(str.Find ("OK")==-1)
  774. {
  775. pos=str.Find ("/");
  776. str=str.Right (str.GetLength ()-pos-1);
  777. if(str!="")
  778. {
  779. pos=FindName(str, &m_workarray);
  780. if(pos==-1)
  781. {
  782. pos=m_workarray.GetSize ()+1;
  783. m_workarray.SetSize(pos, 1);
  784. pos--;
  785. m_workarray.ElementAt (pos).Add (str);
  786. m_workarray.ElementAt (pos).Add ("0");
  787. m_workarray.ElementAt (pos).Add ("0");
  788. m_workarray.ElementAt (pos).Add ("1");
  789. }
  790. else
  791. {
  792. str=m_workarray.ElementAt (pos).ElementAt (3);
  793. str.Format ("%d", atoi(str)+1);
  794. m_workarray.ElementAt (pos).SetAt (3, str);
  795. }
  796. }
  797. }
  798. }
  799. }
  800. void DigitalWork::HidePrice()
  801. {
  802. #ifdef LKAY_VERSION
  803. if(IsHasRights2new(31))return;
  804. for(int i=0; i< m_List1array.GetSize (); i++)
  805. {
  806. m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***");
  807. m_List1array.ElementAt (i).SetAt (15+m_nAdd, "***");
  808. m_List1array.ElementAt (i).SetAt (16+m_nAdd, "***");
  809. m_List1array.ElementAt (i).SetAt (17+m_nAdd, "***");
  810. }
  811. #else
  812. if(IsHasRights2new(31))return;
  813. for(int i=0; i< m_List1array.GetSize (); i++)
  814. {
  815. m_List1array.ElementAt (i).SetAt (16+m_nAdd, "***");
  816. m_List1array.ElementAt (i).SetAt (17+m_nAdd, "***");
  817. }
  818. #endif
  819. }
  820. void DigitalWork::GetData2()
  821. {
  822. g_List1array.RemoveAll ();
  823. m_List1array.RemoveAll ();
  824. CString branch;
  825. int i;
  826. for( i=-1; i<g_brancharray.GetSize ()-1; i++)
  827. {
  828. if(i!=-1)
  829. {
  830. branch=g_brancharray.ElementAt (i).ElementAt (0);
  831. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  832. g_pMainWnd->OnDisconnect();
  833. g_branchname=branch;
  834. g_bBranchModify=1;
  835. }
  836. else
  837. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  838. if(g_bShowOK==0)
  839. {
  840. CString filter="status3='未取' and status<>'未拍';";
  841. g_sendhead.bsql=0;
  842. g_sendhead.code[0]=135;
  843. g_sendhead.code[1]=136;
  844. g_sendhead.tabcount=2;
  845. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
  846. }
  847. else
  848. {
  849. CString filter="status<>'未拍';";
  850. g_sendhead.bsql=0;
  851. g_sendhead.code[0]=135;
  852. g_sendhead.code[1]=136;
  853. g_sendhead.tabcount=2;
  854. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
  855. }
  856. CArray<CStringArray, CStringArray>List1array;
  857. CArray<CStringArray, CStringArray>List2array;
  858. DataToArray(&List1array,&List2array);
  859. int j = 0;
  860. int size=m_List1array.GetSize ();
  861. for(j=0; j<List1array.GetSize (); j++)
  862. {
  863. size++;
  864. m_List1array.SetSize(size , 1 );
  865. size--;
  866. m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
  867. m_List1array.ElementAt (size).InsertAt (0, branch);
  868. size++;
  869. }
  870. size=g_List1array.GetSize ();
  871. for( j=0; j<List2array.GetSize (); j++)
  872. {
  873. size++;
  874. g_List1array.SetSize(size , 1 );
  875. size--;
  876. g_List1array.ElementAt (size).Copy (List2array.ElementAt (j));
  877. g_List1array.ElementAt (size).InsertAt (0, branch);
  878. size++;
  879. }
  880. }
  881. g_pMainWnd->OnDisconnect();
  882. g_bBranchModify=0;g_branchip=g_branchname="";
  883. HidePrice();
  884. for( i=0; i<g_List1array.GetSize (); i++)
  885. {
  886. for(int j=0; j<m_List1array.GetSize (); j++)
  887. {
  888. 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))
  889. {
  890. m_List1array.ElementAt (j).SetAt (4+m_nAdd, m_List1array.ElementAt (j).ElementAt (4+m_nAdd)+g_List1array.ElementAt (i).ElementAt (1+m_nAdd));
  891. m_List1array.ElementAt (j).SetAt (6+m_nAdd, m_List1array.ElementAt (j).ElementAt (6+m_nAdd)+g_List1array.ElementAt (i).ElementAt (3+m_nAdd));
  892. m_List1array.ElementAt (j).SetAt (7+m_nAdd, m_List1array.ElementAt (j).ElementAt (7+m_nAdd)+g_List1array.ElementAt (i).ElementAt (5+m_nAdd));
  893. }
  894. }
  895. }
  896. FillGrid();
  897. m_workarray.RemoveAll ();
  898. //m_workarray
  899. CString str,name;
  900. int pos;
  901. for( i=0; i<m_List1array.GetSize (); i++)
  902. {
  903. str=m_List1array.ElementAt (i).ElementAt (4+m_nAdd);
  904. if(str.Find ("OK")==-1)
  905. {
  906. pos=str.Find ("/");
  907. str=str.Right (str.GetLength ()-pos-1);
  908. if(str!="")
  909. {
  910. pos=FindName(str, &m_workarray);
  911. if(pos==-1)
  912. {
  913. pos=m_workarray.GetSize ()+1;
  914. m_workarray.SetSize(pos, 1);
  915. pos--;
  916. m_workarray.ElementAt (pos).Add (str);
  917. m_workarray.ElementAt (pos).Add ("1");
  918. m_workarray.ElementAt (pos).Add ("0");
  919. m_workarray.ElementAt (pos).Add ("0");
  920. }
  921. else
  922. {
  923. str=m_workarray.ElementAt (pos).ElementAt (1);
  924. str.Format ("%d", atoi(str)+1);
  925. m_workarray.ElementAt (pos).SetAt (1, str);
  926. }
  927. }
  928. }
  929. str=m_List1array.ElementAt (i).ElementAt (6+m_nAdd);
  930. if(str.Find ("OK")==-1)
  931. {
  932. pos=str.Find ("/");
  933. str=str.Right (str.GetLength ()-pos-1);
  934. if(str!="")
  935. {
  936. pos=FindName(str, &m_workarray);
  937. if(pos==-1)
  938. {
  939. pos=m_workarray.GetSize ()+1;
  940. m_workarray.SetSize(pos, 1);
  941. pos--;
  942. m_workarray.ElementAt (pos).Add (str);
  943. m_workarray.ElementAt (pos).Add ("0");
  944. m_workarray.ElementAt (pos).Add ("1");
  945. m_workarray.ElementAt (pos).Add ("0");
  946. }
  947. else
  948. {
  949. str=m_workarray.ElementAt (pos).ElementAt (2);
  950. str.Format ("%d", atoi(str)+1);
  951. m_workarray.ElementAt (pos).SetAt (2, str);
  952. }
  953. }
  954. }
  955. str=m_List1array.ElementAt (i).ElementAt (7+m_nAdd);
  956. if(str.Find ("OK")==-1)
  957. {
  958. pos=str.Find ("/");
  959. str=str.Right (str.GetLength ()-pos-1);
  960. if(str!="")
  961. {
  962. pos=FindName(str, &m_workarray);
  963. if(pos==-1)
  964. {
  965. pos=m_workarray.GetSize ()+1;
  966. m_workarray.SetSize(pos, 1);
  967. pos--;
  968. m_workarray.ElementAt (pos).Add (str);
  969. m_workarray.ElementAt (pos).Add ("0");
  970. m_workarray.ElementAt (pos).Add ("0");
  971. m_workarray.ElementAt (pos).Add ("1");
  972. }
  973. else
  974. {
  975. str=m_workarray.ElementAt (pos).ElementAt (3);
  976. str.Format ("%d", atoi(str)+1);
  977. m_workarray.ElementAt (pos).SetAt (3, str);
  978. }
  979. }
  980. }
  981. }
  982. }
  983. void DigitalWork::OnBtnsearchfilter()
  984. {
  985. // TODO: Add your control notification handler code here
  986. SearchFilter3 dlg;
  987. if(dlg.DoModal ()==IDOK)
  988. {
  989. FillGrid();
  990. }
  991. g_bSearchFilter=0;
  992. }