DigitalWork.cpp 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044
  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. #ifdef LKAY_VERSION
  799. if(IsHasRights2new(31))return;
  800. for(int i=0; i< m_List1array.GetSize (); i++)
  801. {
  802. m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***");
  803. m_List1array.ElementAt (i).SetAt (15+m_nAdd, "***");
  804. m_List1array.ElementAt (i).SetAt (16+m_nAdd, "***");
  805. m_List1array.ElementAt (i).SetAt (17+m_nAdd, "***");
  806. }
  807. #else
  808. if(IsHasRights2new(31))return;
  809. for(int i=0; i< m_List1array.GetSize (); i++)
  810. {
  811. m_List1array.ElementAt (i).SetAt (16+m_nAdd, "***");
  812. m_List1array.ElementAt (i).SetAt (17+m_nAdd, "***");
  813. }
  814. #endif
  815. }
  816. void DigitalWork::GetData2()
  817. {
  818. g_List1array.RemoveAll ();
  819. m_List1array.RemoveAll ();
  820. CString branch;
  821. int i = 0;
  822. int j = 0;
  823. for( i=-1; i<g_brancharray.GetSize ()-1; i++)
  824. {
  825. if(i!=-1)
  826. {
  827. branch=g_brancharray.ElementAt (i).ElementAt (0);
  828. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  829. g_pMainWnd->OnDisconnect();
  830. g_branchname=branch;
  831. g_bBranchModify=1;
  832. }
  833. else
  834. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  835. if(g_bShowOK==0)
  836. {
  837. CString filter="status3='未取' and status<>'未拍';";
  838. g_sendhead.bsql=0;
  839. g_sendhead.code[0]=135;
  840. g_sendhead.code[1]=136;
  841. g_sendhead.tabcount=2;
  842. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
  843. }
  844. else
  845. {
  846. CString filter="status<>'未拍';";
  847. g_sendhead.bsql=0;
  848. g_sendhead.code[0]=135;
  849. g_sendhead.code[1]=136;
  850. g_sendhead.tabcount=2;
  851. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
  852. }
  853. CArray<CStringArray, CStringArray>List1array;
  854. CArray<CStringArray, CStringArray>List2array;
  855. DataToArray(&List1array,&List2array);
  856. int size=m_List1array.GetSize ();
  857. for( j=0; j<List1array.GetSize (); j++)
  858. {
  859. size++;
  860. m_List1array.SetSize(size , 1 );
  861. size--;
  862. m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
  863. m_List1array.ElementAt (size).InsertAt (0, branch);
  864. size++;
  865. }
  866. size=g_List1array.GetSize ();
  867. for( j=0; j<List2array.GetSize (); j++)
  868. {
  869. size++;
  870. g_List1array.SetSize(size , 1 );
  871. size--;
  872. g_List1array.ElementAt (size).Copy (List2array.ElementAt (j));
  873. g_List1array.ElementAt (size).InsertAt (0, branch);
  874. size++;
  875. }
  876. }
  877. g_pMainWnd->OnDisconnect();
  878. g_bBranchModify=0;g_branchip=g_branchname="";
  879. HidePrice();
  880. for( i=0; i<g_List1array.GetSize (); i++)
  881. {
  882. for( j=0; j<m_List1array.GetSize (); j++)
  883. {
  884. 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))
  885. {
  886. m_List1array.ElementAt (j).SetAt (4+m_nAdd, m_List1array.ElementAt (j).ElementAt (4+m_nAdd)+g_List1array.ElementAt (i).ElementAt (1+m_nAdd));
  887. m_List1array.ElementAt (j).SetAt (6+m_nAdd, m_List1array.ElementAt (j).ElementAt (6+m_nAdd)+g_List1array.ElementAt (i).ElementAt (3+m_nAdd));
  888. m_List1array.ElementAt (j).SetAt (7+m_nAdd, m_List1array.ElementAt (j).ElementAt (7+m_nAdd)+g_List1array.ElementAt (i).ElementAt (5+m_nAdd));
  889. }
  890. }
  891. }
  892. FillGrid();
  893. m_workarray.RemoveAll ();
  894. //m_workarray
  895. CString str,name;
  896. int pos;
  897. for( i=0; i<m_List1array.GetSize (); i++)
  898. {
  899. str=m_List1array.ElementAt (i).ElementAt (4+m_nAdd);
  900. if(str.Find ("OK")==-1)
  901. {
  902. pos=str.Find ("/");
  903. str=str.Right (str.GetLength ()-pos-1);
  904. if(str!="")
  905. {
  906. pos=FindName(str, &m_workarray);
  907. if(pos==-1)
  908. {
  909. pos=m_workarray.GetSize ()+1;
  910. m_workarray.SetSize(pos, 1);
  911. pos--;
  912. m_workarray.ElementAt (pos).Add (str);
  913. m_workarray.ElementAt (pos).Add ("1");
  914. m_workarray.ElementAt (pos).Add ("0");
  915. m_workarray.ElementAt (pos).Add ("0");
  916. }
  917. else
  918. {
  919. str=m_workarray.ElementAt (pos).ElementAt (1);
  920. str.Format ("%d", atoi(str)+1);
  921. m_workarray.ElementAt (pos).SetAt (1, str);
  922. }
  923. }
  924. }
  925. str=m_List1array.ElementAt (i).ElementAt (6+m_nAdd);
  926. if(str.Find ("OK")==-1)
  927. {
  928. pos=str.Find ("/");
  929. str=str.Right (str.GetLength ()-pos-1);
  930. if(str!="")
  931. {
  932. pos=FindName(str, &m_workarray);
  933. if(pos==-1)
  934. {
  935. pos=m_workarray.GetSize ()+1;
  936. m_workarray.SetSize(pos, 1);
  937. pos--;
  938. m_workarray.ElementAt (pos).Add (str);
  939. m_workarray.ElementAt (pos).Add ("0");
  940. m_workarray.ElementAt (pos).Add ("1");
  941. m_workarray.ElementAt (pos).Add ("0");
  942. }
  943. else
  944. {
  945. str=m_workarray.ElementAt (pos).ElementAt (2);
  946. str.Format ("%d", atoi(str)+1);
  947. m_workarray.ElementAt (pos).SetAt (2, str);
  948. }
  949. }
  950. }
  951. str=m_List1array.ElementAt (i).ElementAt (7+m_nAdd);
  952. if(str.Find ("OK")==-1)
  953. {
  954. pos=str.Find ("/");
  955. str=str.Right (str.GetLength ()-pos-1);
  956. if(str!="")
  957. {
  958. pos=FindName(str, &m_workarray);
  959. if(pos==-1)
  960. {
  961. pos=m_workarray.GetSize ()+1;
  962. m_workarray.SetSize(pos, 1);
  963. pos--;
  964. m_workarray.ElementAt (pos).Add (str);
  965. m_workarray.ElementAt (pos).Add ("0");
  966. m_workarray.ElementAt (pos).Add ("0");
  967. m_workarray.ElementAt (pos).Add ("1");
  968. }
  969. else
  970. {
  971. str=m_workarray.ElementAt (pos).ElementAt (3);
  972. str.Format ("%d", atoi(str)+1);
  973. m_workarray.ElementAt (pos).SetAt (3, str);
  974. }
  975. }
  976. }
  977. }
  978. }
  979. void DigitalWork::OnBtnsearchfilter()
  980. {
  981. // TODO: Add your control notification handler code here
  982. SearchFilter3 dlg;
  983. if(dlg.DoModal ()==IDOK)
  984. {
  985. FillGrid();
  986. }
  987. g_bSearchFilter=0;
  988. }