DigitalWork.cpp 28 KB

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