TakeFrom.cpp 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728
  1. // TakeFrom.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "TakeFrom.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "ShowPic.h"
  9. #include "SelWaiter2.h"
  10. #include "TakeStautsSel.h"
  11. #include "SalaryRateSet2.h"
  12. #include "UploadPhoto.h"
  13. #include "NetShareInfo.h"
  14. #include "SetOrderInfo.h"
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20. #pragma comment(lib, "Shlwapi.lib")
  21. IMPLEMENT_DYNCREATE(TakeFrom, MyFormView)
  22. TakeFrom::TakeFrom() : MyFormView(TakeFrom::IDD)
  23. {
  24. m_filter = _T("");
  25. m_nAdd = 0;
  26. if (g_bAllBranch)
  27. {
  28. m_nAdd = 1;
  29. }
  30. }
  31. TakeFrom::~TakeFrom()
  32. {
  33. }
  34. void TakeFrom::DoDataExchange(CDataExchange* pDX)
  35. {
  36. MyFormView::DoDataExchange(pDX);
  37. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  38. DDX_Control(pDX, IDC_LIST2, m_List1);
  39. DDX_Control(pDX, IDC_STATIC1, m_static1);
  40. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  41. }
  42. BEGIN_MESSAGE_MAP(TakeFrom, MyFormView)
  43. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  44. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  45. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  46. ON_WM_TIMER()
  47. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  48. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  49. ON_BN_CLICKED(IDC_BUTmoney, OnBUTmoney)
  50. ON_BN_CLICKED(IDC_BTNaddsp, OnBTNaddsp)
  51. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  52. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  53. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  54. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  55. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  56. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  57. ON_BN_CLICKED(Btn_MicroShare, OnBnClickedMicroshare)
  58. ON_MESSAGE(MSG_KERNEL_CALLBACK, OnKernelCallBack)
  59. END_MESSAGE_MAP()
  60. #ifdef _DEBUG
  61. void TakeFrom::AssertValid() const
  62. {
  63. MyFormView::AssertValid();
  64. }
  65. void TakeFrom::Dump(CDumpContext& dc) const
  66. {
  67. MyFormView::Dump(dc);
  68. }
  69. #endif //_DEBUG
  70. LRESULT TakeFrom::OnKernelCallBack(WPARAM wp,LPARAM lp)
  71. {
  72. GetData();
  73. return 0;
  74. }
  75. void TakeFrom::OnInitialUpdate()
  76. {
  77. MyFormView::OnInitialUpdate();
  78. // TODO: Add your specialized code here and/or call the base class
  79. CMyMdi Mdi;
  80. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  81. // Here we create the outbar control using the splitter as its parent
  82. // and setting its id to the first pane.
  83. CRect rc2;
  84. GetWindowRect(rc2);
  85. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  86. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  87. int idarray[] = { IDC_BUTprint3, IDC_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTTON2, IDC_BUTclose };
  88. int idcount = 5;
  89. int btnwid;
  90. CRect prerc;
  91. for (int a = idcount - 2; a >= 0; a--)
  92. {
  93. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  94. ScreenToClient(prerc);
  95. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  96. ScreenToClient(rc2);
  97. btnwid = rc2.Width();
  98. rc2.right = prerc.left;
  99. rc2.left = rc2.right - btnwid;
  100. GetDlgItem(idarray[a])->MoveWindow(rc2);
  101. }
  102. m_static1.SetFont(&g_titlefont);
  103. if (g_bAllBranch == 0)
  104. {
  105. #ifdef CHILD_VERSION
  106. #ifdef LKAY_VERSION
  107. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;导片日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  108. #else
  109. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  110. #endif
  111. #else
  112. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  113. #endif
  114. m_List1.LoadColumnInfo(114);
  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" );
  120. #else
  121. m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  122. #endif
  123. m_List1.LoadColumnInfo(196);
  124. GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
  125. }
  126. #if JEFF_DELETE_OFF // 多景点时排序有问题!
  127. m_List1.m_bSortSupport = 0;
  128. #endif
  129. GetData();
  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. }
  138. void TakeFrom::FillGrid(BOOL bStatus/*=0*/)
  139. {
  140. if (g_bSearchFilter) // 1.按钮:条件查询;
  141. {
  142. m_List1.DeleteAllItems2();
  143. int ii = 0;
  144. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  145. int count = 0;
  146. {
  147. BOOL bFinded = 0;
  148. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  149. {
  150. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  151. {
  152. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  153. continue;
  154. }
  155. if (g_filterdate1 != "") // Jeff.查询过滤条件:日期;
  156. {
  157. if (m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) > g_filterdate2)
  158. {
  159. bFinded = 0;
  160. continue;
  161. }
  162. }
  163. if (g_waiter1 != "") // Jeff.查询过滤条件:门市;
  164. {
  165. if (m_List1array.ElementAt(ii).ElementAt(11 + m_nAdd) != g_waiter1)
  166. {
  167. bFinded = 0;
  168. continue;
  169. }
  170. }
  171. if (g_waiter2 != "") // Jeff.查询过滤条件:摄影师;
  172. {
  173. if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) != g_waiter2)
  174. {
  175. bFinded = 0;
  176. continue;
  177. }
  178. }
  179. if (g_waiter3 != "") // Jeff.查询过滤条件:化妆师;
  180. {
  181. if (m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd) != g_waiter3)
  182. {
  183. bFinded = 0;
  184. continue;
  185. }
  186. }
  187. if (g_waiter4 != "") // Jeff.查询套系类别;
  188. {
  189. if (m_List1array.ElementAt(ii).ElementAt(3) != g_waiter4)
  190. {
  191. bFinded = 0;
  192. continue;
  193. }
  194. }
  195. if (g_bAllBranch && g_filterbranch != "") // Jeff.集团版查询过滤条件:分店名称;
  196. {
  197. if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
  198. {
  199. bFinded = 0;
  200. continue;
  201. }
  202. }
  203. // 2015.03.30
  204. // Jeff:上面已有判断,这里必须判断订单号非空才能添加,否则会添加其他空的选项;
  205. if (!m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  206. {
  207. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  208. bFinded = 1;
  209. }
  210. }
  211. }
  212. m_List1.m_arLabels.SetSize(count, 1);
  213. ii = count;
  214. m_List1.m_LabelCount = ii;
  215. m_List1.SetItemCountEx(ii);
  216. CString str;
  217. str.Format("单数:%d", ii);
  218. SetDlgItemText(IDC_STATIC2, str);
  219. }
  220. else // 2.其他显示;
  221. {
  222. m_List1.DeleteAllItems2();
  223. int ii = 0;
  224. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  225. int count = 0;
  226. if (m_filter.IsEmpty()) // 2.1.没有查询关键字;
  227. {
  228. if (bStatus == 1) // bStatus==1,没用到;
  229. {
  230. BOOL bFinded = 0;
  231. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  232. {
  233. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  234. {
  235. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  236. continue;
  237. }
  238. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0)
  239. {
  240. bFinded = 1;
  241. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  242. }
  243. else
  244. {
  245. bFinded = 0;
  246. }
  247. }
  248. }
  249. else if (bStatus == 2) // 今拍按钮用到;
  250. {
  251. BOOL bFinded = 0;
  252. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  253. {
  254. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  255. {
  256. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  257. continue;
  258. }
  259. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date)
  260. {
  261. bFinded = 1;
  262. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  263. }
  264. else
  265. {
  266. bFinded = 0;
  267. }
  268. }
  269. }
  270. else // bStatus==0;默认使用的值;
  271. {
  272. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  273. {
  274. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  275. }
  276. }
  277. }
  278. else // 2.2.指定查询条件 ;
  279. {
  280. if (bStatus == 1)
  281. {
  282. BOOL bFinded = 0;
  283. int type = GetType(m_filter);
  284. if (type == 1)//电话
  285. {
  286. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  287. {
  288. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  289. {
  290. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  291. continue;
  292. }
  293. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || \
  294. m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
  295. {
  296. bFinded = 1;
  297. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  298. }
  299. else
  300. {
  301. bFinded = 0;
  302. }
  303. }
  304. }
  305. else if (type == 2)//拼音
  306. {
  307. BOOL bFinded = 0;
  308. m_filter.MakeUpper();
  309. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  310. {
  311. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  312. {
  313. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  314. continue;
  315. }
  316. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
  317. m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1))
  318. {
  319. bFinded = 1;
  320. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  321. }
  322. else
  323. {
  324. bFinded = 0;
  325. }
  326. }
  327. }
  328. else
  329. {
  330. BOOL bFinded = 0;
  331. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  332. {
  333. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  334. {
  335. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  336. continue;
  337. }
  338. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&\
  339. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && \
  340. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  341. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  342. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  343. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  344. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  345. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  346. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  347. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  348. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  349. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  350. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  351. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  352. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  353. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  354. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  355. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  356. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
  357. {
  358. bFinded = 1;
  359. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  360. }
  361. else
  362. {
  363. bFinded = 0;
  364. }
  365. }
  366. }
  367. }
  368. else if (bStatus == 2)
  369. {
  370. BOOL bFinded = 0;
  371. int type = GetType(m_filter);
  372. if (type == 1)//电话
  373. {
  374. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  375. {
  376. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  377. {
  378. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  379. continue;
  380. }
  381. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date && (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || \
  382. m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
  383. {
  384. bFinded = 1;
  385. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  386. }
  387. else
  388. {
  389. bFinded = 0;
  390. }
  391. }
  392. }
  393. else if (type == 2)//拼音
  394. {
  395. BOOL bFinded = 0;
  396. m_filter.MakeUpper();
  397. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  398. {
  399. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  400. {
  401. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  402. continue;
  403. }
  404. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date && (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 || \
  405. m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1))
  406. {
  407. bFinded = 1;
  408. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  409. }
  410. else
  411. {
  412. bFinded = 0;
  413. }
  414. }
  415. }
  416. else
  417. {
  418. BOOL bFinded = 0;
  419. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  420. {
  421. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  422. {
  423. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  424. continue;
  425. }
  426. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date &&\
  427. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  428. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  429. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  430. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  431. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  432. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  433. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  434. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  435. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  436. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  437. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  438. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  439. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  440. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  441. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  442. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  443. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
  444. {
  445. bFinded = 1;
  446. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  447. }
  448. else
  449. {
  450. bFinded = 0;
  451. }
  452. }
  453. }
  454. }
  455. else
  456. {
  457. int type = GetType(m_filter);
  458. if (type == 1)//电话
  459. {
  460. BOOL bFinded = 0;
  461. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  462. {
  463. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  464. {
  465. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  466. continue;
  467. }
  468. if (m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1 || \
  469. m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1)
  470. {
  471. bFinded = 1;
  472. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  473. }
  474. else
  475. {
  476. bFinded = 0;
  477. }
  478. }
  479. }
  480. else if (type == 2)//拼音
  481. {
  482. BOOL bFinded = 0;
  483. m_filter.MakeUpper();
  484. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  485. {
  486. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  487. {
  488. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  489. continue;
  490. }
  491. if (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
  492. m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1)
  493. {
  494. bFinded = 1;
  495. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  496. }
  497. else
  498. {
  499. bFinded = 0;
  500. }
  501. }
  502. }
  503. else
  504. {
  505. BOOL bFinded = 0;
  506. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  507. {
  508. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  509. {
  510. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  511. continue;
  512. }
  513. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  514. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  515. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  516. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  517. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  518. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  519. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  520. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  521. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  522. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  523. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  524. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  525. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  526. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  527. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  528. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  529. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1)
  530. {
  531. bFinded = 1;
  532. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  533. }
  534. else
  535. {
  536. bFinded = 0;
  537. }
  538. }
  539. }
  540. }
  541. }
  542. m_List1.m_arLabels.SetSize(count, 1);
  543. ii = count;
  544. m_List1.m_LabelCount = ii;
  545. m_List1.SetItemCountEx(ii);
  546. CString str;
  547. str.Format("单数:%d", ii);
  548. SetDlgItemText(IDC_STATIC2, str);
  549. }
  550. if (!g_id.IsEmpty())
  551. {
  552. for (int i = 0; i < m_List1.GetItemCount(); i++)
  553. {
  554. if (g_id == m_List1.GetItemText(i, 0 + m_nAdd))
  555. {
  556. m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  557. m_List1.EnsureVisible(i, FALSE);
  558. break;
  559. }
  560. }
  561. }
  562. }
  563. void TakeFrom::OnBUTclose()
  564. {
  565. // TODO: Add your control notification handler code here
  566. GetParent()->SendMessage(WM_CLOSE);
  567. }
  568. void TakeFrom::OnSelchangeCombo1()
  569. {
  570. // TODO: Add your control notification handler code here
  571. SetTimer(1, 100, NULL);
  572. }
  573. void TakeFrom::OnTimer(UINT nIDEvent)
  574. {
  575. // TODO: Add your message handler code here and/or call default
  576. KillTimer(nIDEvent);
  577. OnButton1();
  578. }
  579. BOOL TakeFrom::PreTranslateMessage(MSG* pMsg)
  580. {
  581. // TODO: Add your specialized code here and/or call the base class
  582. try
  583. {
  584. if (pMsg->message == WM_KEYDOWN)
  585. {
  586. switch (pMsg->wParam)
  587. {
  588. case VK_RETURN:
  589. OnButton1();
  590. return 1;
  591. case 0x43: // copy
  592. if ((GetKeyState(VK_CONTROL) & 0x80))
  593. {
  594. GetFocus()->SendMessage(WM_COPY);
  595. return TRUE;
  596. }
  597. break;
  598. case 0x56: //Ctrl + V:
  599. if ((GetKeyState(VK_CONTROL) & 0x80))
  600. {
  601. GetFocus()->SendMessage(WM_PASTE);
  602. return TRUE;
  603. }
  604. break;
  605. case 0x58: // cut
  606. if ((GetKeyState(VK_CONTROL) & 0x80))
  607. {
  608. GetFocus()->SendMessage(WM_CUT);
  609. return TRUE;
  610. }
  611. break;
  612. case 0x5A: //undo
  613. case 0x59: //redo
  614. if ((GetKeyState(VK_CONTROL) & 0x80))
  615. {
  616. GetFocus()->SendMessage(WM_UNDO);
  617. return TRUE;
  618. }
  619. break;
  620. }
  621. }
  622. return MyFormView::PreTranslateMessage(pMsg);
  623. }
  624. catch (...)
  625. {
  626. }
  627. return true;
  628. }
  629. // Jeff.remark.
  630. // 1.弹出"拍照状态确认"对话框前,需要获取订单的拍照状态,以此来确定是否需要禁用check状态框;
  631. //
  632. void TakeFrom::OnBUTimportphoto() // 导入原片按钮;
  633. {
  634. INT nFirstItem = 0;
  635. INT nEndofItem = 0;
  636. STOrederInfo tagOrderInfo;
  637. INT nSelectedItem = GetSelectedOrderInfo(tagOrderInfo, nFirstItem, nEndofItem);
  638. // 有多少拍照OK的景点;
  639. INT nOKSize = 0;
  640. // 有多少景点未拍的;
  641. INT nUnOKSize = 0;
  642. vector<STSceneryInfo>::iterator it;
  643. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  644. {
  645. if ( it->strStatus == _T("OK") )
  646. nOKSize++;
  647. if ( it->strStatus == _T("未拍"))
  648. nUnOKSize++;
  649. }
  650. CSetOrderInfo dlg;
  651. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  652. {
  653. // 当前选中的景点列;
  654. if ( it->bSelected == TRUE )
  655. {
  656. dlg.waiter1 = it->strLensman;
  657. dlg.waiter12 = it->strLensmanAssistant;
  658. dlg.waiter2 = it->strBootDivision;
  659. dlg.waiter22 = it->strBootDivisionAssistant;
  660. // 让对话窗口弹出时,显示当前景点的拍照状态;
  661. if(it->strStatus == _T("OK"))
  662. dlg.m_nStatus = 0;
  663. else if( it->strStatus == _T("拍摄中") )
  664. dlg.m_nStatus = 1;
  665. else if( it->strStatus == _T("未拍") )
  666. dlg.m_nStatus = 2;
  667. break;
  668. }
  669. }
  670. if ( dlg.DoModal() == IDOK )
  671. {
  672. it->strLensman = dlg.waiter1;
  673. it->strLensmanAssistant = dlg.waiter12;
  674. it->strBootDivision = dlg.waiter2;
  675. it->strBootDivisionAssistant = dlg.waiter22;
  676. // m_nStatus:
  677. // 0:此景点拍照OK; 1:此景点拍照中; 2:此景点未拍照; 3:全部景点拍照OK;
  678. if ( dlg.m_nStatus == 0 )
  679. {// 所选景点设置OK,nOKSize加;
  680. if ( it->strStatus != _T("OK"))
  681. {
  682. nOKSize++;
  683. if ( it->strStatus == _T("未拍"))
  684. nUnOKSize--;
  685. }
  686. it->strStatus = _T("OK");
  687. }
  688. else if ( dlg.m_nStatus == 1 )
  689. {// 所选景点设置拍照中; 若原本景点OK,nOKSize减;
  690. if ( it->strStatus == _T("OK"))
  691. nOKSize--;
  692. if (it->strStatus == _T("未拍"))
  693. nUnOKSize--;
  694. it->strStatus = _T("拍摄中");
  695. }
  696. else if ( dlg.m_nStatus == 2 )
  697. {// 所选景点设置未拍照;若原本景点OK,nOKSize加;
  698. if ( it->strStatus == _T("OK"))
  699. {
  700. nOKSize--;
  701. nUnOKSize++;
  702. }
  703. if ( it->strStatus == _T("拍摄中"))
  704. nUnOKSize++;
  705. it->strStatus = _T("未拍");
  706. }
  707. else if ( dlg.m_nStatus == 3 )
  708. {// 全部景点设置OK;
  709. nOKSize = tagOrderInfo.vtOrderScenery.size();
  710. nUnOKSize = 0;
  711. it->strStatus = _T("OK");
  712. }
  713. //////////////////////////////////////////////////////////////////////////
  714. // SQL语句;
  715. CString strSQL = _T("");
  716. CString strSQL2 = _T("");
  717. if ( nOKSize == 0 )
  718. {// 全部景点未拍照 (若已全部景点OK,不改变订单的拍照状态和订单的拍照日期);
  719. if ( nUnOKSize == 0)
  720. strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '拍摄中' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
  721. else
  722. strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '未拍' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
  723. }
  724. else if ( nOKSize == tagOrderInfo.vtOrderScenery.size() )
  725. {// 全部景点都OK,设置所有dindanjd表的订单景点拍照状态OK,且设置订单的拍照日期(原本状态OK的,不改变拍照日期);
  726. strSQL.Format(_T("update dindan set [status] = 'OK', [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
  727. strSQL2.Format(_T("***update dindanjd set [status] = 'OK' where id = '%s'"),tagOrderInfo.strOrderNumber);
  728. strSQL += strSQL2;
  729. //////////////////////////////////////////////////////////////////////////
  730. // 全部景点拍照OK时,判断是否需要生成短信;
  731. if ( atoi(g_cominfoarray.ElementAt(0).ElementAt(101)) )
  732. {
  733. CString strTimeStamp = _T("msgtimestamp");
  734. CString strSMSContent = CString(g_cominfoarray.ElementAt(0).ElementAt(105));
  735. // 获取用户手机号码;
  736. CString strPhone1 = tagOrderInfo.strPhone;
  737. CString strPhone2 = tagOrderInfo.strTelPhone;
  738. if ( strPhone1.Find(_T("***")) != -1 )
  739. {//若用户权限不足以获取手机号码,重新获取;
  740. CString strBranchName = GetBranchNamebyId(tagOrderInfo.strBranchId);
  741. if ( g_bAllBranch )
  742. {
  743. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  744. {
  745. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && strBranchName == m_List1arrayBak.ElementAt(i).ElementAt(0))
  746. {
  747. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  748. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  749. break;
  750. }
  751. }
  752. }
  753. else
  754. {
  755. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  756. {
  757. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
  758. {
  759. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  760. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  761. break;
  762. }
  763. }
  764. }
  765. }
  766. // 生成短信内容;
  767. CString strtemp = _T("");
  768. #ifdef CHILD_VERSION
  769. if ( !tagOrderInfo.strName1.IsEmpty() )
  770. strtemp = tagOrderInfo.strName1 + _T(",");
  771. strtemp += tagOrderInfo.strName2;
  772. strtemp.TrimRight(_T(","));
  773. if( !strtemp.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(strtemp,0) )
  774. {
  775. strtemp += strSMSContent;
  776. strtemp.Replace(_T("xxx小朋友"), _T(""));
  777. int nCount = GetLengthEx(strtemp)/MSG_LENGTH;
  778. if( GetLengthEx(strtemp)%MSG_LENGTH )
  779. nCount++;
  780. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  781. strSQL += _T("***") + strSQL2;
  782. }
  783. #else
  784. if ( strSMSContent.Find(_T("xxx先生/女士")) != -1 )
  785. {
  786. int nCount = 0;
  787. // 男士短信;
  788. if ( !tagOrderInfo.strName1.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(tagOrderInfo.strName1, 0) )
  789. {
  790. strtemp = strSMSContent;
  791. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
  792. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  793. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  794. nCount++;
  795. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  796. strSQL += _T("***") + strSQL2;
  797. }
  798. // 女士短信;
  799. if ( !tagOrderInfo.strName2.IsEmpty() && CheckPhoneType(strPhone2) != -1 && CheckBadWords(tagOrderInfo.strName2, 0) )
  800. {
  801. strtemp = strSMSContent;
  802. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName2 + _T("女士"));
  803. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  804. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  805. nCount++;
  806. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone2, strtemp, _T("msgtimexxstamp"), nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  807. strSQL += _T("***") + strSQL2;
  808. }
  809. }
  810. #endif
  811. }
  812. }
  813. else
  814. {// 部分景点拍照;拍照中(若订单的拍照状态已OK,不修改状态);
  815. strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '拍摄中' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
  816. }
  817. // 最多4个景点,4组摄影师+化妆师;
  818. if ( nSelectedItem == nFirstItem )
  819. {
  820. strSQL2.Format(_T("***update dindan set waiter1 = '%s', waiter2 = '%s' where id = '%s'"),
  821. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  822. }
  823. else if ( nSelectedItem == nFirstItem + 1)
  824. {
  825. strSQL2.Format(_T("***update dindan set waiter12 = '%s', waiter22 = '%s' where id = '%s'"),
  826. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  827. }
  828. else if ( nSelectedItem == nFirstItem + 2)
  829. {
  830. strSQL2.Format(_T("***update dindan set waiter13 = '%s', waiter23 = '%s' where id = '%s'"),
  831. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  832. }
  833. else if ( nSelectedItem == nFirstItem + 3)
  834. {
  835. strSQL2.Format(_T("***update dindan set waiter14 = '%s', waiter24 = '%s' where id = '%s'"),
  836. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  837. }
  838. strSQL += strSQL2;
  839. strSQL2.Format(_T("***update dindanjd set [date]= '%s', [status] = '%s', [waiter1] = '%s', [waiter12] = '%s', [waiter2] = '%s',[waiter22] ='%s' where id = '%s' and [name] = '%s' "),
  840. g_date, it->strStatus, it->strLensman, it->strLensmanAssistant, it->strBootDivision, it->strBootDivisionAssistant, tagOrderInfo.strOrderNumber, it->strScenery);
  841. strSQL += strSQL2;
  842. strSQL2.Format(_T("***gentakecontent:"),tagOrderInfo.strOrderNumber);//拍照OK时记录客人预定内容
  843. strSQL += strSQL2;
  844. //////////////////////////////////////////////////////////////////////////
  845. // 构建发送给服务器的包;
  846. g_sendhead.bsql = TRUE;
  847. if ( g_bAllBranch )
  848. {
  849. // 多店汇总;
  850. g_branchip = GetIP(tagOrderInfo.strBranchId);
  851. g_pMainWnd->OnDisconnect();
  852. g_branchname = tagOrderInfo.strBranchId;
  853. g_bBranchModify = TRUE;
  854. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  855. g_pMainWnd->OnDisconnect();
  856. g_bBranchModify = FALSE;
  857. g_branchip = g_branchname = _T("");
  858. }
  859. else
  860. {
  861. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  862. }
  863. //////////////////////////////////////////////////////////////////////////
  864. // 接收服务器返回的数据;
  865. if (g_bSendOK == 0)
  866. {
  867. OutputDebugString(_T("\n服务器返回数据失败!\n"));
  868. return;
  869. }
  870. if (g_bAllBranch == 0)
  871. {// 连接本店或分店时;
  872. GetData();
  873. }
  874. else
  875. {// 多店汇总时;
  876. BOOL bFind = 0;
  877. for (int i = 0; i < m_List1array.GetSize(); i++)
  878. {
  879. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != _T(""))break;
  880. if (tagOrderInfo.strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1array.ElementAt(i).ElementAt(0))
  881. {
  882. bFind = 1;
  883. }
  884. if (bFind && it->strScenery == m_List1array.ElementAt(i).ElementAt(4))
  885. {
  886. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, it->strLensman);
  887. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, it->strLensmanAssistant);
  888. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, it->strBootDivision);
  889. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, it->strBootDivisionAssistant);
  890. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, it->strStatus);
  891. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  892. //m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
  893. FillGrid();
  894. break;
  895. }
  896. }
  897. }
  898. }
  899. // 开始导入初修片;
  900. if ( MessageBox(_T("是否现在开始导入原片!"), _T("导片提示:导入原片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
  901. {// 是否马上导入相片;
  902. return;
  903. }
  904. //////////////////////////////////////////////////////////////////////////
  905. INT nImgNum = atoi(tagOrderInfo.strImageNumber);
  906. if ( nImgNum <= 0)
  907. nImgNum = 1;
  908. else
  909. ++nImgNum;
  910. ImgImportInterface *pImport = NULL;
  911. if ( g_pIMGProcess == NULL )
  912. {
  913. AfxMessageBox(_T("lyfzIMGProcess模块加载失败!"));
  914. return;
  915. }
  916. g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  917. if ( pImport )
  918. {
  919. pImport->ImportOriginalImg(
  920. TRUE, // 文件夹形式打开源或多选文件形式;
  921. !g_bOriginal, // 相片是否需要重命名;
  922. nImgNum, // 相片数字编号;
  923. tagOrderInfo.strBranchId, // 分店域名;
  924. tagOrderInfo.strOrderNumber, // 订单号;
  925. tagOrderInfo.strName1 + _T(",") + tagOrderInfo.strName2, // 顾客信息,可任意组合;
  926. TRUE, // 导入时,是否生成景点名文件夹;
  927. it->strScenery, // 导入时,景点名;
  928. _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
  929. INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
  930. _T("*.nef|*.cr2|*.raw"), // 导入时,附加的扩展名相片;
  931. TRUE, // 导入时,是否生成缩略图;
  932. SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
  933. FALSE // 导入时,文件存在时是否覆盖;
  934. );
  935. g_pIMGProcess->Release();
  936. WriteOptLog(_T("导入原片,订单号:%s"),tagOrderInfo.strOrderNumber);
  937. }
  938. //////////////////////////////////////////////////////////////////////////
  939. }
  940. void TakeFrom::OnBUTshowphoto() // 查看原片
  941. {
  942. POSITION pos;
  943. pos = m_List1.GetFirstSelectedItemPosition();
  944. if (pos == NULL)
  945. {
  946. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  947. return;
  948. }
  949. int iItem = m_List1.GetNextSelectedItem(pos);
  950. CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
  951. CString branch;
  952. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  953. if (g_bAllBranch)
  954. branch = m_List1.GetItemText(iItem, 0);
  955. while (id == "")
  956. {
  957. iItem--;
  958. id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  959. }
  960. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  961. name.TrimLeft(",");
  962. name.TrimRight(",");
  963. name = "客人:" + name;
  964. ShowPic dlg;
  965. dlg.m_id = id;
  966. dlg.m_name = name;
  967. dlg.m_mode = 1;
  968. if(g_branchname == _T(""))
  969. dlg.m_path = g_path1 + "\\";
  970. else
  971. {
  972. dlg.m_branch = GetDomainFromBranch(g_branchname);
  973. CString branchpath = GetBranchPhotoPath(g_branchname);
  974. dlg.m_path = g_path1 + branchpath + "\\";
  975. }
  976. #ifndef USE_KERNEL_DLL
  977. #if USE_SHARE_FLORD
  978. // 根据域名,相片类型,订单号查找相片;
  979. dlg.m_aryOfShareDirectory.RemoveAll();
  980. CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
  981. #endif
  982. dlg.m_path += id;
  983. dlg.m_path += "\\";
  984. if (g_pMainWnd->IsCtrlDown() == 0 && g_pMainWnd->IsShiftDown() == 0 && dindanjd != "")
  985. {
  986. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  987. {
  988. if (dindanjd == "系统默认景点")
  989. {
  990. if (::PathFileExists(dlg.m_path + dindanjd))
  991. {
  992. dlg.m_path += dindanjd;
  993. dlg.m_path += "\\";
  994. }
  995. }
  996. else
  997. {
  998. dlg.m_path += dindanjd;
  999. dlg.m_path += "\\";
  1000. }
  1001. }
  1002. }
  1003. else if (g_pMainWnd->IsCtrlDown())
  1004. {
  1005. if (dindanjd == "系统默认景点")
  1006. {
  1007. if (::PathFileExists(dlg.m_path + dindanjd))
  1008. {
  1009. dlg.m_path += dindanjd;
  1010. dlg.m_path += "\\";
  1011. }
  1012. }
  1013. else
  1014. {
  1015. dlg.m_path += dindanjd;
  1016. dlg.m_path += "\\";
  1017. }
  1018. }
  1019. #endif
  1020. dlg.DoModal();
  1021. if (dlg.m_bdelall)
  1022. {
  1023. for (int i = 0; i < m_List1array.GetSize(); i++)
  1024. {
  1025. if (g_bAllBranch)
  1026. {
  1027. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1028. {
  1029. #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
  1030. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
  1031. #else
  1032. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
  1033. #endif
  1034. FillGrid();
  1035. break;
  1036. }
  1037. }
  1038. else
  1039. {
  1040. if (id == m_List1array.ElementAt(i).ElementAt(0))
  1041. {
  1042. #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
  1043. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
  1044. #else
  1045. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
  1046. #endif
  1047. FillGrid();
  1048. break;
  1049. }
  1050. }
  1051. }
  1052. }
  1053. }
  1054. void TakeFrom::OnBUTmoney() // 今拍 按钮;
  1055. {
  1056. // TODO: Add your control notification handler code here
  1057. UpdateData();
  1058. m_filter.TrimLeft();
  1059. m_filter.TrimRight();
  1060. FillGrid(2);
  1061. }
  1062. void TakeFrom::OnBTNaddsp()
  1063. {
  1064. }
  1065. void TakeFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  1066. {
  1067. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  1068. // TODO: Add your control notification handler code here
  1069. POSITION pos;
  1070. pos = m_List1.GetFirstSelectedItemPosition();
  1071. if (pos == NULL)
  1072. {
  1073. return;
  1074. }
  1075. int iItem = m_List1.GetNextSelectedItem(pos);
  1076. if (IsHasRights2new(4) || IsHasRights2new(49))
  1077. {
  1078. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1079. }
  1080. else
  1081. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1082. *pResult = 0;
  1083. }
  1084. void TakeFrom::OnButton1() // 查询按钮;
  1085. {
  1086. // TODO: Add your control notification handler code here
  1087. UpdateData();
  1088. m_filter.TrimLeft();
  1089. m_filter.TrimRight();
  1090. FillGrid();
  1091. }
  1092. void TakeFrom::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  1093. {
  1094. // TODO: Add your control notification handler code here
  1095. POSITION pos;
  1096. pos = m_List1.GetFirstSelectedItemPosition();
  1097. if (pos == NULL)return;
  1098. int iItem = m_List1.GetNextSelectedItem(pos);
  1099. g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1100. while (g_id == "")
  1101. {
  1102. iItem--;
  1103. g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1104. }
  1105. *pResult = 0;
  1106. }
  1107. void TakeFrom::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  1108. {
  1109. // TODO: Add your control notification handler code here
  1110. OnBUTshowphoto();
  1111. *pResult = 0;
  1112. }
  1113. void TakeFrom::HidePrice()
  1114. {
  1115. int i = 0;
  1116. m_List1arrayBak.RemoveAll();
  1117. m_List1arrayBak.SetSize(m_List1array.GetSize());
  1118. for ( i = 0; i < m_List1array.GetSize(); i++)
  1119. {
  1120. m_List1arrayBak.ElementAt(i).Copy(m_List1array.ElementAt(i));
  1121. }
  1122. }
  1123. void TakeFrom::OnBtnsearchfilter() // 条件查询按钮;
  1124. {
  1125. SearchFilter dlg;
  1126. dlg.m_mode = 1;
  1127. if (dlg.DoModal() == IDOK)
  1128. FillGrid();
  1129. g_bSearchFilter = 0;
  1130. }
  1131. void TakeFrom::OnBUTprint3()
  1132. {
  1133. GetData();
  1134. }
  1135. void TakeFrom::OnButton2() // 客人头像按钮;
  1136. {
  1137. POSITION pos;
  1138. pos = m_List1.GetFirstSelectedItemPosition();
  1139. if (pos == NULL)
  1140. {
  1141. AfxMessageBox("请先选中您要拍头像的客人!", MB_ICONINFORMATION);
  1142. return;
  1143. }
  1144. int iItem = m_List1.GetNextSelectedItem(pos);
  1145. CString branch;
  1146. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1147. if (g_bAllBranch)
  1148. branch = m_List1.GetItemText(iItem, 0);
  1149. while (id == "")
  1150. {
  1151. iItem--;
  1152. id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1153. }
  1154. UploadPhoto dlg;
  1155. if (g_bAllBranch)
  1156. {
  1157. CString branchpath = GetBranchPhotoPath(branch);
  1158. dlg.m_path = g_path1 + branchpath + "\\";
  1159. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1160. ::CreateDirectory(dlg.m_path, NULL);
  1161. }
  1162. else
  1163. dlg.m_path = g_path1 + "\\";
  1164. dlg.m_path += "客人头像\\";
  1165. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1166. ::CreateDirectory(dlg.m_path, NULL);
  1167. dlg.m_path += id + "\\";
  1168. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1169. ::CreateDirectory(dlg.m_path, NULL);
  1170. dlg.DoModal();
  1171. }
  1172. void TakeFrom::GetData()
  1173. {
  1174. if (g_bAllBranch == 0)
  1175. {
  1176. if (g_bShowOK == 0)
  1177. {
  1178. #ifdef LKAY_VERSION
  1179. CString filter="status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  1180. #else
  1181. CString filter = "status3='未取'";
  1182. #endif
  1183. g_sendhead.bsql = 0;
  1184. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1185. g_sendhead.tabcount = 1;
  1186. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1187. if (g_bSendOK == 0)return;
  1188. }
  1189. else
  1190. {
  1191. g_sendhead.bsql = 0;
  1192. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1193. g_sendhead.tabcount = 1;
  1194. #ifdef LKAY_VERSION
  1195. CString filter="dindantype<>'意向客户' or dindantype is null";
  1196. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1197. #else
  1198. g_pMainWnd->ProcessChatMessageRequest2(1);
  1199. #endif
  1200. if (g_bSendOK == 0)return;
  1201. }
  1202. DataToArray(&m_List1array);
  1203. }
  1204. else
  1205. {
  1206. //////////////数据汇总
  1207. m_List1array.RemoveAll();
  1208. CString branch;
  1209. for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
  1210. {
  1211. if (i != -1)
  1212. {
  1213. branch = g_brancharray.ElementAt(i).ElementAt(0);
  1214. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  1215. g_pMainWnd->OnDisconnect();
  1216. g_branchname = branch;
  1217. g_bBranchModify = 1;
  1218. }
  1219. else
  1220. branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
  1221. if (g_bShowOK == 0)
  1222. {
  1223. CString filter = "status3='未取'";
  1224. g_sendhead.bsql = 0;
  1225. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1226. g_sendhead.tabcount = 1;
  1227. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1228. if (g_bSendOK == 0) continue;
  1229. }
  1230. else
  1231. {
  1232. g_sendhead.bsql = 0;
  1233. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1234. g_sendhead.tabcount = 1;
  1235. g_pMainWnd->ProcessChatMessageRequest2(1);
  1236. if (g_bSendOK == 0) continue;
  1237. }
  1238. CArray<CStringArray, CStringArray>List1array;
  1239. DataToArray(&List1array);
  1240. int size = m_List1array.GetSize();
  1241. for (int j = 0; j < List1array.GetSize(); j++)
  1242. {
  1243. size++;
  1244. m_List1array.SetSize(size, 1);
  1245. size--;
  1246. m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
  1247. m_List1array.ElementAt(size).InsertAt(0, branch);
  1248. size++;
  1249. }
  1250. }
  1251. g_pMainWnd->OnDisconnect();
  1252. g_bBranchModify = 0;
  1253. g_branchip = g_branchname = "";
  1254. }
  1255. HidePrice();
  1256. FillGrid();
  1257. }
  1258. void TakeFrom::OnBnClickedMicroshare() // 微分享;
  1259. {
  1260. // 定义变量;
  1261. CString strOrderNumber = _T(""); // 订单号;
  1262. CString strScenery = _T(""); // 景点名;
  1263. CString strCustomer = _T(""); // 顾客名;
  1264. CString strMakeupArtist = _T(""); // 化妆师;
  1265. CString strSourcePath = _T(""); // 相片根目录;
  1266. CString strBranchName = _T(""); // 分店名;
  1267. CString strBranchDomain = _T(""); // 分店域名;
  1268. TCHAR szShareId[MAX_PATH] = _T(""); // 微分享相册ID;
  1269. // 获取变量值;
  1270. POSITION pos;
  1271. pos = m_List1.GetFirstSelectedItemPosition();
  1272. if (pos == NULL)
  1273. {
  1274. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1275. return;
  1276. }
  1277. int iItem = m_List1.GetNextSelectedItem(pos);
  1278. strScenery = m_List1.GetItemText(iItem, 4 + m_nAdd);
  1279. strMakeupArtist = m_List1.GetItemText(iItem, 9 + m_nAdd);
  1280. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1281. if (g_bAllBranch)
  1282. strBranchName = m_List1.GetItemText(iItem, 0);
  1283. while (strOrderNumber == "")
  1284. {
  1285. iItem--;
  1286. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1287. }
  1288. #if 0
  1289. if (g_bAllBranch)
  1290. {
  1291. strBranchDomain = GetBranchPhotoPath(strBranchName);
  1292. strSourcePath = g_path1 + strBranchDomain + "\\";
  1293. }
  1294. else
  1295. {
  1296. strSourcePath = g_path1 + "\\";
  1297. }
  1298. strSourcePath += strOrderNumber;
  1299. strSourcePath += "\\";
  1300. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1301. {
  1302. if (::PathFileExists(strSourcePath + strScenery))
  1303. {
  1304. strSourcePath += strScenery;
  1305. strSourcePath += "\\";
  1306. }
  1307. }
  1308. #else
  1309. CString str;
  1310. CStringArray AryOrderPath;
  1311. int nSize = g_aryOfSharePathInfo.GetSize();
  1312. for ( int i = 0; i < nSize; i++ )
  1313. {
  1314. if ( 1 == atoi(g_aryOfSharePathInfo.ElementAt(i).ElementAt(5)) )
  1315. {
  1316. str = g_aryOfSharePathInfo.ElementAt(i).ElementAt(2);
  1317. if ( g_bAllBranch )
  1318. {
  1319. strBranchDomain = GetBranchPhotoPath(strBranchName);
  1320. str += strBranchDomain;
  1321. }
  1322. str += _T("\\");
  1323. str += strOrderNumber;
  1324. str += _T("\\");
  1325. if ( PathFileExists(str) )
  1326. {
  1327. AryOrderPath.Add(str);
  1328. }
  1329. }
  1330. }
  1331. str = g_path1;
  1332. if ( g_bAllBranch )
  1333. {
  1334. strBranchDomain = GetBranchPhotoPath(strBranchName);
  1335. str += strBranchDomain + "\\";
  1336. }
  1337. str += _T("\\");
  1338. str += strOrderNumber;
  1339. str += _T("\\");
  1340. if ( PathFileExists(str) )
  1341. {
  1342. AryOrderPath.Add(str);
  1343. }
  1344. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1345. {
  1346. int n = AryOrderPath.GetSize();
  1347. for ( int j = 0; j < n; j++ )
  1348. {
  1349. if ( PathFileExists(AryOrderPath.ElementAt(j) + strScenery) )
  1350. {
  1351. strSourcePath = AryOrderPath.ElementAt(j) + strScenery;
  1352. strSourcePath += _T("\\");
  1353. strSourcePath += _T("#");
  1354. }
  1355. }
  1356. }
  1357. else
  1358. {
  1359. for ( int k = 0; k < AryOrderPath.GetSize(); k++ )
  1360. {
  1361. strSourcePath = AryOrderPath.ElementAt(k) ;
  1362. strSourcePath += _T("#");
  1363. }
  1364. }
  1365. #endif
  1366. // 加载动态库;
  1367. if (LoadMicroShareLibrary() == FALSE)
  1368. return;
  1369. if ( g_lyfzCreateShare )
  1370. {
  1371. g_lyfzCreateShare(
  1372. g_cominfoarray.ElementAt(0).ElementAt(147), // 微分享的登录账号;
  1373. g_cominfoarray.ElementAt(0).ElementAt(148), // 微分享的登录账号密码;
  1374. strSourcePath, // 相片根级目录;
  1375. strBranchDomain.Mid(1), // 分店域名;
  1376. strOrderNumber, // 订单号,用于生成二维码文件名;
  1377. strScenery, // 景点名;
  1378. strSourcePath,
  1379. m_List1.GetItemText(iItem, 1 + m_nAdd), // 客人姓名1 ;
  1380. m_List1.GetItemText(iItem, 2 + m_nAdd), // 客人姓名2
  1381. strMakeupArtist, // 化妆师;
  1382. szShareId // 返回微相册ID;
  1383. );
  1384. }
  1385. FreeMicroShareLibrary();
  1386. }
  1387. /************************************************************************/
  1388. /*
  1389. 函数:GetSelectedOrderInfo
  1390. 描述:获取选中的列表项的订单信息;
  1391. 参数:
  1392. [OUT] tagOrderInfo
  1393. [OUT] nFirstItem 第一个景点项索引;
  1394. [OUT] nEndofItem 最后一个景点项索引;
  1395. 返回:空
  1396. 注意:
  1397. 要求:
  1398. 示例:
  1399. 修改:
  1400. 日期:
  1401. 内容:
  1402. */
  1403. /************************************************************************/
  1404. INT TakeFrom::GetSelectedOrderInfo( OUT STOrederInfo &tagOrderInfo, OUT INT& nFirstItem, OUT INT& nEndofItem )
  1405. {
  1406. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  1407. if ( pos == NULL )
  1408. {
  1409. AfxMessageBox(_T("未选中要导入相片的订单!"),MB_ICONINFORMATION);
  1410. return -1;
  1411. }
  1412. INT nItemCount = m_List1.GetItemCount();
  1413. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  1414. //INT nFirstItem = 0; // 记录第一个景点项索引;
  1415. //INT nEndofItem = 0; // 记录最后一个景点项索引;
  1416. INT nSceneryItem = nSelectedItem;
  1417. if ( m_List1.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") )
  1418. {
  1419. STSceneryInfo tagSceneryInfo;
  1420. tagSceneryInfo.bSelected = TRUE;
  1421. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  1422. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  1423. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  1424. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  1425. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  1426. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  1427. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  1428. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  1429. // 查找所有下行;
  1430. nSceneryItem++;
  1431. if ( nSceneryItem < nItemCount )
  1432. {
  1433. while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
  1434. {
  1435. tagSceneryInfo.bSelected = FALSE;
  1436. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  1437. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  1438. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  1439. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  1440. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  1441. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  1442. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  1443. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  1444. nSceneryItem++;
  1445. if ( nSceneryItem >= nItemCount )
  1446. break;
  1447. }
  1448. // 记录最后一个景点项索引;
  1449. nEndofItem = nSceneryItem - 1;
  1450. }
  1451. // 查找所有上行;
  1452. nSceneryItem = nSelectedItem - 1;
  1453. if ( nSceneryItem >= 0)
  1454. {
  1455. while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
  1456. {
  1457. tagSceneryInfo.bSelected = FALSE;
  1458. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  1459. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  1460. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  1461. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  1462. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  1463. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  1464. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  1465. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  1466. nSceneryItem--;
  1467. if ( nSceneryItem < 0 )
  1468. break;
  1469. }
  1470. }
  1471. // 上行结束后,是头位置;
  1472. if ( nSceneryItem >= 0 )
  1473. {
  1474. // 记录第一个景点项索引;
  1475. nFirstItem = nSceneryItem;
  1476. // 用头景点行初始化订单信息;
  1477. if ( g_bAllBranch ) // 是否多店汇总;
  1478. {
  1479. tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
  1480. }
  1481. else
  1482. {
  1483. if ( g_branchname == _T(""))
  1484. tagOrderInfo.strBranchId = g_domain;
  1485. else
  1486. tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
  1487. }
  1488. tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSceneryItem, 0 + m_nAdd);
  1489. tagOrderInfo.strName1 = m_List1.GetItemText(nSceneryItem, 1 + m_nAdd);
  1490. tagOrderInfo.strName2 = m_List1.GetItemText(nSceneryItem, 2 + m_nAdd);
  1491. tagOrderInfo.strImageNumber = m_List1.GetItemText(nSceneryItem, 3 + m_nAdd);
  1492. tagOrderInfo.strClerk = m_List1.GetItemText(nSceneryItem, 11 + m_nAdd);
  1493. // 如果用户权限不足,13和14显示的是"*"符号;
  1494. #if 1
  1495. tagOrderInfo.strPhone = m_List1.GetItemText(nSceneryItem, 14 + m_nAdd);
  1496. tagOrderInfo.strTelPhone = m_List1.GetItemText(nSceneryItem, 15 + m_nAdd);
  1497. #else
  1498. if ( g_bAllBranch )
  1499. {
  1500. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  1501. {
  1502. if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1arrayBak.ElementAt(i).ElementAt(0) )
  1503. {
  1504. tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  1505. tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  1506. break;
  1507. }
  1508. }
  1509. }
  1510. else
  1511. {
  1512. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  1513. {
  1514. if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0) )
  1515. {
  1516. tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  1517. tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  1518. break;
  1519. }
  1520. }
  1521. }
  1522. #endif
  1523. // 同时push头景点;
  1524. tagSceneryInfo.bSelected = FALSE;
  1525. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  1526. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  1527. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  1528. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  1529. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  1530. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  1531. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  1532. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  1533. }
  1534. }
  1535. else
  1536. {
  1537. // 记录第一个景点项索引;
  1538. nFirstItem = nSceneryItem;
  1539. // 用头景点行初始化订单信息;
  1540. if ( g_bAllBranch ) // 是否多店汇总;
  1541. {
  1542. tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
  1543. }
  1544. else
  1545. {
  1546. if ( g_branchname == _T(""))
  1547. tagOrderInfo.strBranchId = g_domain;
  1548. else
  1549. tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
  1550. }
  1551. tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  1552. tagOrderInfo.strName1 = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd);
  1553. tagOrderInfo.strName2 = m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  1554. tagOrderInfo.strImageNumber = m_List1.GetItemText(nSelectedItem, 3 + m_nAdd);
  1555. tagOrderInfo.strClerk = m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
  1556. tagOrderInfo.strPhone = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  1557. tagOrderInfo.strTelPhone = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
  1558. // push头景点;
  1559. STSceneryInfo tagSceneryInfo;
  1560. tagSceneryInfo.bSelected = TRUE;
  1561. tagSceneryInfo.strScenery = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd);
  1562. tagSceneryInfo.strStatus = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  1563. tagSceneryInfo.strTime = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  1564. tagSceneryInfo.strLensman = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
  1565. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
  1566. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd);
  1567. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSelectedItem, 10 + m_nAdd);
  1568. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  1569. // 读取下一行,看是否属于本订单的景点;
  1570. nSceneryItem++;
  1571. if ( nSceneryItem < nItemCount )
  1572. {
  1573. while( m_List1.GetItemText( nSceneryItem, 0 + m_nAdd ) == _T("") )
  1574. {
  1575. tagSceneryInfo.bSelected = FALSE;
  1576. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  1577. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  1578. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  1579. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  1580. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  1581. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  1582. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  1583. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  1584. nSceneryItem++;
  1585. if ( nSceneryItem >= nItemCount )
  1586. break;
  1587. }
  1588. // 记录最后一个景点项索引;
  1589. nEndofItem = nSceneryItem - 1;
  1590. }
  1591. }
  1592. return nSelectedItem;
  1593. }