TakeFrom.cpp 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473
  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 "ImportPhoto.h"
  9. #include "ShowPic.h"
  10. #include "SelWaiter2.h"
  11. #include "TakeStautsSel.h"
  12. #include "SalaryRateSet2.h"
  13. #include "UploadPhoto.h"
  14. #include "NetShareInfo.h"
  15. #include "SetOrderInfo.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. IMPLEMENT_DYNCREATE(TakeFrom, MyFormView)
  23. TakeFrom::TakeFrom() : MyFormView(TakeFrom::IDD)
  24. {
  25. m_filter = _T("");
  26. m_nAdd = 0;
  27. if (g_bAllBranch)
  28. {
  29. m_nAdd = 1;
  30. }
  31. }
  32. TakeFrom::~TakeFrom()
  33. {
  34. }
  35. void TakeFrom::DoDataExchange(CDataExchange* pDX)
  36. {
  37. MyFormView::DoDataExchange(pDX);
  38. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  39. DDX_Control(pDX, IDC_LIST2, m_List1);
  40. DDX_Control(pDX, IDC_STATIC1, m_static1);
  41. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  42. }
  43. BEGIN_MESSAGE_MAP(TakeFrom, MyFormView)
  44. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  45. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  46. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  47. ON_WM_TIMER()
  48. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  49. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  50. ON_BN_CLICKED(IDC_BUTmoney, OnBUTmoney)
  51. ON_BN_CLICKED(IDC_BTNaddsp, OnBTNaddsp)
  52. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  53. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  54. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  55. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  56. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  57. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  58. ON_BN_CLICKED(Btn_MicroShare, OnBnClickedMicroshare)
  59. ON_MESSAGE(MSG_KERNEL_CALLBACK, OnKernelCallBack)
  60. END_MESSAGE_MAP()
  61. #ifdef _DEBUG
  62. void TakeFrom::AssertValid() const
  63. {
  64. MyFormView::AssertValid();
  65. }
  66. void TakeFrom::Dump(CDumpContext& dc) const
  67. {
  68. MyFormView::Dump(dc);
  69. }
  70. #endif //_DEBUG
  71. LRESULT TakeFrom::OnKernelCallBack(WPARAM wp,LPARAM lp)
  72. {
  73. GetData();
  74. return 0;
  75. }
  76. void TakeFrom::OnInitialUpdate()
  77. {
  78. MyFormView::OnInitialUpdate();
  79. // TODO: Add your specialized code here and/or call the base class
  80. CMyMdi Mdi;
  81. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  82. // Here we create the outbar control using the splitter as its parent
  83. // and setting its id to the first pane.
  84. CRect rc2;
  85. GetWindowRect(rc2);
  86. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  87. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  88. int idarray[] = { IDC_BUTprint3, IDC_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTTON2, IDC_BUTclose };
  89. int idcount = 5;
  90. int btnwid;
  91. CRect prerc;
  92. for (int a = idcount - 2; a >= 0; a--)
  93. {
  94. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  95. ScreenToClient(prerc);
  96. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  97. ScreenToClient(rc2);
  98. btnwid = rc2.Width();
  99. rc2.right = prerc.left;
  100. rc2.left = rc2.right - btnwid;
  101. GetDlgItem(idarray[a])->MoveWindow(rc2);
  102. }
  103. m_static1.SetFont(&g_titlefont);
  104. if (g_bAllBranch == 0)
  105. {
  106. #ifdef CHILD_VERSION
  107. #ifdef LKAY_VERSION
  108. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;导片日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  109. #else
  110. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  111. #endif
  112. #else
  113. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  114. #endif
  115. m_List1.LoadColumnInfo(114);
  116. }
  117. else
  118. {
  119. #ifdef CHILD_VERSION
  120. m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  121. #else
  122. m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  123. #endif
  124. m_List1.LoadColumnInfo(196);
  125. GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
  126. }
  127. #if JEFF_DELETE_OFF // 多景点时排序有问题!
  128. m_List1.m_bSortSupport = 0;
  129. #endif
  130. GetData();
  131. m_combo1.AddString(g_user.name);
  132. m_combo1.GetWindowRect(rc2);
  133. ScreenToClient(rc2);
  134. rc2.bottom += 200;
  135. m_combo1.MoveWindow(rc2);
  136. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  137. SetComboHei(&m_combo1, rc2.Height());
  138. }
  139. void TakeFrom::FillGrid(BOOL bStatus/*=0*/)
  140. {
  141. if (g_bSearchFilter) // 1.按钮:条件查询;
  142. {
  143. m_List1.DeleteAllItems2();
  144. int ii = 0;
  145. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  146. int count = 0;
  147. {
  148. BOOL bFinded = 0;
  149. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  150. {
  151. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  152. {
  153. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  154. continue;
  155. }
  156. if (g_filterdate1 != "") // Jeff.查询过滤条件:日期;
  157. {
  158. if (m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) > g_filterdate2)
  159. {
  160. bFinded = 0;
  161. continue;
  162. }
  163. }
  164. if (g_waiter1 != "") // Jeff.查询过滤条件:门市;
  165. {
  166. if (m_List1array.ElementAt(ii).ElementAt(11 + m_nAdd) != g_waiter1)
  167. {
  168. bFinded = 0;
  169. continue;
  170. }
  171. }
  172. if (g_waiter2 != "") // Jeff.查询过滤条件:摄影师;
  173. {
  174. if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) != g_waiter2)
  175. {
  176. bFinded = 0;
  177. continue;
  178. }
  179. }
  180. if (g_waiter3 != "") // Jeff.查询过滤条件:化妆师;
  181. {
  182. if (m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd) != g_waiter3)
  183. {
  184. bFinded = 0;
  185. continue;
  186. }
  187. }
  188. if (g_waiter4 != "") // Jeff.查询套系类别;
  189. {
  190. if (m_List1array.ElementAt(ii).ElementAt(3) != g_waiter4)
  191. {
  192. bFinded = 0;
  193. continue;
  194. }
  195. }
  196. if (g_bAllBranch && g_filterbranch != "") // Jeff.集团版查询过滤条件:分店名称;
  197. {
  198. if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
  199. {
  200. bFinded = 0;
  201. continue;
  202. }
  203. }
  204. // 2015.03.30
  205. // Jeff:上面已有判断,这里必须判断订单号非空才能添加,否则会添加其他空的选项;
  206. if (!m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  207. {
  208. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  209. bFinded = 1;
  210. }
  211. }
  212. }
  213. m_List1.m_arLabels.SetSize(count, 1);
  214. ii = count;
  215. m_List1.m_LabelCount = ii;
  216. m_List1.SetItemCountEx(ii);
  217. CString str;
  218. str.Format("单数:%d", ii);
  219. SetDlgItemText(IDC_STATIC2, str);
  220. }
  221. else // 2.其他显示;
  222. {
  223. m_List1.DeleteAllItems2();
  224. int ii = 0;
  225. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  226. int count = 0;
  227. if (m_filter.IsEmpty()) // 2.1.没有查询关键字;
  228. {
  229. if (bStatus == 1) // bStatus==1,没用到;
  230. {
  231. BOOL bFinded = 0;
  232. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  233. {
  234. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  235. {
  236. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  237. continue;
  238. }
  239. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0)
  240. {
  241. bFinded = 1;
  242. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  243. }
  244. else
  245. {
  246. bFinded = 0;
  247. }
  248. }
  249. }
  250. else if (bStatus == 2) // 今拍按钮用到;
  251. {
  252. BOOL bFinded = 0;
  253. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  254. {
  255. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  256. {
  257. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  258. continue;
  259. }
  260. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date)
  261. {
  262. bFinded = 1;
  263. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  264. }
  265. else
  266. {
  267. bFinded = 0;
  268. }
  269. }
  270. }
  271. else // bStatus==0;默认使用的值;
  272. {
  273. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  274. {
  275. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  276. }
  277. }
  278. }
  279. else // 2.2.指定查询条件 ;
  280. {
  281. if (bStatus == 1)
  282. {
  283. BOOL bFinded = 0;
  284. int type = GetType(m_filter);
  285. if (type == 1)//电话
  286. {
  287. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  288. {
  289. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  290. {
  291. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  292. continue;
  293. }
  294. 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 || \
  295. m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
  296. {
  297. bFinded = 1;
  298. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  299. }
  300. else
  301. {
  302. bFinded = 0;
  303. }
  304. }
  305. }
  306. else if (type == 2)//拼音
  307. {
  308. BOOL bFinded = 0;
  309. m_filter.MakeUpper();
  310. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  311. {
  312. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  313. {
  314. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  315. continue;
  316. }
  317. 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 || \
  318. m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1))
  319. {
  320. bFinded = 1;
  321. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  322. }
  323. else
  324. {
  325. bFinded = 0;
  326. }
  327. }
  328. }
  329. else
  330. {
  331. BOOL bFinded = 0;
  332. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  333. {
  334. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  335. {
  336. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  337. continue;
  338. }
  339. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&\
  340. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && \
  341. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  342. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  343. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  344. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  345. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  346. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  347. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  348. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  349. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  350. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  351. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  352. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  353. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  354. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  355. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  356. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  357. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
  358. {
  359. bFinded = 1;
  360. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  361. }
  362. else
  363. {
  364. bFinded = 0;
  365. }
  366. }
  367. }
  368. }
  369. else if (bStatus == 2)
  370. {
  371. BOOL bFinded = 0;
  372. int type = GetType(m_filter);
  373. if (type == 1)//电话
  374. {
  375. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  376. {
  377. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  378. {
  379. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  380. continue;
  381. }
  382. 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 || \
  383. m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
  384. {
  385. bFinded = 1;
  386. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  387. }
  388. else
  389. {
  390. bFinded = 0;
  391. }
  392. }
  393. }
  394. else if (type == 2)//拼音
  395. {
  396. BOOL bFinded = 0;
  397. m_filter.MakeUpper();
  398. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  399. {
  400. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  401. {
  402. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  403. continue;
  404. }
  405. 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 || \
  406. m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1))
  407. {
  408. bFinded = 1;
  409. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  410. }
  411. else
  412. {
  413. bFinded = 0;
  414. }
  415. }
  416. }
  417. else
  418. {
  419. BOOL bFinded = 0;
  420. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  421. {
  422. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  423. {
  424. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  425. continue;
  426. }
  427. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date &&\
  428. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  429. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  430. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  431. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  432. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  433. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  434. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  435. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  436. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  437. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  438. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  439. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  440. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  441. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  442. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  443. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  444. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
  445. {
  446. bFinded = 1;
  447. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  448. }
  449. else
  450. {
  451. bFinded = 0;
  452. }
  453. }
  454. }
  455. }
  456. else
  457. {
  458. int type = GetType(m_filter);
  459. if (type == 1)//电话
  460. {
  461. BOOL bFinded = 0;
  462. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  463. {
  464. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  465. {
  466. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  467. continue;
  468. }
  469. if (m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1 || \
  470. m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1)
  471. {
  472. bFinded = 1;
  473. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  474. }
  475. else
  476. {
  477. bFinded = 0;
  478. }
  479. }
  480. }
  481. else if (type == 2)//拼音
  482. {
  483. BOOL bFinded = 0;
  484. m_filter.MakeUpper();
  485. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  486. {
  487. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  488. {
  489. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  490. continue;
  491. }
  492. if (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
  493. m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1)
  494. {
  495. bFinded = 1;
  496. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  497. }
  498. else
  499. {
  500. bFinded = 0;
  501. }
  502. }
  503. }
  504. else
  505. {
  506. BOOL bFinded = 0;
  507. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  508. {
  509. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  510. {
  511. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  512. continue;
  513. }
  514. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  515. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  516. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  517. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  518. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  519. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  520. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  521. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  522. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  523. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  524. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  525. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  526. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  527. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  528. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  529. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  530. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1)
  531. {
  532. bFinded = 1;
  533. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  534. }
  535. else
  536. {
  537. bFinded = 0;
  538. }
  539. }
  540. }
  541. }
  542. }
  543. m_List1.m_arLabels.SetSize(count, 1);
  544. ii = count;
  545. m_List1.m_LabelCount = ii;
  546. m_List1.SetItemCountEx(ii);
  547. CString str;
  548. str.Format("单数:%d", ii);
  549. SetDlgItemText(IDC_STATIC2, str);
  550. }
  551. if (!g_id.IsEmpty())
  552. {
  553. for (int i = 0; i < m_List1.GetItemCount(); i++)
  554. {
  555. if (g_id == m_List1.GetItemText(i, 0 + m_nAdd))
  556. {
  557. m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  558. m_List1.EnsureVisible(i, FALSE);
  559. break;
  560. }
  561. }
  562. }
  563. }
  564. void TakeFrom::OnBUTclose()
  565. {
  566. // TODO: Add your control notification handler code here
  567. GetParent()->SendMessage(WM_CLOSE);
  568. }
  569. void TakeFrom::OnSelchangeCombo1()
  570. {
  571. // TODO: Add your control notification handler code here
  572. SetTimer(1, 100, NULL);
  573. }
  574. void TakeFrom::OnTimer(UINT nIDEvent)
  575. {
  576. // TODO: Add your message handler code here and/or call default
  577. KillTimer(nIDEvent);
  578. OnButton1();
  579. }
  580. BOOL TakeFrom::PreTranslateMessage(MSG* pMsg)
  581. {
  582. // TODO: Add your specialized code here and/or call the base class
  583. try
  584. {
  585. if (pMsg->message == WM_KEYDOWN)
  586. {
  587. switch (pMsg->wParam)
  588. {
  589. case VK_RETURN:
  590. OnButton1();
  591. return 1;
  592. case 0x43: // copy
  593. if ((GetKeyState(VK_CONTROL) & 0x80))
  594. {
  595. GetFocus()->SendMessage(WM_COPY);
  596. return TRUE;
  597. }
  598. break;
  599. case 0x56: //Ctrl + V:
  600. if ((GetKeyState(VK_CONTROL) & 0x80))
  601. {
  602. GetFocus()->SendMessage(WM_PASTE);
  603. return TRUE;
  604. }
  605. break;
  606. case 0x58: // cut
  607. if ((GetKeyState(VK_CONTROL) & 0x80))
  608. {
  609. GetFocus()->SendMessage(WM_CUT);
  610. return TRUE;
  611. }
  612. break;
  613. case 0x5A: //undo
  614. case 0x59: //redo
  615. if ((GetKeyState(VK_CONTROL) & 0x80))
  616. {
  617. GetFocus()->SendMessage(WM_UNDO);
  618. return TRUE;
  619. }
  620. break;
  621. }
  622. }
  623. return MyFormView::PreTranslateMessage(pMsg);
  624. }
  625. catch (...)
  626. {
  627. }
  628. return true;
  629. }
  630. // Jeff.remark.
  631. // 1.弹出"拍照状态确认"对话框前,需要获取订单的拍照状态,以此来确定是否需要禁用check状态框;
  632. //
  633. void TakeFrom::OnBUTimportphoto() // 导入原片按钮;
  634. {
  635. #ifdef USE_KERNEL_DLL
  636. INT nFirstItem = 0;
  637. INT nEndofItem = 0;
  638. STOrederInfo tagOrderInfo;
  639. INT nSelectedItem = GetSelectedOrderInfo(tagOrderInfo, nFirstItem, nEndofItem);
  640. // 有多少拍照OK的景点;
  641. INT nOKSize = 0;
  642. // 有多少景点未拍的;
  643. INT nUnOKSize = 0;
  644. vector<STSceneryInfo>::iterator it;
  645. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  646. {
  647. if ( it->strStatus == _T("OK") )
  648. nOKSize++;
  649. if ( it->strStatus == _T("未拍"))
  650. nUnOKSize++;
  651. }
  652. CSetOrderInfo dlg;
  653. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  654. {
  655. // 当前选中的景点列;
  656. if ( it->bSelected == TRUE )
  657. {
  658. dlg.waiter1 = it->strLensman;
  659. dlg.waiter12 = it->strLensmanAssistant;
  660. dlg.waiter2 = it->strBootDivision;
  661. dlg.waiter22 = it->strBootDivisionAssistant;
  662. // 让对话窗口弹出时,显示当前景点的拍照状态;
  663. if(it->strStatus == _T("OK"))
  664. dlg.m_nStatus = 0;
  665. else if( it->strStatus == _T("拍摄中") )
  666. dlg.m_nStatus = 1;
  667. else if( it->strStatus == _T("未拍") )
  668. dlg.m_nStatus = 2;
  669. break;
  670. }
  671. }
  672. if ( dlg.DoModal() == IDOK )
  673. {
  674. it->strLensman = dlg.waiter1;
  675. it->strLensmanAssistant = dlg.waiter12;
  676. it->strBootDivision = dlg.waiter2;
  677. it->strBootDivisionAssistant = dlg.waiter22;
  678. // m_nStatus:
  679. // 0:此景点拍照OK; 1:此景点拍照中; 2:此景点未拍照; 3:全部景点拍照OK;
  680. if ( dlg.m_nStatus == 0 )
  681. {// 所选景点设置OK,nOKSize加;
  682. if ( it->strStatus != _T("OK"))
  683. {
  684. nOKSize++;
  685. if ( it->strStatus == _T("未拍"))
  686. nUnOKSize--;
  687. }
  688. it->strStatus = _T("OK");
  689. }
  690. else if ( dlg.m_nStatus == 1 )
  691. {// 所选景点设置拍照中; 若原本景点OK,nOKSize减;
  692. if ( it->strStatus == _T("OK"))
  693. nOKSize--;
  694. if (it->strStatus == _T("未拍"))
  695. nUnOKSize--;
  696. it->strStatus = _T("拍摄中");
  697. }
  698. else if ( dlg.m_nStatus == 2 )
  699. {// 所选景点设置未拍照;若原本景点OK,nOKSize加;
  700. if ( it->strStatus == _T("OK"))
  701. {
  702. nOKSize--;
  703. nUnOKSize++;
  704. }
  705. if ( it->strStatus == _T("拍摄中"))
  706. nUnOKSize++;
  707. it->strStatus = _T("未拍");
  708. }
  709. else if ( dlg.m_nStatus == 3 )
  710. {// 全部景点设置OK;
  711. nOKSize = tagOrderInfo.vtOrderScenery.size();
  712. nUnOKSize = 0;
  713. it->strStatus = _T("OK");
  714. }
  715. //////////////////////////////////////////////////////////////////////////
  716. // SQL语句;
  717. CString strSQL = _T("");
  718. CString strSQL2 = _T("");
  719. if ( nOKSize == 0 )
  720. {// 全部景点未拍照 (若已全部景点OK,不改变订单的拍照状态和订单的拍照日期);
  721. if ( nUnOKSize == 0)
  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. else
  724. 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);
  725. }
  726. else if ( nOKSize == tagOrderInfo.vtOrderScenery.size() )
  727. {// 全部景点都OK,设置所有dindanjd表的订单景点拍照状态OK,且设置订单的拍照日期(原本状态OK的,不改变拍照日期);
  728. 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);
  729. strSQL2.Format(_T("***update dindanjd set [status] = 'OK' where id = '%s'"),tagOrderInfo.strOrderNumber);
  730. strSQL += strSQL2;
  731. //////////////////////////////////////////////////////////////////////////
  732. // 全部景点拍照OK时,判断是否需要生成短信;
  733. if ( atoi(g_cominfoarray.ElementAt(0).ElementAt(101)) )
  734. {
  735. CString strTimeStamp = _T("msgtimestamp");
  736. CString strSMSContent = CString(g_cominfoarray.ElementAt(0).ElementAt(105));
  737. // 获取用户手机号码;
  738. CString strPhone1 = tagOrderInfo.strPhone;
  739. CString strPhone2 = tagOrderInfo.strTelPhone;
  740. if ( strPhone1.Find(_T("***")) != -1 )
  741. {//若用户权限不足以获取手机号码,重新获取;
  742. CString strBranchName = GetBranchNamebyId(tagOrderInfo.strBranchId);
  743. if ( g_bAllBranch )
  744. {
  745. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  746. {
  747. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && strBranchName == m_List1arrayBak.ElementAt(i).ElementAt(0))
  748. {
  749. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  750. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  751. break;
  752. }
  753. }
  754. }
  755. else
  756. {
  757. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  758. {
  759. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
  760. {
  761. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  762. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  763. break;
  764. }
  765. }
  766. }
  767. }
  768. // 生成短信内容;
  769. CString strtemp = _T("");
  770. #ifdef CHILD_VERSION
  771. if ( !tagOrderInfo.strName1.IsEmpty() )
  772. strtemp = tagOrderInfo.strName1 + _T(",");
  773. strtemp += tagOrderInfo.strName2;
  774. strtemp.TrimRight(_T(","));
  775. if( !strtemp.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(strtemp,0) )
  776. {
  777. strtemp += strSMSContent;
  778. strtemp.Replace(_T("xxx小朋友"), _T(""));
  779. int nCount = GetLengthEx(strtemp)/MSG_LENGTH;
  780. if( GetLengthEx(strtemp)%MSG_LENGTH )
  781. nCount++;
  782. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  783. strSQL += _T("***") + strSQL2;
  784. }
  785. #else
  786. if ( strSMSContent.Find(_T("xxx先生/女士")) != -1 )
  787. {
  788. int nCount = 0;
  789. // 男士短信;
  790. if ( !tagOrderInfo.strName1.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(tagOrderInfo.strName1, 0) )
  791. {
  792. strtemp = strSMSContent;
  793. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
  794. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  795. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  796. nCount++;
  797. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  798. strSQL += _T("***") + strSQL2;
  799. }
  800. // 女士短信;
  801. if ( !tagOrderInfo.strName2.IsEmpty() && CheckPhoneType(strPhone2) != -1 && CheckBadWords(tagOrderInfo.strName2, 0) )
  802. {
  803. strtemp = strSMSContent;
  804. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName2 + _T("女士"));
  805. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  806. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  807. nCount++;
  808. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone2, strtemp, _T("msgtimexxstamp"), nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  809. strSQL += _T("***") + strSQL2;
  810. }
  811. }
  812. #endif
  813. }
  814. }
  815. else
  816. {// 部分景点拍照;拍照中(若订单的拍照状态已OK,不修改状态);
  817. 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);
  818. }
  819. // 最多4个景点,4组摄影师+化妆师;
  820. if ( nSelectedItem == nFirstItem )
  821. {
  822. strSQL2.Format(_T("***update dindan set waiter1 = '%s', waiter2 = '%s' where id = '%s'"),
  823. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  824. }
  825. else if ( nSelectedItem == nFirstItem + 1)
  826. {
  827. strSQL2.Format(_T("***update dindan set waiter12 = '%s', waiter22 = '%s' where id = '%s'"),
  828. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  829. }
  830. else if ( nSelectedItem == nFirstItem + 2)
  831. {
  832. strSQL2.Format(_T("***update dindan set waiter13 = '%s', waiter23 = '%s' where id = '%s'"),
  833. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  834. }
  835. else if ( nSelectedItem == nFirstItem + 3)
  836. {
  837. strSQL2.Format(_T("***update dindan set waiter14 = '%s', waiter24 = '%s' where id = '%s'"),
  838. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  839. }
  840. strSQL += strSQL2;
  841. strSQL2.Format(_T("***update dindanjd set [date]= '%s', [status] = '%s', [waiter1] = '%s', [waiter12] = '%s', [waiter2] = '%s',[waiter22] ='%s' where id = '%s' and [name] = '%s' "),
  842. g_date, it->strStatus, it->strLensman, it->strLensmanAssistant, it->strBootDivision, it->strBootDivisionAssistant, tagOrderInfo.strOrderNumber, it->strScenery);
  843. strSQL += strSQL2;
  844. strSQL2.Format(_T("***gentakecontent:"),tagOrderInfo.strOrderNumber);//拍照OK时记录客人预定内容
  845. strSQL += strSQL2;
  846. //////////////////////////////////////////////////////////////////////////
  847. // 构建发送给服务器的包;
  848. g_sendhead.bsql = TRUE;
  849. if ( g_bAllBranch )
  850. {
  851. // 多店汇总;
  852. g_branchip = GetIP(tagOrderInfo.strBranchId);
  853. g_pMainWnd->OnDisconnect();
  854. g_branchname = tagOrderInfo.strBranchId;
  855. g_bBranchModify = TRUE;
  856. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  857. g_pMainWnd->OnDisconnect();
  858. g_bBranchModify = FALSE;
  859. g_branchip = g_branchname = _T("");
  860. }
  861. else
  862. {
  863. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  864. }
  865. //////////////////////////////////////////////////////////////////////////
  866. // 接收服务器返回的数据;
  867. if (g_bSendOK == 0)
  868. {
  869. OutputDebugString(_T("\n服务器返回数据失败!\n"));
  870. return;
  871. }
  872. if (g_bAllBranch == 0)
  873. {// 连接本店或分店时;
  874. GetData();
  875. }
  876. else
  877. {// 多店汇总时;
  878. BOOL bFind = 0;
  879. for (int i = 0; i < m_List1array.GetSize(); i++)
  880. {
  881. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != _T(""))break;
  882. if (tagOrderInfo.strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1array.ElementAt(i).ElementAt(0))
  883. {
  884. bFind = 1;
  885. }
  886. if (bFind && it->strScenery == m_List1array.ElementAt(i).ElementAt(4))
  887. {
  888. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, it->strLensman);
  889. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, it->strLensmanAssistant);
  890. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, it->strBootDivision);
  891. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, it->strBootDivisionAssistant);
  892. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, it->strStatus);
  893. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  894. //m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
  895. FillGrid();
  896. break;
  897. }
  898. }
  899. }
  900. }
  901. // 开始导入初修片;
  902. if ( MessageBox(_T("是否现在开始导入原片!"), _T("导片提示:导入原片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
  903. {// 是否马上导入相片;
  904. return;
  905. }
  906. //////////////////////////////////////////////////////////////////////////
  907. INT nImgNum = atoi(tagOrderInfo.strImageNumber);
  908. if ( nImgNum <= 0)
  909. nImgNum = 1;
  910. else
  911. ++nImgNum;
  912. ImgImportInterface *pImport = NULL;
  913. if ( g_pIMGProcess == NULL )
  914. {
  915. AfxMessageBox(_T("lyfzIMGProcess模块加载失败!"));
  916. return;
  917. }
  918. g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  919. if ( pImport )
  920. {
  921. pImport->ImportOriginalImg(
  922. TRUE, // 文件夹形式打开源或多选文件形式;
  923. !g_bOriginal, // 相片是否需要重命名;
  924. nImgNum, // 相片数字编号;
  925. tagOrderInfo.strBranchId, // 分店域名;
  926. tagOrderInfo.strOrderNumber, // 订单号;
  927. tagOrderInfo.strName1 + _T(",") + tagOrderInfo.strName2, // 顾客信息,可任意组合;
  928. TRUE, // 导入时,是否生成景点名文件夹;
  929. it->strScenery, // 导入时,景点名;
  930. _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
  931. INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
  932. _T("*.nef|*.cr2|*.raw"), // 导入时,附加的扩展名相片;
  933. TRUE, // 导入时,是否生成缩略图;
  934. SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
  935. FALSE // 导入时,文件存在时是否覆盖;
  936. );
  937. g_pIMGProcess->Release();
  938. }
  939. //////////////////////////////////////////////////////////////////////////
  940. #else
  941. POSITION pos;
  942. pos = m_List1.GetFirstSelectedItemPosition();
  943. if (pos == NULL)
  944. {
  945. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  946. return;
  947. }
  948. // 1.选中的起始行号;
  949. int iItem = m_List1.GetNextSelectedItem(pos);
  950. // 2.选中的行数;
  951. int itemcount = m_List1.GetItemCount();
  952. int iItemBak = iItem;
  953. CString status2 = "OK";
  954. CString branch;
  955. CString strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd); // .OrderNumber订单号;
  956. int beginno = atoi(m_List1.GetItemText(iItem, 3 + m_nAdd)) + 1; // .Jeff.起始编号,即下一次相片命名的号码数;由服务器减1,客户端加1;
  957. if (g_bAllBranch)
  958. branch = m_List1.GetItemText(iItem, 0);
  959. // Jeff.多景点时,选择了不是第一个景点,订单是空的;
  960. while (strOrderNumber == "")
  961. {
  962. iItem--;
  963. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  964. beginno = atoi(m_List1.GetItemText(iItem, 3 + m_nAdd)) + 1; // 由服务器减1,客户端加1;
  965. }
  966. int nTopItem = iItem;// Jeff add:记录第一个有订单号的项;
  967. //int nNotOkItem = -1; // Jeff add:第一个被记录未拍照ok的子景点项;如果是头景点呢?
  968. // .jdpos景点位置;并不能用来判断该订单是否多个景点,因为如果iItem是有订单号的话,无效;
  969. int jdpos = iItemBak - iItem;
  970. // .订单拍摄如果不是ok状态,设置为拍摄中;
  971. BOOL bOK = TRUE; //Jeff.add;
  972. #if 1 // Jeff.用于判断是否只剩下一个 未OK 状态时,拍照确认对话框的复选是否需要勾上;
  973. // 此时iItem为有订单号的头景点;
  974. if (m_List1.GetItemText(iItem, 5 + m_nAdd) != "OK")
  975. {
  976. status2 = "拍摄中";
  977. //bOK = FALSE;
  978. }
  979. // .子景点(如果有的话);
  980. ++iItem;
  981. while (iItem < itemcount && m_List1.GetItemText(iItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
  982. {
  983. if (m_List1.GetItemText(iItem, 5 + m_nAdd) != "OK" && iItemBak != iItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
  984. {
  985. status2 = "拍摄中";
  986. //bOK = FALSE;
  987. //nNotOkItem = iItem;
  988. break;
  989. }
  990. iItem++;
  991. }
  992. // printf("Jeff:对话框前的状态:%s\n\n",status2);
  993. #endif //#if 1
  994. iItem = iItemBak;
  995. CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
  996. CString waiter1 = m_List1.GetItemText(iItem, 7 + m_nAdd);
  997. CString waiter12 = m_List1.GetItemText(iItem, 8 + m_nAdd);
  998. CString waiter2 = m_List1.GetItemText(iItem, 9 + m_nAdd);
  999. CString waiter22 = m_List1.GetItemText(iItem, 10 + m_nAdd);
  1000. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1001. while (strOrderNumber == "")
  1002. {
  1003. iItem--;
  1004. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1005. }
  1006. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1007. name.TrimLeft(",");
  1008. name.TrimRight(",");
  1009. name = "客人:" + name;
  1010. CString phone = m_List1.GetItemText(iItem, 14 + m_nAdd) + "," + m_List1.GetItemText(iItem, 15 + m_nAdd);
  1011. phone.TrimLeft(",");
  1012. phone.TrimRight(",");
  1013. phone = "电话:" + phone;
  1014. CString strDomain = _T("");
  1015. CString savepath = _T("");
  1016. if (g_bAllBranch)
  1017. strDomain = GetDomainFromBranch(branch);
  1018. else
  1019. {
  1020. if(g_branchname != _T(""))
  1021. strDomain = GetDomainFromBranch(g_branchname);
  1022. }
  1023. //////////////////////////////////////////////////////////////////////////
  1024. // 获取可用的共享目录;
  1025. #if USE_SHARE_FLORD // 2015.04.13
  1026. TCHAR szSharePath[MAX_PATH] = {0};
  1027. if ( CNetShareInfo::GetInstance()->GetEnableShareDirectory(1, strOrderNumber, strDomain, szSharePath) )
  1028. {
  1029. savepath.Format("%s\\",szSharePath);
  1030. }
  1031. else
  1032. {
  1033. AfxMessageBox(_T("没有可用的共享目录!"));
  1034. return;
  1035. }
  1036. #else
  1037. savepath += strOrderNumber + "\\";
  1038. #endif //#if USE_SHARE_FLORD
  1039. //////////////////////////////////////////////////////////////////////////
  1040. if ( !CheckFolderFileExist(savepath) )
  1041. {
  1042. if( !CreateDirectory(savepath, NULL) )
  1043. {
  1044. AfxMessageBox(_T("无法创建订单目录,确认权限充足"));
  1045. return;
  1046. }
  1047. }
  1048. CString calnopath = savepath;
  1049. savepath += dindanjd + "\\";
  1050. if (::CheckFolderFileExist(savepath) == 0)
  1051. ::CreateDirectory(savepath, NULL);
  1052. CString Filter = "图片文件 (*.jpg)|*.jpg|原始格式RAW (*.raw)|*.raw|原始格式NEF (*.nef)|*.nef|原始格式CR2 (*.cr2)|*.cr2||";
  1053. // .选择要导入的相片,可多选;
  1054. CFileDialog fdlg(true, NULL, "openfile", OFN_ALLOWMULTISELECT, Filter);
  1055. TCHAR szBuffer[60000] = { 0 };
  1056. fdlg.m_ofn.lpstrFile = szBuffer;
  1057. fdlg.m_ofn.nMaxFile = 60000;
  1058. if (fdlg.DoModal() != IDOK)
  1059. {
  1060. // .拍摄人员确认 SelWaiter2;
  1061. SelWaiter2 waiterdlg;
  1062. waiterdlg.waiter1 = waiter1;
  1063. waiterdlg.waiter12 = waiter12;
  1064. waiterdlg.waiter2 = waiter2;
  1065. waiterdlg.waiter22 = waiter22;
  1066. waiterdlg.beginno = beginno;// Jeff,实际上SelWaiter::beginno并没有任何作用,这里放置具有误导性!
  1067. if (waiterdlg.DoModal() != IDOK)return;
  1068. waiter1 = waiterdlg.waiter1;
  1069. waiter12 = waiterdlg.waiter12;
  1070. waiter2 = waiterdlg.waiter2;
  1071. waiter22 = waiterdlg.waiter22;
  1072. beginno = waiterdlg.beginno;
  1073. CString status;
  1074. // .拍照状态确认.对话框.
  1075. TakeStautsSel dlg2;
  1076. if (status2 == "OK") // .拍照状态为ok时;
  1077. {
  1078. dlg2.m_check1 = 1;
  1079. // Jeff.add:已经是ok的拍照状态,禁用用户修改该状态;IDC_CHECK1
  1080. //dlg2.DisEnableCheck();
  1081. dlg2.m_bCheckEnalbe = FALSE;
  1082. }
  1083. dlg2.DoModal();
  1084. if (dlg2.m_radio1 == 0)
  1085. {
  1086. status = "OK";
  1087. }
  1088. else if (dlg2.m_radio1 == 1)
  1089. {
  1090. status = "拍摄中";
  1091. //dlg2.CheckChange();
  1092. }
  1093. else
  1094. {
  1095. status = "未拍";
  1096. //dlg2.CheckChange();
  1097. }
  1098. #if 1
  1099. //本次选择ok时,需要再检查一下,看是否全部都已经ok;
  1100. // 此时iItem为有订单号的头景点;
  1101. // printf("Jeff:景点拍照完成,nTopItem=%d\n\n",nTopItem);
  1102. bOK = TRUE;
  1103. status2 = "OK";
  1104. int nItem = nTopItem;
  1105. if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK")
  1106. {
  1107. if (nItem != iItemBak)
  1108. {
  1109. status2 = "拍摄中";
  1110. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1111. bOK = FALSE;
  1112. }
  1113. else if (status != "OK")
  1114. {
  1115. status2 = "拍摄中";
  1116. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1117. bOK = FALSE;
  1118. }
  1119. }
  1120. // .子景点(如果有的话);
  1121. ++nItem;
  1122. while (nItem < itemcount && m_List1.GetItemText(nItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
  1123. {
  1124. if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK" && iItemBak != nItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
  1125. {
  1126. status2 = "拍摄中";
  1127. bOK = FALSE;
  1128. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1129. break;
  1130. }
  1131. else
  1132. {
  1133. if (status != "OK")
  1134. {
  1135. status2 = "拍摄中";
  1136. bOK = FALSE;
  1137. }
  1138. }
  1139. ++nItem;
  1140. }
  1141. if (bOK) status2 = "OK";
  1142. #endif
  1143. #if 1
  1144. //if ( !bOK )
  1145. // status2 = "拍摄中";
  1146. //else if(dlg2.m_check1) // .拍照景点全部ok状态;
  1147. // status2 = "OK";
  1148. CString sql;
  1149. if (dlg2.m_check1)
  1150. {
  1151. status2 = "OK";
  1152. // Jeff:如果有多个景点,全部设置为拍照ok;
  1153. // 需要遍历处理;
  1154. sql.Format("update dindanjd set [status]='OK' where id='%s'", strOrderNumber);
  1155. // printf("Jeff:全部景点选择拍照OK,SQL=%s\n\n",sql);
  1156. }
  1157. #endif //#if 1
  1158. //CString sql;
  1159. //sql="update dindanjd set [status]='"+status+"',[waiter1]='"+waiter1+"',[waiter12]='"+waiter12+"',[waiter2]='"+waiter2+"',[waiter22]='"+waiter22+"' where [id]='"+id+"' and [name]='"+dindanjd+"'";
  1160. sql += "***update dindanjd set [status]='" + status + "',[waiter1]='" + waiter1 + "',[waiter12]='" + waiter12 + "',[waiter2]='" + waiter2 + "',[waiter22]='" + waiter22 + "' where [id]='" + strOrderNumber + "' and [name]='" + dindanjd + "'";
  1161. #ifndef LYFZ_VERSION
  1162. if (jdpos == 0)
  1163. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
  1164. else if (jdpos == 1)
  1165. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
  1166. else if (jdpos == 2)
  1167. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
  1168. else if (jdpos == 3)
  1169. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
  1170. else
  1171. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end where [id]='" + strOrderNumber + "'";
  1172. #else
  1173. sql+="***update dindan set [status]=case when [status]<>'OK' then '"+status2+"' else [status] end where [id]='"+strOrderNumber+"'";
  1174. #endif //#ifndef LYFZ_VERSION
  1175. CString sql2;
  1176. if (1)
  1177. {
  1178. sql2 = "***gentakecontent:" + strOrderNumber;
  1179. sql += sql2;
  1180. }
  1181. g_sendhead.bsql = 1;
  1182. if (g_bAllBranch)
  1183. {
  1184. g_branchip = GetIP(branch);
  1185. g_pMainWnd->OnDisconnect();
  1186. g_branchname = branch;
  1187. g_bBranchModify = 1;
  1188. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1189. g_pMainWnd->OnDisconnect();
  1190. g_bBranchModify = 0;
  1191. g_branchip = g_branchname = "";
  1192. }
  1193. else
  1194. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1195. if (g_bSendOK == 0)return;
  1196. if (g_bAllBranch == 0)
  1197. {
  1198. GetData();
  1199. }
  1200. else
  1201. {
  1202. BOOL bFind = 0;
  1203. for (int i = 0; i < m_List1array.GetSize(); i++)
  1204. {
  1205. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != "")break;
  1206. if (strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1207. {
  1208. bFind = 1;
  1209. }
  1210. if (bFind && dindanjd == m_List1array.ElementAt(i).ElementAt(4))
  1211. {
  1212. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, waiter1);
  1213. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, waiter12);
  1214. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, waiter2);
  1215. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, waiter22);
  1216. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, status);
  1217. FillGrid();
  1218. break;
  1219. }
  1220. }
  1221. }
  1222. return;
  1223. }
  1224. pos = fdlg.GetStartPosition();
  1225. CStringArray array;
  1226. while (pos != NULL)
  1227. {
  1228. array.Add(fdlg.GetNextPathName(pos));
  1229. }
  1230. if (array.GetSize() == 0)return;
  1231. if (1)
  1232. {
  1233. CString str;
  1234. str.Format("%s\r\n%s\r\n景点:%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone, dindanjd);
  1235. if (AfxMessageBox(str, MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1236. return;
  1237. }
  1238. SelWaiter2 waiterdlg;
  1239. waiterdlg.waiter1 = waiter1;
  1240. waiterdlg.waiter12 = waiter12;
  1241. waiterdlg.waiter2 = waiter2;
  1242. waiterdlg.waiter22 = waiter22;
  1243. waiterdlg.beginno = beginno;
  1244. if (waiterdlg.DoModal() != IDOK)return;
  1245. waiter1 = waiterdlg.waiter1;
  1246. waiter12 = waiterdlg.waiter12;
  1247. waiter2 = waiterdlg.waiter2;
  1248. waiter22 = waiterdlg.waiter22;
  1249. beginno = waiterdlg.beginno;
  1250. //----------------------------------------------------------------------------------------------
  1251. //----------------------------------------------------------------------------------------------
  1252. //----------------------------------------------------------------------------------------------
  1253. // 导入拍照好的相片;
  1254. ImportPhoto dlg;
  1255. #if USE_SHARE_FLORD
  1256. dlg.m_id = strOrderNumber; // add by 2015-07-06 Jeff;
  1257. #endif //#if USE_SHARE_FLORD
  1258. dlg.beginno = beginno; // 当前订单相片编号;
  1259. dlg.m_bOfmat = 1; // 是否导入或导出同名的原始格式相片;
  1260. dlg.m_branch = branch; // 分店名称;
  1261. dlg.m_nphototype = 0; // 相片类型,==0表示原片;
  1262. dlg.m_calnopath = calnopath; // 未知;
  1263. dlg.m_mode = 2; // 未知;
  1264. dlg.m_bOrigin = 1; // 未知;
  1265. dlg.m_pArray = &array; // 要导入的相片路径集合;
  1266. dlg.m_savepath = savepath; // 保存相片的目录;
  1267. #ifdef ENTERPRISE_VERSION
  1268. // if(!g_branchname.IsEmpty())
  1269. {
  1270. dlg.m_id = strOrderNumber;
  1271. dlg.m_bSaveUploadTask = g_bSaveUploadTask1;
  1272. dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(78);
  1273. dlg.m_uploadtaskarray.Add(strOrderNumber + ";" + name);
  1274. dlg.m_uploadtaskarray.Add("");
  1275. dlg.m_uploadtaskarray.Add("");
  1276. dlg.m_uploadtaskarray.Add("");
  1277. dlg.m_uploadtaskarray.Add("");
  1278. dlg.m_uploadtaskarray.Add("1"); // 索引5表示相片类型;
  1279. dlg.m_uploadtaskarray.Add("");
  1280. dlg.m_uploadtaskarray.Add("");
  1281. dlg.m_uploadtaskarray.Add("");
  1282. dlg.m_uploadtaskarray.Add("");
  1283. }
  1284. #endif //#ifdef ENTERPRISE_VERSION
  1285. dlg.DoModal();
  1286. // Jeff.每次重新导入相片时,都删除ok文件;
  1287. beginno = dlg.beginno;
  1288. savepath += "ok";
  1289. ::DeleteFile(savepath); // 删除ok文件;
  1290. CString status;
  1291. TakeStautsSel dlg2;
  1292. if (status2 == "OK")
  1293. {
  1294. dlg2.m_check1 = 1;
  1295. dlg2.m_bCheckEnalbe = FALSE;
  1296. }
  1297. dlg2.DoModal();
  1298. if (dlg2.m_radio1 == 0)
  1299. {
  1300. status = "OK";
  1301. }
  1302. else if (dlg2.m_radio1 == 1)
  1303. {
  1304. status = "拍摄中";
  1305. //dlg2.CheckChange();
  1306. }
  1307. else
  1308. {
  1309. status = "未拍";
  1310. //dlg2.CheckChange();
  1311. }
  1312. #if 1
  1313. //本次选择ok时,需要再检查一下,看是否全部都已经ok;
  1314. // 此时iItem为有订单号的头景点;
  1315. // printf("Jeff:景点拍照完成,nTopItem=%d\n\n",nTopItem);
  1316. bOK = TRUE;
  1317. status2 = "OK";
  1318. int nItem = nTopItem;
  1319. if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK")
  1320. {
  1321. if (nItem != iItemBak)
  1322. {
  1323. status2 = "拍摄中";
  1324. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1325. bOK = FALSE;
  1326. }
  1327. else if (status != "OK")
  1328. {
  1329. status2 = "拍摄中";
  1330. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1331. bOK = FALSE;
  1332. }
  1333. }
  1334. // .子景点(如果有的话);
  1335. ++nItem;
  1336. while (nItem < itemcount && m_List1.GetItemText(nItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
  1337. {
  1338. if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK" && iItemBak != nItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
  1339. {
  1340. status2 = "拍摄中";
  1341. bOK = FALSE;
  1342. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1343. break;
  1344. }
  1345. else
  1346. {
  1347. if (status != "OK")
  1348. {
  1349. status2 = "拍摄中";
  1350. bOK = FALSE;
  1351. }
  1352. }
  1353. ++nItem;
  1354. }
  1355. if (bOK) status2 = "OK";
  1356. #endif //#if 1
  1357. #if 1
  1358. //if ( !bOK )
  1359. // status2 = "拍摄中";
  1360. //else if(dlg2.m_check1) // .拍照景点全部ok状态;
  1361. // status2 = "OK";
  1362. CString sql;
  1363. if (dlg2.m_check1)
  1364. {
  1365. status2 = "OK";
  1366. // Jeff:如果有多个景点,全部设置为拍照ok;
  1367. // 需要遍历处理?;
  1368. // 批量处理某个订单的就可以了;
  1369. // SQL:update dindanjd set [status]='OK' where id='';
  1370. // CString SQL;
  1371. sql.Format("update dindanjd set [status]='OK' where id='%s'", strOrderNumber);
  1372. // printf("Jeff:全部景点选择拍照OK,SQL=%s\n\n",sql);
  1373. }
  1374. #endif //#if 1
  1375. //CString sql;
  1376. //sql="update dindanjd set [status]='"+status+"',[date]='"+g_date+"',[waiter1]='"+waiter1+"',[waiter12]='"+waiter12+"',[waiter2]='"+waiter2+"',[waiter22]='"+waiter22+"' where [id]='"+id+"' and [name]='"+dindanjd+"'";
  1377. sql += "***update dindanjd set [status]='" + status + "',[date]='" + g_date + "',[waiter1]='" + waiter1 + "',[waiter12]='" + waiter12 + "',[waiter2]='" + waiter2 + "',[waiter22]='" + waiter22 + "' where [id]='" + strOrderNumber + "' and [name]='" + dindanjd + "'";
  1378. CString sbeginno;
  1379. sbeginno.Format("%d", beginno);
  1380. #ifdef LYFZ_VERSION
  1381. //sql+="***update dindan set [status]='"+status2+"' where [id]='"+id+"'";//旧文;
  1382. sql+="***update dindan set [status]=case when [status]<>'OK' then '"+status2+"' else [status] end"+" where [id]='"+id+"'";
  1383. #else
  1384. /* dindan time2为拍照时间,在第一次ok时,这个时间不能再修改;
  1385. // Jeff.SQL参考例子:
  1386. // update dindan set time2='2014-06-28' where id='20140628-007' and isnull(time2,'')=''
  1387. if(jdpos==0)
  1388. sql+="***update dindan set [status]='"+status2+"',[waiter1]='"+waiter1+"',[waiter2]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1389. else if(jdpos==1)
  1390. sql+="***update dindan set [status]='"+status2+"',[waiter12]='"+waiter1+"',[waiter22]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1391. else if(jdpos==2)
  1392. sql+="***update dindan set [status]='"+status2+"',[waiter13]='"+waiter1+"',[waiter23]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1393. else if(jdpos==3)
  1394. sql+="***update dindan set [status]='"+status2+"',[waiter14]='"+waiter1+"',[waiter24]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1395. else
  1396. sql+="***update dindan set [status]='"+status2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1397. */
  1398. //--------------------------------------------------------------------------
  1399. // Jeff.SQL参考语句示例:
  1400. // update dindan set time2=case when isnull(time2,'')='' then '2014-07-28' else time2 end , name2='OK',time3='2015-01-01',time1='2014-05-30' where id='20140628-007'
  1401. //---------------------------------------------------------------------
  1402. // printf("Jeff:拍照状态=%s\n\n",status2);
  1403. if (status2 != "OK") // !=ok,不记录拍照时间;--这样是否合理?
  1404. {
  1405. // 当数据库原本status不为OK时,可以修改时间和状态;否则状态和时间都不能修改,保持原样;
  1406. if (jdpos == 0)
  1407. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1408. else if (jdpos == 1)
  1409. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1410. else if (jdpos == 2)
  1411. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1412. else if (jdpos == 3)
  1413. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1414. else
  1415. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[curno]='" + sbeginno + "' where [id]='" + strOrderNumber + "'";
  1416. // printf("Jeff:拍照中,SQL=%s\n\n",sql);
  1417. }
  1418. else // ==ok时,才记录拍照时间;
  1419. {
  1420. /*if(jdpos==0)
  1421. sql+="***update dindan set [status]='"+status2+"',[waiter1]='"+waiter1+"',[waiter2]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
  1422. else if(jdpos==1)
  1423. sql+="***update dindan set [status]='"+status2+"',[waiter12]='"+waiter1+"',[waiter22]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" +" where [id]='"+id+"'";
  1424. else if(jdpos==2)
  1425. sql+="***update dindan set [status]='"+status2+"',[waiter13]='"+waiter1+"',[waiter23]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
  1426. else if(jdpos==3)
  1427. sql+="***update dindan set [status]='"+status2+"',[waiter14]='"+waiter1+"',[waiter24]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
  1428. else
  1429. sql+="***update dindan set [status]='"+status2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";*/
  1430. // 当数据库原本status为OK时,不可修改时间;否则可以修改时间;
  1431. if (jdpos == 0)
  1432. sql += "***update dindan set [status]='" + status2 + "',[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1433. else if (jdpos == 1)
  1434. sql += "***update dindan set [status]='" + status2 + "',[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1435. else if (jdpos == 2)
  1436. sql += "***update dindan set [status]='" + status2 + "',[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1437. else if (jdpos == 3)
  1438. sql += "***update dindan set [status]='" + status2 + "',[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1439. else
  1440. sql += "***update dindan set [status]='" + status2 + "',[curno]='" + sbeginno + "', [time2]=case when isnull([time2],'')='' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1441. // printf("Jeff:拍照OK,SQL=%s\n\n",sql);
  1442. }
  1443. #endif
  1444. /////////////////////////
  1445. CString m_name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
  1446. CString m_name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
  1447. CString m_phone1 = m_List1.GetItemText(iItem, 14 + m_nAdd);
  1448. CString m_phone2 = m_List1.GetItemText(iItem, 15 + m_nAdd);
  1449. if (g_bAllBranch)
  1450. {
  1451. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  1452. {
  1453. if (strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && branch == m_List1arrayBak.ElementAt(i).ElementAt(0))
  1454. {
  1455. m_phone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  1456. m_phone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  1457. }
  1458. }
  1459. }
  1460. else
  1461. {
  1462. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  1463. {
  1464. if (strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
  1465. {
  1466. m_phone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  1467. m_phone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  1468. }
  1469. }
  1470. }
  1471. CString sql2;
  1472. BOOL msgcheck = atoi(g_cominfoarray.ElementAt(0).ElementAt(101));
  1473. CString msgcontent = g_cominfoarray.ElementAt(0).ElementAt(105);
  1474. if (status != "OK")msgcheck = 0;
  1475. #ifdef CHILD_VERSION
  1476. if(msgcheck )
  1477. {
  1478. CString m_content3 = msgcontent;
  1479. CString str,timestamp;
  1480. timestamp="msgtimestamp";
  1481. {
  1482. CString name;
  1483. if(!m_name1.IsEmpty ())
  1484. name=m_name1+",";
  1485. name+=m_name2;
  1486. name.TrimRight (",");
  1487. if(name.IsEmpty ()==0 && CheckPhoneType(m_phone1)!=-1 && CheckBadWords(name,0) )
  1488. {
  1489. str=name+m_content3;
  1490. str.Replace ("xxx小朋友", "");
  1491. int count=GetLengthEx(str)/MSG_LENGTH;
  1492. if(GetLengthEx(str)%MSG_LENGTH)
  1493. count++;
  1494. CString scount;
  1495. scount.Format ("%d", count);
  1496. #if JEFF_TEST_ON
  1497. sql2.Format(INSERT_SENDREG, _T("11"), m_phone1, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  1498. sql += _T("***") + sql2;
  1499. #else
  1500. sql2="***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone1+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')";
  1501. sql+=sql2;
  1502. #endif //#if JEFF_TEST_ON
  1503. }
  1504. }
  1505. }
  1506. #else
  1507. if (msgcheck)
  1508. {
  1509. CString m_content3 = msgcontent;
  1510. CString str, timestamp;
  1511. timestamp = "msgtimestamp";
  1512. int pos = m_content3.Find("xxx先生/女士");
  1513. if (pos != -1)
  1514. {
  1515. if (m_name1.IsEmpty() == 0 && CheckPhoneType(m_phone1) != -1 && CheckBadWords(m_name1, 0) )
  1516. {
  1517. str = m_content3;
  1518. str.Replace("xxx先生/女士", m_name1 + "先生");
  1519. int count = GetLengthEx(str) / MSG_LENGTH;
  1520. if (GetLengthEx(str) % MSG_LENGTH)
  1521. count++;
  1522. CString scount;
  1523. scount.Format("%d", count);
  1524. #if JEFF_TEST_ON
  1525. sql2.Format(INSERT_SENDREG, _T("11"), m_phone1, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  1526. sql += _T("***") + sql2;
  1527. #else
  1528. sql2 = "***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('" + m_phone1 + "','" + str + "','" + timestamp + "','" + scount + "','0','0','0','系统自动发送')";
  1529. sql += sql2;
  1530. #endif //#if JEFF_TEST_ON
  1531. }
  1532. if (m_name2.IsEmpty() == 0 && CheckPhoneType(m_phone2) != -1 && CheckBadWords(m_name2, 0) )
  1533. {
  1534. str = m_content3;
  1535. str.Replace("xxx先生/女士", m_name2 + "女士");
  1536. int count = GetLengthEx(str) / MSG_LENGTH;
  1537. if (GetLengthEx(str) % MSG_LENGTH)
  1538. count++;
  1539. CString scount;
  1540. scount.Format("%d", count);
  1541. CTime tm = CTime::GetCurrentTime();
  1542. tm += CTimeSpan(0, 0, 0, 3);
  1543. timestamp = tm.Format("%Y%m%d%H%M%S");
  1544. timestamp = "msgtimexxstamp";
  1545. #if JEFF_TEST_ON
  1546. sql2.Format(INSERT_SENDREG, _T("11"), m_phone2, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  1547. sql += _T("***") + sql2;
  1548. #else
  1549. sql2 = "***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('" + m_phone2 + "','" + str + "','" + timestamp + "','" + scount + "','0','0','0','系统自动发送')";
  1550. sql += sql2;
  1551. #endif //#if JEFF_TEST_ON
  1552. }
  1553. }
  1554. }
  1555. #endif //#ifdef CHILD_VERSION
  1556. /////////////////////////
  1557. if (1)//拍照OK时记录客人预定内容
  1558. {
  1559. sql2 = "***gentakecontent:" + strOrderNumber;
  1560. sql += sql2;
  1561. }
  1562. g_sendhead.bsql = 1;
  1563. if (g_bAllBranch)
  1564. {
  1565. g_branchip = GetIP(branch);
  1566. g_pMainWnd->OnDisconnect();
  1567. g_branchname = branch;
  1568. g_bBranchModify = 1;
  1569. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1570. g_pMainWnd->OnDisconnect();
  1571. g_bBranchModify = 0;
  1572. g_branchip = g_branchname = "";
  1573. }
  1574. else
  1575. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1576. if (g_bSendOK == 0)
  1577. return;
  1578. AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
  1579. WriteLog(_T("拍照导入"), _T("拍照导入相片"));
  1580. if (g_bAllBranch == 0)
  1581. {
  1582. GetData();
  1583. }
  1584. else
  1585. {
  1586. BOOL bFind = 0;
  1587. for (int i = 0; i < m_List1array.GetSize(); i++)
  1588. {
  1589. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != "")break;
  1590. if (strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1591. {
  1592. bFind = 1;
  1593. }
  1594. if (bFind && dindanjd == m_List1array.ElementAt(i).ElementAt(4))
  1595. {
  1596. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, waiter1);
  1597. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, waiter12);
  1598. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, waiter2);
  1599. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, waiter22);
  1600. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, status);
  1601. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  1602. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
  1603. FillGrid();
  1604. break;
  1605. }
  1606. }
  1607. }
  1608. #endif
  1609. }
  1610. void TakeFrom::OnBUTshowphoto() // 查看原片
  1611. {
  1612. POSITION pos;
  1613. pos = m_List1.GetFirstSelectedItemPosition();
  1614. if (pos == NULL)
  1615. {
  1616. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1617. return;
  1618. }
  1619. int iItem = m_List1.GetNextSelectedItem(pos);
  1620. CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
  1621. CString branch;
  1622. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1623. if (g_bAllBranch)
  1624. branch = m_List1.GetItemText(iItem, 0);
  1625. while (id == "")
  1626. {
  1627. iItem--;
  1628. id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1629. }
  1630. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1631. name.TrimLeft(",");
  1632. name.TrimRight(",");
  1633. name = "客人:" + name;
  1634. ShowPic dlg;
  1635. dlg.m_id = id;
  1636. dlg.m_name = name;
  1637. dlg.m_mode = 1;
  1638. if(g_branchname == _T(""))
  1639. dlg.m_path = g_path1 + "\\";
  1640. else
  1641. {
  1642. dlg.m_branch = GetDomainFromBranch(g_branchname);
  1643. CString branchpath = GetBranchPhotoPath(g_branchname);
  1644. dlg.m_path = g_path1 + branchpath + "\\";
  1645. }
  1646. #ifndef USE_KERNEL_DLL
  1647. #if USE_SHARE_FLORD
  1648. // 根据域名,相片类型,订单号查找相片;
  1649. dlg.m_aryOfShareDirectory.RemoveAll();
  1650. CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
  1651. #endif
  1652. dlg.m_path += id;
  1653. dlg.m_path += "\\";
  1654. if (g_pMainWnd->IsCtrlDown() == 0 && g_pMainWnd->IsShiftDown() == 0 && dindanjd != "")
  1655. {
  1656. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1657. {
  1658. if (dindanjd == "系统默认景点")
  1659. {
  1660. if (::PathFileExists(dlg.m_path + dindanjd))
  1661. {
  1662. dlg.m_path += dindanjd;
  1663. dlg.m_path += "\\";
  1664. }
  1665. }
  1666. else
  1667. {
  1668. dlg.m_path += dindanjd;
  1669. dlg.m_path += "\\";
  1670. }
  1671. }
  1672. }
  1673. else if (g_pMainWnd->IsCtrlDown())
  1674. {
  1675. if (dindanjd == "系统默认景点")
  1676. {
  1677. if (::PathFileExists(dlg.m_path + dindanjd))
  1678. {
  1679. dlg.m_path += dindanjd;
  1680. dlg.m_path += "\\";
  1681. }
  1682. }
  1683. else
  1684. {
  1685. dlg.m_path += dindanjd;
  1686. dlg.m_path += "\\";
  1687. }
  1688. }
  1689. #endif
  1690. dlg.DoModal();
  1691. if (dlg.m_bdelall)
  1692. {
  1693. for (int i = 0; i < m_List1array.GetSize(); i++)
  1694. {
  1695. if (g_bAllBranch)
  1696. {
  1697. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1698. {
  1699. #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
  1700. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
  1701. #else
  1702. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
  1703. #endif
  1704. FillGrid();
  1705. break;
  1706. }
  1707. }
  1708. else
  1709. {
  1710. if (id == m_List1array.ElementAt(i).ElementAt(0))
  1711. {
  1712. #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
  1713. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
  1714. #else
  1715. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
  1716. #endif
  1717. FillGrid();
  1718. break;
  1719. }
  1720. }
  1721. }
  1722. }
  1723. }
  1724. void TakeFrom::OnBUTmoney() // 今拍 按钮;
  1725. {
  1726. // TODO: Add your control notification handler code here
  1727. UpdateData();
  1728. m_filter.TrimLeft();
  1729. m_filter.TrimRight();
  1730. FillGrid(2);
  1731. }
  1732. void TakeFrom::OnBTNaddsp()
  1733. {
  1734. }
  1735. void TakeFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  1736. {
  1737. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  1738. // TODO: Add your control notification handler code here
  1739. POSITION pos;
  1740. pos = m_List1.GetFirstSelectedItemPosition();
  1741. if (pos == NULL)
  1742. {
  1743. return;
  1744. }
  1745. int iItem = m_List1.GetNextSelectedItem(pos);
  1746. if (IsHasRights2new(4) || IsHasRights2new(49))
  1747. {
  1748. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1749. }
  1750. else
  1751. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1752. *pResult = 0;
  1753. }
  1754. void TakeFrom::OnButton1() // 查询按钮;
  1755. {
  1756. // TODO: Add your control notification handler code here
  1757. UpdateData();
  1758. m_filter.TrimLeft();
  1759. m_filter.TrimRight();
  1760. FillGrid();
  1761. }
  1762. void TakeFrom::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  1763. {
  1764. // TODO: Add your control notification handler code here
  1765. POSITION pos;
  1766. pos = m_List1.GetFirstSelectedItemPosition();
  1767. if (pos == NULL)return;
  1768. int iItem = m_List1.GetNextSelectedItem(pos);
  1769. g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1770. while (g_id == "")
  1771. {
  1772. iItem--;
  1773. g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1774. }
  1775. *pResult = 0;
  1776. }
  1777. void TakeFrom::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  1778. {
  1779. // TODO: Add your control notification handler code here
  1780. OnBUTshowphoto();
  1781. *pResult = 0;
  1782. }
  1783. void TakeFrom::HidePrice()
  1784. {
  1785. int i = 0;
  1786. m_List1arrayBak.RemoveAll();
  1787. m_List1arrayBak.SetSize(m_List1array.GetSize());
  1788. for ( i = 0; i < m_List1array.GetSize(); i++)
  1789. {
  1790. m_List1arrayBak.ElementAt(i).Copy(m_List1array.ElementAt(i));
  1791. }
  1792. #ifdef LKAY_VERSION
  1793. if(IsHasRights2new(31))return;
  1794. for( i=0; i<m_List1array.GetSize (); i++)
  1795. {
  1796. m_List1array.ElementAt (i).SetAt (11+m_nAdd, "***");
  1797. m_List1array.ElementAt (i).SetAt (12+m_nAdd, "***");
  1798. m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***");
  1799. m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***");
  1800. }
  1801. #else
  1802. if (IsHasRights2new(31))return;
  1803. for (i = 0; i < m_List1array.GetSize(); i++)
  1804. {
  1805. m_List1array.ElementAt(i).SetAt(14 + m_nAdd, "***");
  1806. m_List1array.ElementAt(i).SetAt(15 + m_nAdd, "***");
  1807. }
  1808. #endif
  1809. }
  1810. void TakeFrom::OnBtnsearchfilter() // 条件查询按钮;
  1811. {
  1812. SearchFilter dlg;
  1813. dlg.m_mode = 1;
  1814. if (dlg.DoModal() == IDOK)
  1815. FillGrid();
  1816. g_bSearchFilter = 0;
  1817. }
  1818. void TakeFrom::OnBUTprint3()
  1819. {
  1820. GetData();
  1821. }
  1822. void TakeFrom::OnButton2() // 客人头像按钮;
  1823. {
  1824. POSITION pos;
  1825. pos = m_List1.GetFirstSelectedItemPosition();
  1826. if (pos == NULL)
  1827. {
  1828. AfxMessageBox("请先选中您要拍头像的客人!", MB_ICONINFORMATION);
  1829. return;
  1830. }
  1831. int iItem = m_List1.GetNextSelectedItem(pos);
  1832. CString branch;
  1833. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1834. if (g_bAllBranch)
  1835. branch = m_List1.GetItemText(iItem, 0);
  1836. while (id == "")
  1837. {
  1838. iItem--;
  1839. id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1840. }
  1841. UploadPhoto dlg;
  1842. if (g_bAllBranch)
  1843. {
  1844. CString branchpath = GetBranchPhotoPath(branch);
  1845. dlg.m_path = g_path1 + branchpath + "\\";
  1846. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1847. ::CreateDirectory(dlg.m_path, NULL);
  1848. }
  1849. else
  1850. dlg.m_path = g_path1 + "\\";
  1851. dlg.m_path += "客人头像\\";
  1852. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1853. ::CreateDirectory(dlg.m_path, NULL);
  1854. dlg.m_path += id + "\\";
  1855. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1856. ::CreateDirectory(dlg.m_path, NULL);
  1857. dlg.DoModal();
  1858. }
  1859. void TakeFrom::GetData()
  1860. {
  1861. if (g_bAllBranch == 0)
  1862. {
  1863. if (g_bShowOK == 0)
  1864. {
  1865. #ifdef LKAY_VERSION
  1866. CString filter="status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  1867. #else
  1868. CString filter = "status3='未取'";
  1869. #endif
  1870. g_sendhead.bsql = 0;
  1871. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1872. g_sendhead.tabcount = 1;
  1873. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1874. if (g_bSendOK == 0)return;
  1875. }
  1876. else
  1877. {
  1878. g_sendhead.bsql = 0;
  1879. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1880. g_sendhead.tabcount = 1;
  1881. #ifdef LKAY_VERSION
  1882. CString filter="dindantype<>'意向客户' or dindantype is null";
  1883. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1884. #else
  1885. g_pMainWnd->ProcessChatMessageRequest2(1);
  1886. #endif
  1887. if (g_bSendOK == 0)return;
  1888. }
  1889. DataToArray(&m_List1array);
  1890. }
  1891. else
  1892. {
  1893. //////////////数据汇总
  1894. m_List1array.RemoveAll();
  1895. CString branch;
  1896. for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
  1897. {
  1898. if (i != -1)
  1899. {
  1900. branch = g_brancharray.ElementAt(i).ElementAt(0);
  1901. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  1902. g_pMainWnd->OnDisconnect();
  1903. g_branchname = branch;
  1904. g_bBranchModify = 1;
  1905. }
  1906. else
  1907. branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
  1908. if (g_bShowOK == 0)
  1909. {
  1910. CString filter = "status3='未取'";
  1911. g_sendhead.bsql = 0;
  1912. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1913. g_sendhead.tabcount = 1;
  1914. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1915. if (g_bSendOK == 0) continue;
  1916. }
  1917. else
  1918. {
  1919. g_sendhead.bsql = 0;
  1920. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1921. g_sendhead.tabcount = 1;
  1922. g_pMainWnd->ProcessChatMessageRequest2(1);
  1923. if (g_bSendOK == 0) continue;
  1924. }
  1925. CArray<CStringArray, CStringArray>List1array;
  1926. DataToArray(&List1array);
  1927. int size = m_List1array.GetSize();
  1928. for (int j = 0; j < List1array.GetSize(); j++)
  1929. {
  1930. size++;
  1931. m_List1array.SetSize(size, 1);
  1932. size--;
  1933. m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
  1934. m_List1array.ElementAt(size).InsertAt(0, branch);
  1935. size++;
  1936. }
  1937. }
  1938. g_pMainWnd->OnDisconnect();
  1939. g_bBranchModify = 0;
  1940. g_branchip = g_branchname = "";
  1941. }
  1942. HidePrice();
  1943. FillGrid();
  1944. }
  1945. void TakeFrom::OnBnClickedMicroshare() // 微分享;
  1946. {
  1947. // 定义变量;
  1948. CString strOrderNumber = _T(""); // 订单号;
  1949. CString strScenery = _T(""); // 景点名;
  1950. CString strCustomer = _T(""); // 顾客名;
  1951. CString strMakeupArtist = _T(""); // 化妆师;
  1952. CString strSourcePath = _T(""); // 相片根目录;
  1953. CString strBranchName = _T(""); // 分店名;
  1954. CString strBranchDomain = _T(""); // 分店域名;
  1955. TCHAR szShareId[MAX_PATH] = _T(""); // 微分享相册ID;
  1956. // 获取变量值;
  1957. POSITION pos;
  1958. pos = m_List1.GetFirstSelectedItemPosition();
  1959. if (pos == NULL)
  1960. {
  1961. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1962. return;
  1963. }
  1964. int iItem = m_List1.GetNextSelectedItem(pos);
  1965. strScenery = m_List1.GetItemText(iItem, 4 + m_nAdd);
  1966. strMakeupArtist = m_List1.GetItemText(iItem, 9 + m_nAdd);
  1967. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1968. if (g_bAllBranch)
  1969. strBranchName = m_List1.GetItemText(iItem, 0);
  1970. while (strOrderNumber == "")
  1971. {
  1972. iItem--;
  1973. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1974. }
  1975. #if 0
  1976. if (g_bAllBranch)
  1977. {
  1978. strBranchDomain = GetBranchPhotoPath(strBranchName);
  1979. strSourcePath = g_path1 + strBranchDomain + "\\";
  1980. }
  1981. else
  1982. {
  1983. strSourcePath = g_path1 + "\\";
  1984. }
  1985. strSourcePath += strOrderNumber;
  1986. strSourcePath += "\\";
  1987. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1988. {
  1989. if (::PathFileExists(strSourcePath + strScenery))
  1990. {
  1991. strSourcePath += strScenery;
  1992. strSourcePath += "\\";
  1993. }
  1994. }
  1995. #else
  1996. CString str;
  1997. CStringArray AryOrderPath;
  1998. int nSize = g_aryOfSharePathInfo.GetSize();
  1999. for ( int i = 0; i < nSize; i++ )
  2000. {
  2001. if ( 1 == atoi(g_aryOfSharePathInfo.ElementAt(i).ElementAt(5)) )
  2002. {
  2003. str = g_aryOfSharePathInfo.ElementAt(i).ElementAt(2);
  2004. if ( g_bAllBranch )
  2005. {
  2006. strBranchDomain = GetBranchPhotoPath(strBranchName);
  2007. str += strBranchDomain;
  2008. }
  2009. str += _T("\\");
  2010. str += strOrderNumber;
  2011. str += _T("\\");
  2012. if ( PathFileExists(str) )
  2013. {
  2014. AryOrderPath.Add(str);
  2015. }
  2016. }
  2017. }
  2018. str = g_path1;
  2019. if ( g_bAllBranch )
  2020. {
  2021. strBranchDomain = GetBranchPhotoPath(strBranchName);
  2022. str += strBranchDomain + "\\";
  2023. }
  2024. str += _T("\\");
  2025. str += strOrderNumber;
  2026. str += _T("\\");
  2027. if ( PathFileExists(str) )
  2028. {
  2029. AryOrderPath.Add(str);
  2030. }
  2031. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  2032. {
  2033. int n = AryOrderPath.GetSize();
  2034. for ( int j = 0; j < n; j++ )
  2035. {
  2036. if ( PathFileExists(AryOrderPath.ElementAt(j) + strScenery) )
  2037. {
  2038. strSourcePath = AryOrderPath.ElementAt(j) + strScenery;
  2039. strSourcePath += _T("\\");
  2040. strSourcePath += _T("#");
  2041. }
  2042. }
  2043. }
  2044. else
  2045. {
  2046. for ( int k = 0; k < AryOrderPath.GetSize(); k++ )
  2047. {
  2048. strSourcePath = AryOrderPath.ElementAt(k) ;
  2049. strSourcePath += _T("#");
  2050. }
  2051. }
  2052. #endif
  2053. // 加载动态库;
  2054. if (LoadMicroShareLibrary() == FALSE)
  2055. return;
  2056. if ( g_lyfzCreateShare )
  2057. {
  2058. g_lyfzCreateShare(
  2059. g_cominfoarray.ElementAt(0).ElementAt(147), // 微分享的登录账号;
  2060. g_cominfoarray.ElementAt(0).ElementAt(148), // 微分享的登录账号密码;
  2061. strSourcePath, // 相片根级目录;
  2062. strBranchDomain.Mid(1), // 分店域名;
  2063. strOrderNumber, // 订单号,用于生成二维码文件名;
  2064. strScenery, // 景点名;
  2065. strSourcePath,
  2066. m_List1.GetItemText(iItem, 1 + m_nAdd), // 客人姓名1 ;
  2067. m_List1.GetItemText(iItem, 2 + m_nAdd), // 客人姓名2
  2068. strMakeupArtist, // 化妆师;
  2069. szShareId // 返回微相册ID;
  2070. );
  2071. }
  2072. FreeMicroShareLibrary();
  2073. }
  2074. /************************************************************************/
  2075. /*
  2076. 函数:GetSelectedOrderInfo
  2077. 描述:获取选中的列表项的订单信息;
  2078. 参数:
  2079. [OUT] tagOrderInfo
  2080. [OUT] nFirstItem 第一个景点项索引;
  2081. [OUT] nEndofItem 最后一个景点项索引;
  2082. 返回:空
  2083. 注意:
  2084. 要求:
  2085. 示例:
  2086. 修改:
  2087. 日期:
  2088. 内容:
  2089. */
  2090. /************************************************************************/
  2091. INT TakeFrom::GetSelectedOrderInfo( OUT STOrederInfo &tagOrderInfo, OUT INT& nFirstItem, OUT INT& nEndofItem )
  2092. {
  2093. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  2094. if ( pos == NULL )
  2095. {
  2096. AfxMessageBox(_T("未选中要导入相片的订单!"),MB_ICONINFORMATION);
  2097. return -1;
  2098. }
  2099. INT nItemCount = m_List1.GetItemCount();
  2100. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  2101. //INT nFirstItem = 0; // 记录第一个景点项索引;
  2102. //INT nEndofItem = 0; // 记录最后一个景点项索引;
  2103. INT nSceneryItem = nSelectedItem;
  2104. if ( m_List1.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") )
  2105. {
  2106. STSceneryInfo tagSceneryInfo;
  2107. tagSceneryInfo.bSelected = TRUE;
  2108. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2109. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2110. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2111. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2112. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2113. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2114. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2115. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2116. // 查找所有下行;
  2117. nSceneryItem++;
  2118. if ( nSceneryItem < nItemCount )
  2119. {
  2120. while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
  2121. {
  2122. tagSceneryInfo.bSelected = FALSE;
  2123. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2124. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2125. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2126. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2127. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2128. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2129. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2130. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2131. nSceneryItem++;
  2132. if ( nSceneryItem >= nItemCount )
  2133. break;
  2134. }
  2135. // 记录最后一个景点项索引;
  2136. nEndofItem = nSceneryItem - 1;
  2137. }
  2138. // 查找所有上行;
  2139. nSceneryItem = nSelectedItem - 1;
  2140. if ( nSceneryItem >= 0)
  2141. {
  2142. while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
  2143. {
  2144. tagSceneryInfo.bSelected = FALSE;
  2145. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2146. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2147. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2148. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2149. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2150. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2151. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2152. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2153. nSceneryItem--;
  2154. if ( nSceneryItem < 0 )
  2155. break;
  2156. }
  2157. }
  2158. // 上行结束后,是头位置;
  2159. if ( nSceneryItem >= 0 )
  2160. {
  2161. // 记录第一个景点项索引;
  2162. nFirstItem = nSceneryItem;
  2163. // 用头景点行初始化订单信息;
  2164. if ( g_bAllBranch ) // 是否多店汇总;
  2165. {
  2166. tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
  2167. }
  2168. else
  2169. {
  2170. if ( g_branchname == _T(""))
  2171. tagOrderInfo.strBranchId = g_domain;
  2172. else
  2173. tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
  2174. }
  2175. tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSceneryItem, 0 + m_nAdd);
  2176. tagOrderInfo.strName1 = m_List1.GetItemText(nSceneryItem, 1 + m_nAdd);
  2177. tagOrderInfo.strName2 = m_List1.GetItemText(nSceneryItem, 2 + m_nAdd);
  2178. tagOrderInfo.strImageNumber = m_List1.GetItemText(nSceneryItem, 3 + m_nAdd);
  2179. tagOrderInfo.strClerk = m_List1.GetItemText(nSceneryItem, 11 + m_nAdd);
  2180. // 如果用户权限不足,13和14显示的是"*"符号;
  2181. #if 1
  2182. tagOrderInfo.strPhone = m_List1.GetItemText(nSceneryItem, 14 + m_nAdd);
  2183. tagOrderInfo.strTelPhone = m_List1.GetItemText(nSceneryItem, 15 + m_nAdd);
  2184. #else
  2185. if ( g_bAllBranch )
  2186. {
  2187. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  2188. {
  2189. if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1arrayBak.ElementAt(i).ElementAt(0) )
  2190. {
  2191. tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  2192. tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  2193. break;
  2194. }
  2195. }
  2196. }
  2197. else
  2198. {
  2199. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  2200. {
  2201. if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0) )
  2202. {
  2203. tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  2204. tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  2205. break;
  2206. }
  2207. }
  2208. }
  2209. #endif
  2210. // 同时push头景点;
  2211. tagSceneryInfo.bSelected = FALSE;
  2212. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2213. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2214. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2215. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2216. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2217. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2218. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2219. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2220. }
  2221. }
  2222. else
  2223. {
  2224. // 记录第一个景点项索引;
  2225. nFirstItem = nSceneryItem;
  2226. // 用头景点行初始化订单信息;
  2227. if ( g_bAllBranch ) // 是否多店汇总;
  2228. {
  2229. tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
  2230. }
  2231. else
  2232. {
  2233. if ( g_branchname == _T(""))
  2234. tagOrderInfo.strBranchId = g_domain;
  2235. else
  2236. tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
  2237. }
  2238. tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  2239. tagOrderInfo.strName1 = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd);
  2240. tagOrderInfo.strName2 = m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  2241. tagOrderInfo.strImageNumber = m_List1.GetItemText(nSelectedItem, 3 + m_nAdd);
  2242. tagOrderInfo.strClerk = m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
  2243. tagOrderInfo.strPhone = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  2244. tagOrderInfo.strTelPhone = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
  2245. // push头景点;
  2246. STSceneryInfo tagSceneryInfo;
  2247. tagSceneryInfo.bSelected = TRUE;
  2248. tagSceneryInfo.strScenery = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd);
  2249. tagSceneryInfo.strStatus = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  2250. tagSceneryInfo.strTime = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  2251. tagSceneryInfo.strLensman = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
  2252. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
  2253. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd);
  2254. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSelectedItem, 10 + m_nAdd);
  2255. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2256. // 读取下一行,看是否属于本订单的景点;
  2257. nSceneryItem++;
  2258. if ( nSceneryItem < nItemCount )
  2259. {
  2260. while( m_List1.GetItemText( nSceneryItem, 0 + m_nAdd ) == _T("") )
  2261. {
  2262. tagSceneryInfo.bSelected = FALSE;
  2263. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2264. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2265. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2266. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2267. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2268. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2269. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2270. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2271. nSceneryItem++;
  2272. if ( nSceneryItem >= nItemCount )
  2273. break;
  2274. }
  2275. // 记录最后一个景点项索引;
  2276. nEndofItem = nSceneryItem - 1;
  2277. }
  2278. }
  2279. return nSelectedItem;
  2280. }