DesignFrom.cpp 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704
  1. // DesignFrom.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "DesignFrom.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "ImportPhoto.h"
  9. #include "ClientRequirement.h"
  10. #include "ChooseDesignSkin.h"
  11. #include "./helper/ffsco.h"
  12. #include "SelectPhotoDlg.h"
  13. #include "ShowPic.h"
  14. #include "Login2.h"
  15. #include "ShowCut.h"
  16. #include "CompressOption.h"
  17. #include "DlgChuXiuInfo.h"
  18. #include "N8Process.h"
  19. #include "DlgN8ViewReuslt.h"
  20. #include "DlgCloudSelection.h"
  21. #include "DlgCloundResult.h"
  22. #ifdef _DEBUG
  23. #define new DEBUG_NEW
  24. #undef THIS_FILE
  25. static char THIS_FILE[] = __FILE__;
  26. #endif
  27. #pragma comment(lib, "Shlwapi.lib")
  28. IMPLEMENT_DYNCREATE(DesignFrom, MyFormView)
  29. DesignFrom::DesignFrom() : MyFormView(DesignFrom::IDD)
  30. {
  31. m_filter = _T("");
  32. m_nAdd = 0;
  33. if (g_bAllBranch)
  34. {
  35. m_nAdd = 1;
  36. }
  37. }
  38. DesignFrom::~DesignFrom()
  39. {
  40. }
  41. void DesignFrom::DoDataExchange(CDataExchange* pDX)
  42. {
  43. MyFormView::DoDataExchange(pDX);
  44. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  45. DDX_Control(pDX, IDC_LIST2, m_List1);
  46. DDX_Control(pDX, IDC_STATIC1, m_static1);
  47. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  48. }
  49. BEGIN_MESSAGE_MAP(DesignFrom, MyFormView)
  50. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  51. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  52. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  53. ON_WM_TIMER()
  54. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  55. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  56. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  57. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  58. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  59. ON_BN_CLICKED(IDC_BUTimportphoto2, OnBUTimportphoto2)
  60. ON_BN_CLICKED(IDC_BUTimportphoto3, OnBUTimportphoto3)
  61. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  62. ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
  63. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  64. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  65. ON_BN_CLICKED(BTN_CloundXY, OnBnClickedCloundxy)
  66. ON_BN_CLICKED(BTN_RESULT, OnBnClickedResult)
  67. END_MESSAGE_MAP()
  68. #ifdef _DEBUG
  69. void DesignFrom::AssertValid() const
  70. {
  71. MyFormView::AssertValid();
  72. }
  73. void DesignFrom::Dump(CDumpContext& dc) const
  74. {
  75. MyFormView::Dump(dc);
  76. }
  77. #endif //_DEBUG
  78. /////////////////////////////////////////////////////////////////////////////
  79. void DesignFrom::OnInitialUpdate()
  80. {
  81. MyFormView::OnInitialUpdate();
  82. CMyMdi Mdi;
  83. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  84. GetDlgItem(IDC_BUTimportphoto3)->EnableWindow(IsHasRights2new(12));
  85. GetDlgItem(IDC_BUTTON3)->EnableWindow(IsHasRights2new(12));
  86. GetDlgItem(IDC_BUTshowphoto)->EnableWindow(IsHasRights2new(15));
  87. CRect rc2;
  88. GetWindowRect(rc2);
  89. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  90. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  91. if (g_bAllBranch == 0)
  92. {
  93. int idarray[] = { IDC_BUTexportphoto, IDC_BUTimportphoto, IDC_BUTimportphoto2, IDC_BUTimportphoto3, IDC_BUTshowphoto, IDC_BUTTON3, IDC_BUTclose };
  94. int idcount = 7;
  95. int btnwid;
  96. CRect prerc;
  97. for (int a = idcount - 2; a >= 0; a--)
  98. {
  99. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  100. ScreenToClient(prerc);
  101. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  102. ScreenToClient(rc2);
  103. btnwid = rc2.Width();
  104. rc2.right = prerc.left;
  105. rc2.left = rc2.right - btnwid;
  106. GetDlgItem(idarray[a])->MoveWindow(rc2);
  107. }
  108. }
  109. else
  110. {
  111. GetDlgItem(IDC_BUTshowphoto)->ShowWindow(SW_HIDE);
  112. GetDlgItem(IDC_BUTprint3)->ShowWindow(SW_SHOWNORMAL);
  113. int idarray[] = { IDC_BUTprint3, IDC_BUTexportphoto, IDC_BUTimportphoto, IDC_BUTimportphoto2, IDC_BUTimportphoto3, IDC_BUTTON3, IDC_BUTclose };
  114. int idcount = 7;
  115. int btnwid;
  116. CRect prerc;
  117. for (int a = idcount - 2; a >= 0; a--)
  118. {
  119. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  120. ScreenToClient(prerc);
  121. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  122. ScreenToClient(rc2);
  123. btnwid = rc2.Width();
  124. rc2.right = prerc.left;
  125. rc2.left = rc2.right - btnwid;
  126. GetDlgItem(idarray[a])->MoveWindow(rc2);
  127. }
  128. }
  129. m_static1.SetFont(&g_titlefont);
  130. // Jeff.在精修状态后添加精修日期;
  131. if (g_bAllBranch == 0)
  132. {
  133. #ifdef CHILD_VERSION
  134. // 19 列;
  135. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;精修,100;精修日期,100;设计,100;设计日期,100;看设计,100;看设计日期,100;加急,100;取件日期,100;看设计要求,100;接单人,100;看设计人,100;设计师,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
  136. #else
  137. // 19 列;
  138. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;精修,100;精修日期,100;设计,100;设计日期,100;看设计,100;看设计日期,100;加急,100;取件日期,100;看设计要求,100;接单人,100;看设计人,100;设计师,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  139. #endif
  140. m_List1.LoadColumnInfo(119);
  141. }
  142. else
  143. {
  144. #ifdef CHILD_VERSION
  145. // 20 列;
  146. m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;精修,100;精修日期,100;设计,100;设计日期,100;看设计,100;看设计日期,100;加急,100;取件日期,100;看设计要求,100;接单人,100;看设计人,100;设计师,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
  147. #else
  148. m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;精修,100;精修日期,100;设计,100;设计日期,100;看设计,100;看设计日期,100;加急,100;取件日期,100;看设计要求,100;接单人,100;看设计人,100;设计师,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  149. #endif
  150. m_List1.LoadColumnInfo(199);
  151. }
  152. GetData();
  153. m_combo1.AddString(g_user.name);
  154. m_combo1.GetWindowRect(rc2);
  155. ScreenToClient(rc2);
  156. rc2.bottom += 200;
  157. m_combo1.MoveWindow(rc2);
  158. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  159. SetComboHei(&m_combo1, rc2.Height());
  160. GetDlgItem(IDC_BUTexportphoto)->EnableWindow(IsHasRights2new(11));
  161. m_bN8 = AfxGetApp()->GetProfileInt(LYFZVERSION, "N8SampleChoose", 0);
  162. if ( m_bN8 )
  163. {
  164. SetDlgItemText(IDC_STATIC1,_T("N8选版"));
  165. SetDlgItemText(IDC_BUTimportphoto, _T("导入N8选版"));
  166. SetDlgItemText(IDC_BUTTON3, _T("导出N8选版"));
  167. SetDlgItemText(IDC_BUTshowphoto, _T("N8选版"));
  168. GetDlgItem(IDC_BUTimportphoto2)->ShowWindow(SW_HIDE);
  169. GetDlgItem(IDC_BUTimportphoto3)->ShowWindow(SW_HIDE);
  170. // 移动按钮位置;
  171. CRect rc;
  172. GetDlgItem(IDC_BUTimportphoto)->GetWindowRect(rc);
  173. ScreenToClient(rc);
  174. printf("top:%d, left:%d, right:%d, bottom:%d, width=%d\n", rc.top, rc.left, rc.right, rc.bottom, rc.Width());
  175. rc.OffsetRect(rc.Width() + 1, 0);
  176. GetDlgItem(IDC_BUTshowphoto)->MoveWindow(rc);
  177. rc.OffsetRect(rc.Width() + 1, 0);
  178. GetDlgItem(IDC_BUTTON3)->MoveWindow(rc);
  179. }
  180. if ( !g_bEnableClound )
  181. {
  182. GetDlgItem(BTN_CloundXY)->ShowWindow(SW_HIDE);
  183. GetDlgItem(BTN_RESULT)->ShowWindow(SW_HIDE);
  184. }
  185. }
  186. void DesignFrom::FillGrid(BOOL bStatus)
  187. {
  188. if (g_bSearchFilter) // 开启条件查询;
  189. {
  190. m_List1.DeleteAllItems2();
  191. int ii = 0;
  192. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  193. int count = 0;
  194. {
  195. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  196. {
  197. if (g_filterdate1 != "")
  198. {
  199. // 查询条件==设计日期; 原本在列5
  200. if (m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) > g_filterdate2)
  201. continue;
  202. }
  203. if (g_waiter1 != "")
  204. {
  205. // 查询条件==设计师; 原本在列13
  206. if (m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd) != g_waiter1)
  207. continue;
  208. }
  209. if (g_bAllBranch && g_filterbranch != "")
  210. {
  211. if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
  212. continue;
  213. }
  214. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  215. }
  216. }
  217. m_List1.m_arLabels.SetSize(count, 1);
  218. ii = count;
  219. m_List1.m_LabelCount = ii;
  220. m_List1.SetItemCountEx(ii);
  221. CString str;
  222. str.Format("单数:%d", ii);
  223. SetDlgItemText(IDC_STATIC2, str);
  224. }
  225. else // 未开启条件查询;
  226. {
  227. m_List1.DeleteAllItems2();
  228. int ii = 0;
  229. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  230. int count = 0;
  231. if (m_filter.IsEmpty())
  232. {
  233. if (bStatus)
  234. {
  235. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  236. {
  237. // 查询条件==精修状态&&设计状态(原本列4);
  238. if (m_List1array.ElementAt(ii).ElementAt(3 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK")
  239. {
  240. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  241. }
  242. }
  243. }
  244. else
  245. {
  246. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  247. {
  248. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  249. }
  250. }
  251. }
  252. else
  253. {
  254. if (bStatus)
  255. {
  256. int type = GetType(m_filter);
  257. if (type == 1)//电话
  258. {
  259. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  260. {
  261. // 查询条件==精修状态&&设计状态 &&(手机(原列16)||座机(原列17))
  262. if (m_List1array.ElementAt(ii).ElementAt(3 + m_nAdd) == "OK" &&
  263. m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK" &&
  264. (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 || m_List1array.ElementAt(ii).ElementAt(18 + m_nAdd).Find(m_filter) != -1))
  265. {
  266. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  267. }
  268. }
  269. }
  270. else if (type == 2)//拼音
  271. {
  272. m_filter.MakeUpper();
  273. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  274. {
  275. // 查询条件==精修状态&&设计状态 &&(拼音1(原列18)||拼音2(原列19))
  276. if (m_List1array.ElementAt(ii).ElementAt(3 + m_nAdd) == "OK"
  277. &&m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"
  278. && (m_List1array.ElementAt(ii).ElementAt(19 + m_nAdd).Find(m_filter) != -1 || m_List1array.ElementAt(ii).ElementAt(20 + m_nAdd).Find(m_filter) != -1))
  279. {
  280. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  281. }
  282. }
  283. }
  284. else
  285. {
  286. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  287. {
  288. // 查询条件==精修状态&&设计状态 &&(……)
  289. if (m_List1array.ElementAt(ii).ElementAt(3 + m_nAdd) == "OK" &&
  290. m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK" &&
  291. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  292. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  293. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  294. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  295. m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 || \
  296. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 || \
  297. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  298. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  299. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  300. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  301. m_List1array.ElementAt(ii).ElementAt(18).Find(m_filter) != -1 || \
  302. m_List1array.ElementAt(ii).ElementAt(19).Find(m_filter) != -1))
  303. {
  304. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  305. }
  306. }
  307. }
  308. }
  309. else
  310. {
  311. int type = GetType(m_filter);
  312. if (type == 1)//电话
  313. {
  314. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  315. {
  316. // 查询条件==手机(原列16)||座机(原列17)
  317. if (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 ||
  318. m_List1array.ElementAt(ii).ElementAt(18 + m_nAdd).Find(m_filter) != -1)
  319. {
  320. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  321. }
  322. }
  323. }
  324. else if (type == 2)//拼音
  325. {
  326. m_filter.MakeUpper();
  327. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  328. {
  329. // 查询条件==精拼音1(原列18)||拼音2(原列19)
  330. if (m_List1array.ElementAt(ii).ElementAt(19 + m_nAdd).Find(m_filter) != -1 ||
  331. m_List1array.ElementAt(ii).ElementAt(20 + m_nAdd).Find(m_filter) != -1)
  332. {
  333. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  334. }
  335. }
  336. }
  337. else
  338. {
  339. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  340. {
  341. if (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(12).Find(m_filter) != -1 ||
  346. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 ||
  347. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 ||
  348. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 ||
  349. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 ||
  350. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 ||
  351. m_List1array.ElementAt(ii).ElementAt(18).Find(m_filter) != -1 ||
  352. m_List1array.ElementAt(ii).ElementAt(19).Find(m_filter) != -1)
  353. {
  354. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  355. }
  356. }
  357. }
  358. }
  359. }
  360. m_List1.m_arLabels.SetSize(count, 1);
  361. ii = count;
  362. m_List1.m_LabelCount = ii;
  363. m_List1.SetItemCountEx(ii);
  364. CString str;
  365. str.Format("单数:%d", ii);
  366. SetDlgItemText(IDC_STATIC2, str);
  367. }
  368. if (!g_id.IsEmpty())
  369. {
  370. for (int i = 0; i < m_List1.GetItemCount(); i++)
  371. {
  372. if (g_id == m_List1.GetItemText(i, 0 + m_nAdd))
  373. {
  374. m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  375. m_List1.EnsureVisible(i, FALSE);
  376. break;
  377. }
  378. }
  379. }
  380. }
  381. void DesignFrom::OnBUTclose()
  382. {
  383. GetParent()->SendMessage(WM_CLOSE);
  384. }
  385. void DesignFrom::OnSelchangeCombo1()
  386. {
  387. SetTimer(1, 100, NULL);
  388. }
  389. void DesignFrom::OnTimer(UINT nIDEvent)
  390. {
  391. KillTimer(nIDEvent);
  392. OnButton1();
  393. }
  394. BOOL DesignFrom::PreTranslateMessage(MSG* pMsg)
  395. {
  396. try
  397. {
  398. if (pMsg->message == WM_KEYDOWN)
  399. {
  400. switch (pMsg->wParam)
  401. {
  402. case VK_RETURN:
  403. OnButton1();
  404. return 1;
  405. case 0x43: // copy
  406. if ((GetKeyState(VK_CONTROL) & 0x80))
  407. {
  408. GetFocus()->SendMessage(WM_COPY);
  409. return TRUE;
  410. }
  411. break;
  412. case 0x56: //Ctrl + V:
  413. if ((GetKeyState(VK_CONTROL) & 0x80))
  414. {
  415. GetFocus()->SendMessage(WM_PASTE);
  416. return TRUE;
  417. }
  418. break;
  419. case 0x58: // cut
  420. if ((GetKeyState(VK_CONTROL) & 0x80))
  421. {
  422. GetFocus()->SendMessage(WM_CUT);
  423. return TRUE;
  424. }
  425. break;
  426. case 0x5A: //undo
  427. case 0x59: //redo
  428. if ((GetKeyState(VK_CONTROL) & 0x80))
  429. {
  430. GetFocus()->SendMessage(WM_UNDO);
  431. return TRUE;
  432. }
  433. break;
  434. }
  435. }
  436. else if (pMsg->message == WM_LBUTTONDBLCLK)
  437. {
  438. CPoint pt;
  439. CRect rc, rc2;
  440. ::GetCursorPos(&pt);
  441. m_List1.GetWindowRect(rc2);
  442. if (rc2.PtInRect(pt) == 0)
  443. return MyFormView::PreTranslateMessage(pMsg);
  444. pt.x -= rc2.left;
  445. pt.y -= rc2.top;
  446. POSITION pos;
  447. pos = m_List1.GetFirstSelectedItemPosition();
  448. if (pos == NULL)return MyFormView::PreTranslateMessage(pMsg);
  449. int iItem = m_List1.GetNextSelectedItem(pos);
  450. m_List1.GetSubItemRect(iItem, 11 + m_nAdd, LVIR_BOUNDS, rc);
  451. if (rc.PtInRect(pt))
  452. {
  453. CClientRequirement dlg;
  454. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  455. CString str;
  456. if (g_bAllBranch == 0)
  457. {
  458. for (int i = 0; i < m_List1arraybak.GetSize(); i++)
  459. {
  460. if (m_List1arraybak.ElementAt(i).ElementAt(0 + m_nAdd) == id)
  461. {
  462. str = m_List1arraybak.ElementAt(i).ElementAt(11 + m_nAdd);
  463. break;
  464. }
  465. }
  466. }
  467. else
  468. {
  469. CString branch = m_List1.GetItemText(iItem, 0);
  470. for (int i = 0; i < m_List1arraybak.GetSize(); i++)
  471. {
  472. if (m_List1arraybak.ElementAt(i).ElementAt(0 + m_nAdd) == id && branch == m_List1array.ElementAt(i).ElementAt(0))
  473. {
  474. str = m_List1arraybak.ElementAt(i).ElementAt(11 + m_nAdd);
  475. break;
  476. }
  477. }
  478. }
  479. dlg.m_bz2 = str;
  480. dlg.m_bSave = 0;
  481. dlg.DoModal();
  482. }
  483. }
  484. }
  485. catch (...)
  486. {
  487. }
  488. return MyFormView::PreTranslateMessage(pMsg);
  489. }
  490. extern int CALLBACK BrowseProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData);
  491. /*{
  492. switch(msg)
  493. {
  494. case BFFM_INITIALIZED:
  495. SendMessage(hwnd, BFFM_SETSELECTION, TRUE, NULL);
  496. break;
  497. case BFFM_SELCHANGED:
  498. {
  499. char szFileName[MAX_PATH];
  500. LPITEMIDLIST pidlCurrent = (LPITEMIDLIST)lParam;
  501. SHGetPathFromIDList(pidlCurrent, szFileName);
  502. SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szFileName);
  503. }
  504. break;
  505. }
  506. return 0;
  507. }*/
  508. void DesignFrom::GetSavePath(CString &path)
  509. {
  510. char lpszDisplayName[MAX_PATH], szFileName[MAX_PATH];
  511. LPITEMIDLIST pidlDesktop, pidlCurrent;
  512. if (SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop) == NOERROR)
  513. {
  514. BROWSEINFO bi;
  515. bi.hwndOwner = this->m_hWnd;
  516. bi.pidlRoot = pidlDesktop;
  517. bi.pszDisplayName = lpszDisplayName;
  518. bi.lpszTitle = "\n文档保存的目录:";
  519. bi.ulFlags = BIF_STATUSTEXT&BIF_RETURNONLYFSDIRS;
  520. bi.lpfn = BrowseProc;
  521. bi.lParam = 0;
  522. bi.iImage = 0;
  523. pidlCurrent = SHBrowseForFolder(&bi);
  524. SHGetPathFromIDList(pidlCurrent, szFileName);
  525. path = szFileName;
  526. }
  527. }
  528. int DesignFrom::FindArray(CStringArray *pArray, CString Str)
  529. {
  530. for (int i = 0; i < pArray->GetSize(); i++)
  531. {
  532. if (pArray->ElementAt(i) == Str)
  533. return i;
  534. }
  535. return -1;
  536. }
  537. //-----------------------------------------------------------------
  538. // remark by Jeff 2014-12-12
  539. // 函数:GetNo
  540. // 描述:从str中解析出每个相片名,然后存入空的CStringArray中;
  541. // 参数:
  542. // str:选好的相片名串,如:"001,002,003" 后分隔符改为"|",结果应是"001|002|003"
  543. // array:空的数组,用来存放解析后的相片名;
  544. // 返回:
  545. // 注意:更换分隔符造成的问题,在该函数已解决;
  546. //-----------------------------------------------------------------
  547. void DesignFrom::GetNo(CString str, CStringArray &array)
  548. {
  549. if (!str.IsEmpty())
  550. {
  551. #ifdef USE_SEP_VEB
  552. int pos = str.Find(SEPS_VEB);
  553. #else
  554. int pos = str.Find(",");
  555. #endif
  556. while (pos != -1)
  557. {
  558. if (FindArray(&array, str.Left(pos)) == -1)
  559. array.Add(str.Left(pos));
  560. str = str.Right(str.GetLength() - pos - 1);
  561. #ifdef USE_SEP_VEB
  562. pos = str.Find(SEPS_VEB);
  563. #else
  564. pos = str.Find(",");
  565. #endif
  566. }
  567. if (FindArray(&array, str) == -1)
  568. array.Add(str);
  569. }
  570. }
  571. //-----------------------------------------------------------------
  572. // remark by Jeff 2014-12-12
  573. // 函数:GetSelName
  574. // 描述:
  575. // 参数:
  576. // name:由GetNo解析出来后的单个相片名,如:"001"
  577. // spnamearray:订单下的商品数组,case 50所得;
  578. // 返回:
  579. // 注意:更换分隔符造成的问题,在该函数已解决;
  580. //-----------------------------------------------------------------
  581. CString DesignFrom::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  582. {
  583. CString ret;
  584. #ifdef USE_SEP_VEB
  585. name = SEPS_VEB + name + SEPS_VEB;
  586. #else
  587. name = "," + name + ",";
  588. #endif
  589. CString str;
  590. for (int i = 0; i < spnamearray.GetSize(); i++)
  591. {
  592. #ifdef USE_SEP_VEB
  593. str = SEPS_VEB + spnamearray.ElementAt(i).ElementAt(8) + SEPS_VEB;
  594. #else
  595. str = "," + spnamearray.ElementAt(i).ElementAt(8) + ",";
  596. #endif
  597. if (str.Find(name) != -1)
  598. {
  599. ret += spnamearray.ElementAt(i).ElementAt(5);
  600. ret += ";";
  601. }
  602. }
  603. ret.TrimRight(";");
  604. ret.Replace("*", "x");
  605. return ret;
  606. }
  607. //-----------------------------------------------------------------
  608. // remark by Jeff 2014-12-12
  609. // 函数:GetSelName2
  610. // 描述:
  611. // 参数:
  612. // name:由GetNo解析出来后的单个相片名,如:"001"
  613. // spnamearray:订单下的商品数组,case 50所得;
  614. // 返回:
  615. // 注意:更换分隔符造成的问题,在该函数已解决;
  616. //-----------------------------------------------------------------
  617. CString DesignFrom::GetSelName2(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  618. {
  619. CString ret;
  620. #ifdef USE_SEP_VEB
  621. name = SEPS_VEB + name + SEPS_VEB;
  622. #else
  623. name = "," + name + ",";
  624. #endif
  625. CString str;
  626. for (int i = 0; i < spnamearray.GetSize(); i++)
  627. {
  628. #ifdef USE_SEP_VEB
  629. str = SEPS_VEB + spnamearray.ElementAt(i).ElementAt(8) + SEPS_VEB;
  630. #else
  631. str = "," + spnamearray.ElementAt(i).ElementAt(8) + ",";
  632. #endif
  633. if (str.Find(name) != -1)
  634. {
  635. ret += spnamearray.ElementAt(i).ElementAt(5);
  636. ret += ";";
  637. }
  638. }
  639. ret.TrimRight(";");
  640. ret.Replace("*", "x");
  641. return ret;
  642. }
  643. void DesignFrom::OnBUTexportphoto() // 导出精修好的片 按钮;
  644. {
  645. #ifdef USE_KERNEL_DLL
  646. // 判断登陆用户是否有导出原片的权限;
  647. if ( !IsHasRights2new(11) )
  648. {
  649. AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
  650. return;
  651. }
  652. // 获取列表信息:域名、订单号、景点名、顾客信息;
  653. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  654. if ( pos == NULL )
  655. {
  656. AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
  657. return;
  658. }
  659. INT nItemCount = m_List1.GetItemCount();
  660. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  661. CString strBranchId = _T("");
  662. CString strOrderNum = _T("");
  663. // 初修列表不支持景点名,需要从其他地方获取;
  664. CString strScenery = _T("");
  665. CString strCustomerInfo = _T("");
  666. // 获取域名;
  667. if ( g_bAllBranch )
  668. {// 多店汇总时;
  669. strBranchId = GetDomainFromBranch( m_List1.GetItemText(nSelectedItem, 0) );
  670. }
  671. else
  672. {
  673. if ( g_branchname.IsEmpty() )
  674. {// 连接本店时;
  675. strBranchId = g_domain;
  676. }
  677. else
  678. {// 连接分店时;
  679. strBranchId = GetDomainFromBranch( g_branchname );
  680. }
  681. }
  682. // 获取订单号;
  683. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  684. // 获取顾客信息;
  685. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  686. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  687. IsGrowthTx IsGrowthtxdlg;
  688. IsGrowthtxdlg.m_mode = 1;
  689. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  690. IsGrowthtxdlg.DoModal();
  691. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  692. {
  693. return;
  694. }
  695. if ( IsGrowthtxdlg.m_bGrowthTx )
  696. {// 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  697. strScenery = IsGrowthtxdlg.m_seltxname;
  698. if ( strScenery == _T("全部") )
  699. {
  700. strScenery.Empty();
  701. }
  702. }
  703. // 导出原片时,是否压缩导出;
  704. DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
  705. /////////////////////////////////////////////////////////////////////////////////////////////////
  706. if ( g_pIMGProcess == NULL )
  707. {
  708. return ;
  709. }
  710. // 获取完信息,开始导出原片;
  711. ImgExportInterface *pExport = NULL;
  712. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  713. if ( pExport )
  714. {
  715. pExport->ExportFurtherImg(
  716. TRUE,
  717. strBranchId,
  718. strOrderNum,
  719. strCustomerInfo,
  720. !strScenery.IsEmpty(),
  721. strScenery,
  722. _T("*.jpg|*.jpeg"),
  723. dwExportPix,
  724. _T("*.nef|*.cr2|*.raw|*.ra2"),
  725. FALSE,
  726. FALSE
  727. );
  728. }
  729. g_pIMGProcess->Release();
  730. // 结束;
  731. #else
  732. if (IsHasRights2new(11) == 0)return;
  733. POSITION pos;
  734. pos = m_List1.GetFirstSelectedItemPosition();
  735. if (pos == NULL)
  736. {
  737. AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
  738. return;
  739. }
  740. int iItem = m_List1.GetNextSelectedItem(pos);
  741. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  742. CString branch;
  743. if (g_bAllBranch)
  744. branch = m_List1.GetItemText(iItem, 0);
  745. CString path;
  746. if (g_bAllBranch)
  747. {
  748. CString branchpath = GetBranchPhotoPath(branch);
  749. path = g_path4 + branchpath + "\\";
  750. }
  751. else
  752. path = g_path4 + "\\";
  753. path += id;
  754. path += "\\";
  755. CStringArray array;
  756. CString dir;
  757. GetSavePath(dir);
  758. if (dir.IsEmpty())
  759. {
  760. return;
  761. }
  762. CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
  763. CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
  764. dir.TrimRight('\\');
  765. dir += "\\";
  766. dir += id;
  767. dir += g_branchname;
  768. if (g_bAllBranch)
  769. {
  770. if (GetBranchPhotoPath(branch) != "")
  771. dir += branch;
  772. }
  773. dir += name1;
  774. dir += name2;
  775. dir += "精修好的片";
  776. dir += "\\";
  777. ::CreateDirectory(dir, NULL);
  778. CStringArray desarray;
  779. CStringArray dirarray;
  780. CString savepath = dir;
  781. CString str;
  782. if (1)
  783. {
  784. using namespace helper_coffs;
  785. ffsco o;
  786. o.dirs(1);
  787. o.find(LPCSTR(path), LPCSTR("*.*"));
  788. ffsco::typeT coo;
  789. ffsco::typeT::iterator it;
  790. coo = o.co_dir();
  791. for (it = coo.begin(); coo.end() != it; it++)
  792. {
  793. str = (*it).c_str();
  794. if (FindArray(&dirarray, str) == -1)
  795. {
  796. dirarray.Add(str);
  797. if (str != dirarray.ElementAt(0))
  798. {
  799. str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
  800. if (::CheckFolderFileExist(str) == 0)
  801. ::CreateDirectory(str, NULL);
  802. }
  803. }
  804. }
  805. }
  806. if (1)
  807. {
  808. for (int i = 0; i < dirarray.GetSize(); i++)
  809. {
  810. using namespace helper_coffs;
  811. ffsco o;
  812. o.dirs(0);
  813. o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
  814. ffsco::typeT coo;
  815. ffsco::typeT::iterator it;
  816. coo = o.co_file();
  817. for (it = coo.begin(); coo.end() != it; it++)
  818. {
  819. str = (*it).c_str();
  820. if (str.GetAt(str.ReverseFind('\\') + 1) == 's')continue;
  821. if (str.GetAt(str.ReverseFind('\\') + 1) == 'm')continue;
  822. array.Add(str);
  823. desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
  824. }
  825. }
  826. }
  827. if (array.GetSize() == 0)
  828. {
  829. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  830. return;
  831. }
  832. CCompressOption comoptdlg;
  833. comoptdlg.DoModal();
  834. //----------------------------------------------------------------------------------------------
  835. //----------------------------------------------------------------------------------------------
  836. // 导出精修好片;
  837. //----------------------------------------------------------------------------------------------
  838. //----------------------------------------------------------------------------------------------
  839. ImportPhoto dlg;
  840. dlg.m_nOutputSize = comoptdlg.m_nsize; // 1.导出精修片时的尺寸;
  841. dlg.m_mode = 1; // 2.未知;
  842. dlg.m_pArray = &array; // 3.作为导出源的精修片路径集合;
  843. dlg.m_pDesArray = &desarray; // 4.作为导出目标的精修片路径集合;
  844. dlg.m_savepath = dir; // 5.保存导出精修片的目录;
  845. dlg.DoModal();
  846. AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  847. // CString str;
  848. str = " 导出精修片 ";
  849. str += "客人:";
  850. str += name1 + name2 + id;
  851. WriteLog(_T("导出精修好片"), str);
  852. {
  853. ShowCut dlg;
  854. dlg.m_branch = branch;
  855. dlg.m_mode = 1;
  856. dlg.m_strOrderNum = id;
  857. dlg.DoModal();
  858. }
  859. #endif
  860. }
  861. void DesignFrom::OnBUTimportphoto() // 导入设计版/N8选版 按钮;
  862. {
  863. #ifdef USE_KERNEL_DLL
  864. // 获取列表信息;
  865. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  866. if ( pos == NULL )
  867. {
  868. AfxMessageBox(_T("请选中您要导片的订单号!"), MB_ICONINFORMATION);
  869. return;
  870. }
  871. INT nItemCount = m_List1.GetItemCount();
  872. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  873. // 订单的设计信息店名、域名、订单号、景点名、顾客信息、设计状态、设计日期、设计师;
  874. CString strBranchName = _T("");
  875. CString strBranchId = _T("");
  876. CString strOrderNum = _T("");
  877. CString strScenery = _T("");
  878. CString strCustomerInfo = _T("");
  879. CString strDesignState = _T("");
  880. CString strDesignDate = _T("");
  881. CString strDesigner = _T("");
  882. // 获取域名;
  883. if ( g_bAllBranch )
  884. {// 多店汇总时;
  885. strBranchName = m_List1.GetItemText(nSelectedItem, 0);
  886. strBranchId = GetDomainFromBranch( strBranchName );
  887. }
  888. else
  889. {
  890. if ( g_branchname.IsEmpty() )
  891. {// 连接本店时;
  892. strBranchName = _T("");
  893. strBranchId = g_domain;
  894. }
  895. else
  896. {// 连接分店时;
  897. strBranchName = g_branchname;
  898. strBranchId = GetDomainFromBranch( g_branchname );
  899. }
  900. }
  901. // 获取订单号;
  902. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  903. // 获取设计师;
  904. strDesigner = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  905. // 获取设计状态;
  906. strDesignState = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  907. // 获取设计日期;
  908. strDesignDate = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  909. // 获取顾客信息;
  910. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  911. CDlgChuXiuInfo xpdlg;
  912. xpdlg.m_nXiupianMode = 1;
  913. xpdlg.m_strOrderNumber = strOrderNum;
  914. xpdlg.m_strXiupianRen = strDesigner;
  915. if ( strDesignState == _T("OK") )
  916. xpdlg.m_nXiupianStatus = 0;
  917. else if ( strDesignState == _T("设计中"))
  918. xpdlg.m_nXiupianStatus = 1;
  919. else if ( strDesignState == _T("未设计"))
  920. xpdlg.m_nXiupianStatus = 2;
  921. CString strSQL = _T("");
  922. if( xpdlg.DoModal() == IDOK )
  923. {
  924. if ( xpdlg.m_bGrowthTx )
  925. strScenery = xpdlg.m_strScenery;
  926. if ( xpdlg.m_nXiupianStatus == 0 )
  927. strDesignState = _T("OK");
  928. else if ( xpdlg.m_nXiupianStatus == 1)
  929. strDesignState = _T("设计中");
  930. else if ( xpdlg.m_nXiupianStatus == 2 )
  931. strDesignState = _T("未设计");
  932. strDesigner = xpdlg.m_strXiupianRen;
  933. if (strDesignDate.IsEmpty())
  934. strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s', time10 = '%s' where id = '%s'"), strDesigner, strDesignState, g_date, strOrderNum);
  935. else
  936. strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s' where id = '%s'"), strDesigner, strDesignState, strOrderNum);
  937. /////////////////////////////////////////////////////////////////////////////////////////////////
  938. // 构建数据包;
  939. g_sendhead.bsql = TRUE;
  940. if ( g_bAllBranch )
  941. {// 多店汇总时;
  942. g_branchip = GetBranchIPbyId(strBranchId);
  943. g_pMainWnd->OnDisconnect();
  944. g_branchname = strBranchName;
  945. g_bBranchModify = TRUE;
  946. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  947. g_pMainWnd->OnDisconnect();
  948. g_bBranchModify = FALSE;
  949. g_branchip = g_branchname = _T("");
  950. }
  951. else
  952. {// 连接本店或分店时;
  953. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  954. }
  955. // 刷新界面数据;
  956. if (g_bSendOK == 0)
  957. {
  958. OutputDebugString(_T("接收服务器数据失败!\n"));
  959. return;
  960. }
  961. if (g_bAllBranch == 0)
  962. {// 连接本店或分店时;
  963. GetData();
  964. }
  965. else
  966. {// 多店汇总时;
  967. for (int i = 0; i < m_List1array.GetSize(); i++)
  968. {
  969. if (strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0))
  970. {
  971. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, strDesignState);
  972. if (strDesignDate.IsEmpty())
  973. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  974. m_List1array.ElementAt(i).SetAt(14 + m_nAdd, strDesigner);
  975. FillGrid();
  976. break;
  977. }
  978. }
  979. }
  980. }
  981. else
  982. {
  983. // 开始导入初修片;
  984. if ( MessageBox(_T("是否现在开始导入设计片!"), _T("导片提示:导入设计片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
  985. {// 是否马上导入相片;
  986. return;
  987. }
  988. if ( xpdlg.m_bGrowthTx )
  989. strScenery = xpdlg.m_strScenery;
  990. if ( xpdlg.m_bGrowthTx && strScenery.IsEmpty() )
  991. {
  992. AfxMessageBox(_T("儿童成长套系导片必须选择套系名!"));
  993. return;
  994. }
  995. }
  996. /////////////////////////////////////////////////////////////////////////////////////////////////
  997. if ( g_pIMGProcess == NULL )
  998. {
  999. return;
  1000. }
  1001. // 获取完信息,开始导入设计片;
  1002. ImgImportInterface *pImport = NULL;
  1003. g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  1004. if ( pImport )
  1005. {
  1006. if ( m_bN8 && PathFileExists(g_szN8Path) )
  1007. {// N8选版功能启用;
  1008. pImport->ImportN8(g_szN8ViewUserDir, strBranchId, strOrderNum, strCustomerInfo, !strScenery.IsEmpty(), strScenery, FALSE);
  1009. }
  1010. else
  1011. {
  1012. pImport->ImportDesignImg(
  1013. FALSE, // 相片源的类型:true = 选择文件夹形式; false = 选择文件形式;
  1014. strBranchId, // 分店域名;
  1015. strOrderNum, // 订单号;
  1016. strCustomerInfo, // 顾客信息;
  1017. !strScenery.IsEmpty(), // 导入时是否生成景点名;
  1018. strScenery, // 要导入并生成的景点名;
  1019. _T("*.jpg|*.jpeg"), // 要导入的扩展名;
  1020. INVALID_COPY_PIX, // 要导入的相片的压缩像素大小;INVALID_COPY_PIX表示不压缩,原比例导入;
  1021. _T("*.nef|*.cr2|*.raw|*.ra2"), // 导入相片时,附加要导入的扩展名;附加的相片不设置压缩像素;
  1022. FALSE, // 导入操作时,是否生成缩略图;只生成lpImportExt的;
  1023. INVALID_COPY_PIX, // 要生成的缩略图的像素大小;
  1024. FALSE // 目标文件存在是否复制,只针对lpImportExt和lpImportWithExt对应的文件,缩略图直接覆盖;
  1025. );
  1026. }
  1027. g_pIMGProcess->Release();
  1028. }
  1029. // 结束;
  1030. #else
  1031. POSITION pos;
  1032. pos = m_List1.GetFirstSelectedItemPosition();
  1033. if (pos == NULL)
  1034. {
  1035. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  1036. return;
  1037. }
  1038. int iItem = m_List1.GetNextSelectedItem(pos);
  1039. CString branch;
  1040. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1041. if (g_bAllBranch)
  1042. branch = m_List1.GetItemText(iItem, 0);
  1043. // 原本4,5,改为5,6
  1044. CString oldstatus = m_List1.GetItemText(iItem, 5 + m_nAdd);
  1045. CString time10 = m_List1.GetItemText(iItem, 6 + m_nAdd);
  1046. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1047. name.TrimLeft(",");
  1048. name.TrimRight(",");
  1049. name = "客人:" + name;
  1050. CString phone = m_List1.GetItemText(iItem, 16 + m_nAdd) + "," + m_List1.GetItemText(iItem, 17 + m_nAdd);
  1051. phone.TrimLeft(",");
  1052. phone.TrimRight(",");
  1053. phone = "电话:" + phone;
  1054. CString strDomain = _T("");
  1055. CString savepath = _T("");
  1056. if (g_bAllBranch)
  1057. strDomain = GetDomainFromBranch(branch);
  1058. else
  1059. {
  1060. if(g_branchname != _T(""))
  1061. strDomain = GetDomainFromBranch(g_branchname);
  1062. }
  1063. //////////////////////////////////////////////////////////////////////////
  1064. // 获取可用的共享目录;
  1065. #if USE_SHARE_FLORD
  1066. TCHAR szSharePath[MAX_PATH] = {0};
  1067. if ( CNetShareInfo::GetInstance()->GetEnableShareDirectory(4, id, strDomain, szSharePath) )
  1068. {
  1069. savepath.Format("%s\\",szSharePath);
  1070. }
  1071. else
  1072. {
  1073. AfxMessageBox(_T("没有可用的共享目录!"));
  1074. return;
  1075. }
  1076. #else
  1077. savepath += id + "\\";
  1078. #endif //#if USE_SHARE_FLORD
  1079. if (::CheckFolderFileExist(savepath) == 0)
  1080. ::CreateDirectory(savepath, NULL);
  1081. /* IsGrowthTx growthtxdlg;
  1082. growthtxdlg.m_id=id;
  1083. growthtxdlg.DoModal ();
  1084. if(growthtxdlg.m_bReturnOK==0)
  1085. return;
  1086. if(growthtxdlg.m_bGrowthTx && growthtxdlg.m_seltxname.IsEmpty ())
  1087. return;
  1088. if(!growthtxdlg.m_seltxname.IsEmpty ())
  1089. {
  1090. savepath+=growthtxdlg.m_seltxname+"\\";
  1091. if(::CheckFolderFileExist (savepath)==0)
  1092. ::CreateDirectory (savepath, NULL);
  1093. }*/
  1094. CString srcdir; CString str;
  1095. GetSavePath(srcdir);
  1096. if (srcdir.IsEmpty())
  1097. {
  1098. CString status5;
  1099. if (AfxMessageBox("客照是否全部设计完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
  1100. status5 = "OK";
  1101. else
  1102. status5 = "设计中";
  1103. CString sql;
  1104. if (time10.IsEmpty())
  1105. sql = "update dindan set status5='" + status5 + "',time10='" + g_date + "' where id='" + id + "'";
  1106. else
  1107. sql = "update dindan set status5='" + status5 + "' where id='" + id + "'";
  1108. g_sendhead.bsql = 1;
  1109. if (g_bAllBranch)
  1110. {
  1111. g_branchip = GetIP(branch);
  1112. g_pMainWnd->OnDisconnect();
  1113. g_branchname = branch;
  1114. g_bBranchModify = 1;
  1115. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1116. g_pMainWnd->OnDisconnect();
  1117. g_bBranchModify = 0;
  1118. g_branchip = g_branchname = "";
  1119. }
  1120. else
  1121. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1122. if (g_bSendOK == 0)return;
  1123. if (g_bAllBranch == 0)
  1124. {
  1125. GetData();
  1126. }
  1127. else
  1128. {
  1129. for (int i = 0; i < m_List1array.GetSize(); i++)
  1130. {
  1131. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1132. {
  1133. m_List1array.ElementAt(i).SetAt(4 + m_nAdd, status5);
  1134. if (time10.IsEmpty())
  1135. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date);
  1136. FillGrid();
  1137. break;
  1138. }
  1139. }
  1140. }
  1141. return;
  1142. }
  1143. if (srcdir.GetLength() < 4)
  1144. {
  1145. AfxMessageBox("请选择正确的您文件所在的目录!", MB_ICONSTOP);
  1146. return;
  1147. }
  1148. if (oldstatus != "未设计")
  1149. {
  1150. CString str;
  1151. str.Format("%s\r\n%s\r\n此单已导入过设计片, 确认您选中的照片没有导入过吗? 否则会覆盖原来的照片, 是否继续?", name, phone);
  1152. if (AfxMessageBox(str, MB_YESNO | MB_ICONSTOP) != IDYES)
  1153. return;
  1154. }
  1155. else
  1156. {
  1157. CString str;
  1158. str.Format("%s\r\n%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone);
  1159. if (AfxMessageBox(str, MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1160. return;
  1161. }
  1162. CStringArray array;
  1163. CStringArray desarray;
  1164. CStringArray dirarray;
  1165. if (1)
  1166. {
  1167. // 1.获取源目录下的所有子目录;
  1168. using namespace helper_coffs;
  1169. ffsco o;
  1170. o.dirs(1);
  1171. o.find(LPCSTR(srcdir), LPCSTR("*.*"));
  1172. ffsco::typeT coo;
  1173. ffsco::typeT::iterator it;
  1174. coo = o.co_dir();
  1175. for (it = coo.begin(); coo.end() != it; it++)
  1176. {
  1177. str = (*it).c_str();
  1178. if (FindArray(&dirarray, str) == -1)
  1179. {
  1180. dirarray.Add(str);
  1181. if (str != dirarray.ElementAt(0))
  1182. {
  1183. str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
  1184. if (::CheckFolderFileExist(str) == 0)
  1185. ::CreateDirectory(str, NULL);
  1186. }
  1187. }
  1188. }
  1189. }
  1190. if (1)
  1191. {
  1192. // 2.从每个子目录下查找所有的相片;
  1193. for (int i = 0; i < dirarray.GetSize(); i++)
  1194. {
  1195. using namespace helper_coffs;
  1196. ffsco o;
  1197. o.dirs(0);
  1198. o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
  1199. ffsco::typeT coo;
  1200. ffsco::typeT::iterator it;
  1201. coo = o.co_file();
  1202. for (it = coo.begin(); coo.end() != it; it++)
  1203. {
  1204. str = (*it).c_str();
  1205. array.Add(str);
  1206. desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
  1207. }
  1208. }
  1209. }
  1210. if (array.GetSize() == 0)return;
  1211. //----------------------------------------------------------------------------------------------
  1212. //----------------------------------------------------------------------------------------------
  1213. // 导入设计的片;
  1214. //----------------------------------------------------------------------------------------------
  1215. //----------------------------------------------------------------------------------------------
  1216. ImportPhoto dlg;
  1217. dlg.m_branch = branch; // 1.订单分店名;
  1218. dlg.m_nphototype = 3; // 2.未知;
  1219. dlg.m_pArray = &array; // 3.作为源的设计片路径集合;
  1220. dlg.m_pDesArray = &desarray; // 4.作为目标的设计片路径集合;
  1221. dlg.m_savepath = savepath; // 5.导出时的保存目录;
  1222. #ifdef ENTERPRISE_VERSION
  1223. // if(!g_branchname.IsEmpty ())
  1224. {
  1225. dlg.m_bSaveUploadTask = g_bSaveUploadTask4;
  1226. dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(81);
  1227. dlg.m_uploadtaskarray.Add(id + ";" + name);
  1228. dlg.m_uploadtaskarray.Add("");
  1229. dlg.m_uploadtaskarray.Add("");
  1230. dlg.m_uploadtaskarray.Add("");
  1231. dlg.m_uploadtaskarray.Add("");
  1232. dlg.m_uploadtaskarray.Add("");
  1233. dlg.m_uploadtaskarray.Add("");
  1234. dlg.m_uploadtaskarray.Add("");
  1235. dlg.m_uploadtaskarray.Add("");
  1236. dlg.m_uploadtaskarray.Add("");
  1237. }
  1238. #endif
  1239. dlg.DoModal();
  1240. CString status5;
  1241. if (AfxMessageBox("客照是否全部设计完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
  1242. status5 = "OK";
  1243. else
  1244. status5 = "设计中";
  1245. CString sql;
  1246. if (time10.IsEmpty())
  1247. sql = "update dindan set status5='" + status5 + "',waiter4='" + g_user.name + "',time10='" + g_date + "' where id='" + id + "'";
  1248. else
  1249. sql = "update dindan set status5='" + status5 + "',waiter4='" + g_user.name + "' where id='" + id + "'";
  1250. g_sendhead.bsql = 1;
  1251. if (g_bAllBranch)
  1252. {
  1253. g_branchip = GetIP(branch);
  1254. g_pMainWnd->OnDisconnect();
  1255. g_branchname = branch;
  1256. g_bBranchModify = 1;
  1257. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1258. g_pMainWnd->OnDisconnect();
  1259. g_bBranchModify = 0;
  1260. g_branchip = g_branchname = "";
  1261. }
  1262. else
  1263. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1264. if (g_bSendOK == 0)return;
  1265. savepath += "ok";
  1266. ::DeleteFile(savepath); // 删除ok文件;
  1267. AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
  1268. if (g_bAllBranch == 0)
  1269. {
  1270. GetData();
  1271. }
  1272. else
  1273. {
  1274. for (int i = 0; i < m_List1array.GetSize(); i++)
  1275. {
  1276. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1277. {
  1278. m_List1array.ElementAt(i).SetAt(4 + m_nAdd, status5);
  1279. if (time10.IsEmpty())
  1280. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date);
  1281. m_List1array.ElementAt(i).SetAt(13 + m_nAdd, g_user.name);
  1282. FillGrid();
  1283. break;
  1284. }
  1285. }
  1286. }
  1287. #endif
  1288. }
  1289. // Jeff:选设计版按钮;
  1290. void DesignFrom::OnBUTshowphoto() //Jeff:选设计版、N8按钮;
  1291. {
  1292. POSITION pos;
  1293. pos = m_List1.GetFirstSelectedItemPosition();
  1294. if (pos == NULL)
  1295. {
  1296. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1297. return;
  1298. }
  1299. int nSelectedItem = m_List1.GetNextSelectedItem(pos);
  1300. // 订单号;
  1301. CString strOrderNum = m_List1.GetItemText(nSelectedItem, 0);
  1302. // 设计状态;
  1303. CString strDesignStatus = m_List1.GetItemText(nSelectedItem, 5);
  1304. // 设计日期;
  1305. CString strDesignDate = m_List1.GetItemText(nSelectedItem, 6);
  1306. // 选设计人;
  1307. CString strXuanPainRen = m_List1.GetItemText(nSelectedItem, 13);
  1308. //////////////////////////////////////////////////////////////////////////
  1309. if ( m_bN8 && PathFileExists(g_szN8Path) )
  1310. {// N8选版;
  1311. // SETUP1.获取List控件的记录信息和域名信息;
  1312. CString strTemp = _T("");
  1313. CString strBranchId = _T("");
  1314. CString strBranchName =_T("");
  1315. CString strScenery = _T("");
  1316. // 获取域名;
  1317. if ( g_bAllBranch )
  1318. {// 多店汇总;
  1319. strBranchName = m_List1.GetItemText(nSelectedItem, 0);
  1320. strBranchId = GetDomainFromBranch(strBranchName);
  1321. }
  1322. else
  1323. {
  1324. if ( g_branchname.IsEmpty() )
  1325. {// 连接本店时;
  1326. strBranchId = g_domain;
  1327. }
  1328. else
  1329. {//连接分店时;
  1330. strBranchName = g_branchname;
  1331. strBranchId = GetDomainFromBranch( g_branchname );
  1332. }
  1333. }
  1334. // SETUP2.获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1335. IsGrowthTx IsGrowthtxdlg;
  1336. IsGrowthtxdlg.m_mode = 1;
  1337. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1338. IsGrowthtxdlg.DoModal();
  1339. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1340. {
  1341. return;
  1342. }
  1343. if ( IsGrowthtxdlg.m_bGrowthTx )
  1344. {
  1345. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1346. strScenery = IsGrowthtxdlg.m_seltxname;
  1347. }
  1348. // SETUP3.获得选版目录,并判断是否存在或已选;
  1349. BOOL bViewFinish = FALSE;
  1350. CString strUserPath = _T("");
  1351. CString strUserPath2 = _T("");
  1352. if ( strBranchId != g_domain )
  1353. {
  1354. if ( IsGrowthtxdlg.m_bGrowthTx )
  1355. {
  1356. strUserPath.Format(_T("%s\\%s"), strBranchId, strOrderNum);
  1357. strUserPath2.Format(_T("%s\\%s"), strBranchId, strOrderNum);
  1358. }
  1359. else
  1360. {
  1361. strUserPath.Format(_T("%s\\%s"), strBranchId, strOrderNum);
  1362. strUserPath2.Format(_T("%s\\[已选]%s"), strBranchId, strOrderNum);
  1363. }
  1364. }
  1365. else
  1366. {
  1367. if ( IsGrowthtxdlg.m_bGrowthTx )
  1368. {
  1369. strUserPath.Format(_T("%s"), strOrderNum);
  1370. strUserPath2.Format(_T("%s"), strOrderNum);
  1371. }
  1372. else
  1373. {
  1374. strUserPath.Format(_T("%s"), strOrderNum);
  1375. strUserPath2.Format(_T("[已选]%s"), strOrderNum);
  1376. }
  1377. }
  1378. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  1379. {
  1380. strUserPath += _T("\\[已选]") + strScenery;
  1381. }
  1382. strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
  1383. if ( PathFileExists(strTemp) )
  1384. {
  1385. if (IsGrowthtxdlg.m_bGrowthTx)
  1386. AfxMessageBox(_T("该套系选版已完成!"));
  1387. else
  1388. AfxMessageBox(_T("该订单选版已完成!"));
  1389. bViewFinish = TRUE;
  1390. }
  1391. else
  1392. {
  1393. strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath);
  1394. if ( !PathFileExists(strTemp) )
  1395. {
  1396. if (IsGrowthtxdlg.m_bGrowthTx)
  1397. AfxMessageBox(_T("未找到该套系数据,选版未设计!"));
  1398. else
  1399. AfxMessageBox(_T("未找到该订单数据,选版未设计!"));
  1400. return;
  1401. }
  1402. }
  1403. //////////////////////////////////////////////////////////////////////////
  1404. // 传参N8运行;
  1405. CString strParamter = _T("");
  1406. strParamter.Format(_T("/t \"<task userfolder='%s' staffid='%s' serverip='%s'/>\""),
  1407. strUserPath,
  1408. g_user.account,
  1409. g_szN8SvIP);
  1410. //strUserPath = strTemp;
  1411. //////////////////////////////////////////////////////////////////////////
  1412. #ifdef CHILD_VERSION
  1413. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  1414. strTemp.Format(_T("id = '%s' and growthxname = '%s'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
  1415. else
  1416. strTemp.Format(_T("id = '%s'"), strOrderNum, strOrderNum, strOrderNum);
  1417. #else
  1418. strTemp.Format(_T("id = '%s'"), strOrderNum, strOrderNum, strOrderNum);
  1419. #endif//CHILD_VERSION
  1420. g_sendhead.bsql = FALSE;
  1421. g_sendhead.code[0] = 50; // dindansp;
  1422. g_sendhead.tabcount = 1;
  1423. if( g_bAllBranch )
  1424. {//多店汇总时;
  1425. g_branchip = GetBranchIPbyId(strBranchId);
  1426. g_pMainWnd->OnDisconnect();
  1427. g_branchname = strBranchName;
  1428. g_bBranchModify = TRUE;
  1429. g_pMainWnd->ProcessChatMessageRequest2(strTemp);
  1430. g_pMainWnd->OnDisconnect();
  1431. g_bBranchModify = FALSE;
  1432. g_branchip = g_branchname = _T("");
  1433. }
  1434. else
  1435. {// 连接本店或分店时;
  1436. g_pMainWnd->ProcessChatMessageRequest2(strTemp);
  1437. }
  1438. if( !g_bSendOK )
  1439. return ;
  1440. CArray<CStringArray, CStringArray> Arydindansp;
  1441. DataToArray( &Arydindansp );
  1442. //////////////////////////////////////////////////////////////////////////
  1443. strTemp.Format(_T("%s\\选版结果\\"), strUserPath);
  1444. if ( !PathFileExists(strTemp) )
  1445. {
  1446. CreateDirectory(strTemp,NULL);
  1447. }
  1448. N8Process::CResultProduct rp;
  1449. if ( !PathFileExists(strTemp + _T("Product.data")) )
  1450. rp.CreateXML(strTemp + _T("Product.data"));
  1451. rp.SetXMLPath(strTemp + _T("Product.data"));
  1452. N8Process::CResultVgProduct rvgp;
  1453. if ( !PathFileExists(strTemp + _T("VgProduct.data")) )
  1454. rvgp.CreateXML(strTemp + _T("VgProduct.data"));
  1455. rvgp.SetXMLPath(strTemp + _T("VgProduct.data"));
  1456. for ( int i = 0; i < Arydindansp.GetSize(); i++ )
  1457. {
  1458. rp.InsertItem(Arydindansp.ElementAt(i).ElementAt(1), NULL, Arydindansp.ElementAt(i).ElementAt(5), NULL, NULL);
  1459. rvgp.InsertItem(Arydindansp.ElementAt(i).ElementAt(1), NULL, Arydindansp.ElementAt(i).ElementAt(5), NULL, NULL);
  1460. }
  1461. STARTUPINFO si;
  1462. PROCESS_INFORMATION pi;
  1463. ZeroMemory(&si, sizeof(STARTUPINFO));
  1464. si.cb = sizeof(STARTUPINFO);
  1465. ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
  1466. TCHAR szCommonLine[MAX_PATH] = {0};
  1467. sprintf(szCommonLine, _T("%s"), strParamter);
  1468. if ( !CreateProcess(g_szN8Path, szCommonLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) )
  1469. {
  1470. return;
  1471. }
  1472. WaitForSingleObject(pi.hProcess, INFINITE);
  1473. AfxMessageBox(_T("选版结束"));
  1474. if ( !bViewFinish )
  1475. {
  1476. strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
  1477. if ( PathFileExists(strTemp) )
  1478. {
  1479. bViewFinish = TRUE;
  1480. }
  1481. }
  1482. CString strViewFinishXml = _T("");
  1483. if ( bViewFinish )
  1484. {
  1485. strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
  1486. if ( PathFileExists(strTemp) )
  1487. {
  1488. CString strXML = _T("");
  1489. strTemp.TrimRight(_T("\\"));
  1490. int nIndex = strTemp.ReverseFind(_T('\\'));
  1491. if ( nIndex != -1 )
  1492. {
  1493. strXML = strTemp.Mid(nIndex+1);
  1494. strTemp = strTemp.Left(nIndex);
  1495. }
  1496. strViewFinishXml.Format(_T("%s\\%s.xml"), strTemp, strXML);
  1497. if ( !PathFileExists(strViewFinishXml) )
  1498. {
  1499. strViewFinishXml.Empty();
  1500. }
  1501. }
  1502. }
  1503. printf("\t目录1:%s\n,\t目录2:%s",strUserPath,strUserPath2);
  1504. CDlgN8ViewReuslt N8dlg;
  1505. if ( !bViewFinish )
  1506. N8dlg.m_strUserDir.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath);
  1507. else
  1508. N8dlg.m_strUserDir.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
  1509. printf("\t最终目录:%s\n",N8dlg.m_strUserDir);
  1510. N8dlg.m_strOrderNum = strOrderNum;
  1511. if ( bViewFinish )
  1512. {
  1513. N8dlg.m_bViewFinish = TRUE;
  1514. if ( !strViewFinishXml.IsEmpty() )
  1515. N8dlg.m_strViewFinishxml = strViewFinishXml;
  1516. }
  1517. if (IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  1518. N8dlg.m_strScenery = strScenery;
  1519. N8dlg.m_strCustomer.Format(_T("%s,%s"), m_List1.GetItemText(nSelectedItem, 1), m_List1.GetItemText(nSelectedItem, 2));
  1520. // 读取\版面\Ablum.pwt文件;
  1521. // 读取\选版结果\Product.data文件;
  1522. // 读取\选版结果\VgProduct.data文件;
  1523. // 读取[已选].xml文件;
  1524. N8dlg.DoModal();
  1525. CloseHandle(pi.hProcess);
  1526. CloseHandle(pi.hThread);
  1527. return;
  1528. }
  1529. //////////////////////////////////////////////////////////////////////////
  1530. ChooseDesignSkin dlg; // 选设计对话框;
  1531. dlg.SetLiaPath("3.lia");
  1532. dlg.m_strOrderNumber = strOrderNum;
  1533. dlg.m_path = g_path3 + "\\";
  1534. dlg.m_path += strOrderNum;
  1535. dlg.m_path += "\\";
  1536. dlg.DoModal();
  1537. g_bInSkin = 0;
  1538. for (int i = 0; i < m_List1array.GetSize(); i++)
  1539. {
  1540. if (strOrderNum == m_List1array.ElementAt(i).ElementAt(0))
  1541. {
  1542. m_List1array.ElementAt(i).SetAt(11, dlg.m_bz3); // 看设计备注;
  1543. m_List1array.ElementAt(i).SetAt(7, dlg.m_status8); // 看设计状态;
  1544. m_List1array.ElementAt(i).SetAt(10, dlg.m_time5); // 取件日期;
  1545. if (dlg.m_status8 != "OK")
  1546. m_List1array.ElementAt(i).SetAt(5, "设计中");
  1547. else
  1548. m_List1array.ElementAt(i).SetAt(5, "OK");
  1549. FillGrid();
  1550. break;
  1551. }
  1552. }
  1553. }
  1554. void DesignFrom::OnButton1() // 查询 按钮;
  1555. {
  1556. UpdateData();
  1557. m_filter.TrimLeft();
  1558. m_filter.TrimRight();
  1559. FillGrid();
  1560. }
  1561. // 已选未设计 按钮; "已选未设计"命名不合理,不知是"已选片OK未设计"还是"已精修未设计",意义待定
  1562. void DesignFrom::OnButton2() // 已精修未设计 按钮;
  1563. {
  1564. UpdateData();
  1565. m_filter.TrimLeft();
  1566. m_filter.TrimRight();
  1567. FillGrid(1);
  1568. }
  1569. void DesignFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  1570. {
  1571. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  1572. POSITION pos;
  1573. pos = m_List1.GetFirstSelectedItemPosition();
  1574. if (pos == NULL)
  1575. {
  1576. return;
  1577. }
  1578. int iItem = m_List1.GetNextSelectedItem(pos);
  1579. // CString waiter4=m_List1.GetItemText (iItem, 11);
  1580. if (IsHasRights2new(7) || IsHasRights2new(49))
  1581. {
  1582. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1583. // GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
  1584. }
  1585. else
  1586. {
  1587. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1588. // GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(0);
  1589. }
  1590. /* if(waiter4.IsEmpty () && IsHasRights2new(7) || IsHasRights2new(49) )
  1591. {
  1592. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1593. GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
  1594. }
  1595. else if(waiter4==g_user.name && IsHasRights2new(7) )
  1596. {
  1597. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1598. GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
  1599. }
  1600. else
  1601. {
  1602. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1603. GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(0);
  1604. }*/
  1605. *pResult = 0;
  1606. }
  1607. void DesignFrom::OnBUTimportphoto2() // 查看 按钮;
  1608. {
  1609. POSITION pos;
  1610. pos = m_List1.GetFirstSelectedItemPosition();
  1611. if (pos == NULL)
  1612. {
  1613. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1614. return;
  1615. }
  1616. int iItem = m_List1.GetNextSelectedItem(pos);
  1617. CString branch;
  1618. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1619. if (g_bAllBranch)
  1620. branch = m_List1.GetItemText(iItem, 0);
  1621. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1622. name.TrimLeft(",");
  1623. name.TrimRight(",");
  1624. name = "客人:" + name;
  1625. ShowPic dlg;
  1626. dlg.m_id = id;
  1627. dlg.m_name = name;
  1628. dlg.m_name2 = m_List1.GetItemText(iItem, 1 + m_nAdd) + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1629. // 设计要求(原列10)
  1630. dlg.remark = m_List1.GetItemText(iItem, 11 + m_nAdd);
  1631. dlg.m_mode = 5;
  1632. CString strDomain = _T("");
  1633. CString savepath = _T("");
  1634. if (g_bAllBranch)
  1635. {
  1636. if(branch == _T(""))
  1637. savepath = g_path3 + "\\";
  1638. else
  1639. {
  1640. strDomain = GetDomainFromBranch(branch);
  1641. savepath = g_path3 + "\\" + strDomain + "\\";
  1642. }
  1643. if (::CheckFolderFileExist(savepath) == 0)
  1644. ::CreateDirectory(savepath, NULL);
  1645. }
  1646. else
  1647. {
  1648. if(g_branchname == _T(""))
  1649. savepath = g_path3 + "\\";
  1650. else
  1651. strDomain = GetDomainFromBranch(g_branchname);
  1652. }
  1653. #if !USE_SHARE_FLORD
  1654. // 根据域名,相片类型,订单号查找相片;
  1655. dlg.m_aryOfShareDirectory.RemoveAll();
  1656. CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
  1657. #endif
  1658. dlg.m_branch = strDomain;
  1659. dlg.m_path = g_path3 + _T("\\");
  1660. dlg.m_path += id;
  1661. dlg.m_path += "\\";
  1662. dlg.DoModal();
  1663. }
  1664. void DesignFrom::OnBUTimportphoto3() // 导出 (设计好的片) 按钮;
  1665. {
  1666. #ifdef USE_KERNEL_DLL
  1667. // 判断登陆用户是否有导出原片的权限;
  1668. if ( !IsHasRights2new(12) )
  1669. {
  1670. AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
  1671. return;
  1672. }
  1673. // 获取列表信息:域名、订单号、景点名、顾客信息;
  1674. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  1675. if ( pos == NULL )
  1676. {
  1677. AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
  1678. return;
  1679. }
  1680. INT nItemCount = m_List1.GetItemCount();
  1681. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  1682. CString strBranchId = _T("");
  1683. CString strOrderNum = _T("");
  1684. // 初修列表不支持景点名,需要从其他地方获取;
  1685. CString strScenery = _T("");
  1686. CString strCustomerInfo = _T("");
  1687. // 获取域名;
  1688. if ( g_bAllBranch )
  1689. {// 多店汇总时;
  1690. strBranchId = GetDomainFromBranch( m_List1.GetItemText(nSelectedItem, 0) );
  1691. }
  1692. else
  1693. {
  1694. if ( g_branchname.IsEmpty() )
  1695. {// 连接本店时;
  1696. strBranchId = g_domain;
  1697. }
  1698. else
  1699. {// 连接分店时;
  1700. strBranchId = GetDomainFromBranch( g_branchname );
  1701. }
  1702. }
  1703. // 获取订单号;
  1704. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  1705. // 获取顾客信息;
  1706. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  1707. // 加上设计要求;
  1708. strCustomerInfo += _T("$");
  1709. strCustomerInfo += m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
  1710. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1711. IsGrowthTx IsGrowthtxdlg;
  1712. IsGrowthtxdlg.m_mode = 1;
  1713. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1714. IsGrowthtxdlg.DoModal();
  1715. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1716. {
  1717. return;
  1718. }
  1719. if ( IsGrowthtxdlg.m_bGrowthTx )
  1720. {
  1721. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1722. strScenery = IsGrowthtxdlg.m_seltxname;
  1723. if ( strScenery == _T("全部") )
  1724. {
  1725. strScenery.Empty();
  1726. }
  1727. }
  1728. // 导出原片时,是否压缩导出;
  1729. DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
  1730. /////////////////////////////////////////////////////////////////////////////////////////////////
  1731. if ( g_pIMGProcess == NULL )
  1732. {
  1733. return ;
  1734. }
  1735. // 获取完信息,开始导出原片;
  1736. ImgExportInterface *pExport = NULL;
  1737. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  1738. if ( pExport )
  1739. {
  1740. pExport->ExportDesignImg(
  1741. TRUE,
  1742. strBranchId,
  1743. strOrderNum,
  1744. strCustomerInfo,
  1745. !strScenery.IsEmpty(),
  1746. strScenery,
  1747. _T("*.jpg|*.jpeg"),
  1748. dwExportPix,
  1749. _T("*.nef|*.cr2|*.raw|*.ra2"),
  1750. FALSE,
  1751. FALSE
  1752. );
  1753. }
  1754. g_pIMGProcess->Release();
  1755. // 结束;
  1756. #else
  1757. if (IsHasRights2new(12) == 0)return;
  1758. POSITION pos;
  1759. pos = m_List1.GetFirstSelectedItemPosition();
  1760. if (pos == NULL)
  1761. {
  1762. AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
  1763. return;
  1764. }
  1765. int iItem = m_List1.GetNextSelectedItem(pos);
  1766. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1767. CString branch;
  1768. if (g_bAllBranch)
  1769. branch = m_List1.GetItemText(iItem, 0);
  1770. CString path;
  1771. if (g_bAllBranch)
  1772. {
  1773. CString branchpath = GetBranchPhotoPath(branch);
  1774. path = g_path3 + branchpath + "\\";
  1775. }
  1776. else
  1777. path = g_path3 + "\\";
  1778. path += id;
  1779. path += "\\";
  1780. CStringArray array;
  1781. CString dir;
  1782. GetSavePath(dir);
  1783. if (dir.IsEmpty())
  1784. {
  1785. return;
  1786. }
  1787. CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
  1788. CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
  1789. CString remark = m_List1.GetItemText(iItem, 11 + m_nAdd); // 设计要求,原列10
  1790. dir.TrimRight('\\');
  1791. dir += "\\";
  1792. dir += id;
  1793. dir += g_branchname;
  1794. if (g_bAllBranch)
  1795. {
  1796. if (GetBranchPhotoPath(branch) != "")
  1797. dir += branch;
  1798. }
  1799. dir += name1;
  1800. dir += name2;
  1801. dir += "设计好的片";
  1802. dir += "\\";
  1803. ::CreateDirectory(dir, NULL);
  1804. CStringArray desarray;
  1805. CStringArray dirarray;
  1806. CString savepath = dir;
  1807. CString str;
  1808. if (1)
  1809. {
  1810. using namespace helper_coffs;
  1811. ffsco o;
  1812. o.dirs(1);
  1813. o.find(LPCSTR(path), LPCSTR("*.*"));
  1814. ffsco::typeT coo;
  1815. ffsco::typeT::iterator it;
  1816. coo = o.co_dir();
  1817. for (it = coo.begin(); coo.end() != it; it++)
  1818. {
  1819. str = (*it).c_str();
  1820. if (FindArray(&dirarray, str) == -1)
  1821. {
  1822. dirarray.Add(str);
  1823. if (str != dirarray.ElementAt(0))
  1824. {
  1825. str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
  1826. if (::CheckFolderFileExist(str) == 0)
  1827. ::CreateDirectory(str, NULL);
  1828. }
  1829. }
  1830. }
  1831. }
  1832. if (1)
  1833. {
  1834. for (int i = 0; i < dirarray.GetSize(); i++)
  1835. {
  1836. using namespace helper_coffs;
  1837. ffsco o;
  1838. o.dirs(0);
  1839. o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
  1840. ffsco::typeT coo;
  1841. ffsco::typeT::iterator it;
  1842. coo = o.co_file();
  1843. for (it = coo.begin(); coo.end() != it; it++)
  1844. {
  1845. str = (*it).c_str();
  1846. if (str.GetAt(str.ReverseFind('\\') + 1) == 's')continue;
  1847. if (str.GetAt(str.ReverseFind('\\') + 1) == 'm')continue;
  1848. array.Add(str);
  1849. desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
  1850. }
  1851. }
  1852. }
  1853. if (array.GetSize() == 0)
  1854. {
  1855. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  1856. return;
  1857. }
  1858. CStdioFile fp;
  1859. fp.Open(dir + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
  1860. fp.WriteString(remark);
  1861. fp.Close();
  1862. CCompressOption comoptdlg;
  1863. comoptdlg.DoModal();
  1864. //----------------------------------------------------------------------------------------------
  1865. //----------------------------------------------------------------------------------------------
  1866. // 导出设计好片;
  1867. //----------------------------------------------------------------------------------------------
  1868. //----------------------------------------------------------------------------------------------
  1869. ImportPhoto dlg;
  1870. dlg.m_nOutputSize = comoptdlg.m_nsize; // 1.导出设计好的片的尺寸;
  1871. dlg.m_mode = 1; // 2.未知;
  1872. dlg.m_pArray = &array; // 3.作为导出时的源设计片路径集合;
  1873. dlg.m_pDesArray = &desarray; // 4.作为导出时的目标设计片路径集合;
  1874. dlg.m_savepath = dir; // 5.导出设计片时的保存路径;
  1875. dlg.DoModal();
  1876. AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  1877. // CString str;
  1878. str = " 导出设计片 ";
  1879. str += "客人:";
  1880. str += name1 + name2 + id;
  1881. WriteLog(_T("导出设计好片"), str);
  1882. #endif
  1883. }
  1884. void DesignFrom::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  1885. {
  1886. POSITION pos;
  1887. pos = m_List1.GetFirstSelectedItemPosition();
  1888. if (pos == NULL)return;
  1889. int iItem = m_List1.GetNextSelectedItem(pos);
  1890. g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1891. *pResult = 0;
  1892. }
  1893. // 需要处理更换分隔符造成的问题;
  1894. // 已处理分隔符问题;
  1895. void DesignFrom::OnButton3() // 导出选设计 按钮;导出N8选版;
  1896. {
  1897. #ifdef USE_KERNEL_DLL
  1898. // 判断用户是否有权限导出选设计的片
  1899. if ( !IsHasRights2new(12))
  1900. {
  1901. AfxMessageBox(_T("您没有权限导出选设计的片!"));
  1902. return;
  1903. }
  1904. // 获取列表信息;
  1905. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  1906. if ( pos == NULL )
  1907. {
  1908. AfxMessageBox(_T("请您选中要导片的订单!"));
  1909. return;
  1910. }
  1911. INT nItemCount = m_List1.GetItemCount();
  1912. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  1913. // 获取域名、订单号、景点名、顾客信息、设计状态、设计日期、设计师、选设计人、选设计状态(看设计状态)、选设计日期;
  1914. CString strBranchName = _T("");
  1915. CString strBranchId = _T("");
  1916. CString strOrderNum = _T("");
  1917. CString strScenery = _T("");
  1918. CString strCustomerInfo = _T("");
  1919. CString strDesignState = _T("");
  1920. CString strDesignDate = _T("");
  1921. CString strDesigner = _T("");
  1922. CString strXuanpianRen = _T("");
  1923. CString strXuanpianState = _T("");
  1924. CString strXuanpianDate = _T("");
  1925. // 获取订单号;
  1926. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  1927. // 获取顾客信息;
  1928. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  1929. // 获取设计状态;
  1930. strDesignState = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  1931. // 获取设计日期;
  1932. strDesignState = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  1933. // 获取设计师;
  1934. strDesigner = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
  1935. // 获取看设计状态;
  1936. strXuanpianState = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
  1937. // 获取选设计日期;
  1938. strXuanpianDate = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
  1939. // 获取看设计师;
  1940. strXuanpianRen = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  1941. if ( strDesignState == _T("未设计") )
  1942. {
  1943. MessageBox(_T("此单未设计!"), _T("影楼管理"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION );
  1944. return;
  1945. }
  1946. // 获取域名;
  1947. if ( g_bAllBranch )
  1948. {// 多店汇总;
  1949. strBranchName = m_List1.GetItemText(nSelectedItem, 0);
  1950. strBranchId = GetDomainFromBranch(strBranchName);
  1951. }
  1952. else
  1953. {
  1954. if ( g_branchname.IsEmpty() )
  1955. {// 连接本店时;
  1956. strBranchId = g_domain;
  1957. }
  1958. else
  1959. {//连接分店时;
  1960. strBranchName = g_branchname;
  1961. strBranchId = GetDomainFromBranch( g_branchname );
  1962. }
  1963. }
  1964. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1965. IsGrowthTx IsGrowthtxdlg;
  1966. IsGrowthtxdlg.m_mode = 1;
  1967. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1968. IsGrowthtxdlg.DoModal();
  1969. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1970. {
  1971. return;
  1972. }
  1973. if ( IsGrowthtxdlg.m_bGrowthTx )
  1974. {
  1975. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1976. strScenery = IsGrowthtxdlg.m_seltxname;
  1977. if ( strScenery == _T("全部") )
  1978. {
  1979. strScenery.Empty();
  1980. }
  1981. }
  1982. if ( m_bN8 && PathFileExists(g_szN8Path) )
  1983. {// N8选版;
  1984. ImgExportInterface *pN8Export = NULL;
  1985. if ( g_pIMGProcess == NULL )
  1986. {
  1987. return ;
  1988. }
  1989. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pN8Export);
  1990. if ( pN8Export )
  1991. {// 导出选好的片;
  1992. pN8Export->ExportN8(
  1993. g_szN8ViewUserDir,
  1994. strBranchId,
  1995. strOrderNum,
  1996. strCustomerInfo,
  1997. !strScenery.IsEmpty(),
  1998. strScenery,
  1999. FALSE
  2000. );
  2001. pN8Export->Release();
  2002. OutputDebugString(_T("导出N8!\n"));
  2003. }
  2004. return;
  2005. }
  2006. //////////////////////////////////////////////////////////////////////////
  2007. CString strSQL = _T("");
  2008. #ifdef CHILD_VERSION
  2009. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  2010. strSQL.Format(_T("id = '%s' and growthxname = '%s'; id = '%s'; id = '%s' and name <> '入册' and name <> '入底'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
  2011. else
  2012. strSQL.Format(_T("id = '%s'; id = '%s'; id = '%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  2013. #else
  2014. strSQL.Format(_T("id = '%s'; id = '%s'; id = '%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  2015. #endif//CHILD_VERSION
  2016. g_sendhead.bsql = FALSE;
  2017. g_sendhead.code[0] = 50; // dindansp;
  2018. g_sendhead.code[1] = 11; // dindan;
  2019. g_sendhead.code[2] = 56; // dindansp;
  2020. g_sendhead.tabcount = 3;
  2021. if( g_bAllBranch )
  2022. {//多店汇总时;
  2023. g_branchip = GetBranchIPbyId(strBranchId);
  2024. g_pMainWnd->OnDisconnect();
  2025. g_branchname = strBranchName;
  2026. g_bBranchModify = TRUE;
  2027. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  2028. g_pMainWnd->OnDisconnect();
  2029. g_bBranchModify = FALSE;
  2030. g_branchip = g_branchname = _T("");
  2031. }
  2032. else
  2033. {// 连接本店或分店时;
  2034. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  2035. }
  2036. if( !g_bSendOK )
  2037. return ;
  2038. CArray<CStringArray, CStringArray> Arydindan;
  2039. CArray<CStringArray, CStringArray> Arydindansp;
  2040. CArray<CStringArray, CStringArray> Arydindansp2;
  2041. DataToArray( &Arydindansp, &Arydindan, &Arydindansp2 );
  2042. CString strTemp = _T("");
  2043. CStringArray AryImgNums;
  2044. CStringArray AryPerImgGoods;
  2045. // 获取所有dindansp记录no2字段中的相片编号;
  2046. int i = 0;
  2047. int nSize = Arydindansp.GetSize();
  2048. for ( i = 0; i < nSize; i++)
  2049. {
  2050. strTemp = Arydindansp.ElementAt(i).ElementAt(8); // dindansp表中的no2字段;
  2051. GetNo(strTemp, AryImgNums);
  2052. }
  2053. // 获取每张相片编号对应的商品,每个商品间用分号隔开;
  2054. nSize = AryImgNums.GetSize();
  2055. AryPerImgGoods.SetSize(nSize);
  2056. for ( i = 0; i < nSize; i++ )
  2057. {
  2058. strTemp = AryImgNums.ElementAt(i);
  2059. AryPerImgGoods.SetAt(i, GetSelName(strTemp, Arydindansp));
  2060. }
  2061. // 由于VC6.0传CStringArray给VC9.0DLL 时,会产生无法避免的兼容性问题,故使用CString传;
  2062. CString strImgNums = _T("");
  2063. for ( i = 0; i < AryImgNums.GetSize(); i++ )
  2064. {
  2065. strImgNums += AryImgNums.ElementAt(i);
  2066. strImgNums += _T("?|?");
  2067. }
  2068. CString strPerImgGoods = _T("");
  2069. for ( i = 0; i < AryPerImgGoods.GetSize(); i++ )
  2070. {// 商品名称,应该禁止包含非法字符;
  2071. strPerImgGoods += AryPerImgGoods.ElementAt(i);
  2072. strPerImgGoods += _T("?|?");
  2073. }
  2074. // 保存导出相片的路径;
  2075. CString strSaveDirectory = _T("");
  2076. ImgExportInterface *pExport = NULL;
  2077. if ( g_pIMGProcess == NULL )
  2078. {
  2079. return ;
  2080. }
  2081. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  2082. if ( pExport )
  2083. {// 导出选好的片;
  2084. pExport->ExportSelectedDesignImg(
  2085. strBranchId,
  2086. strOrderNum,
  2087. strCustomerInfo,
  2088. !strScenery.IsEmpty(),
  2089. strScenery,
  2090. _T("*.jpg|*.jpeg"),
  2091. INVALID_COPY_PIX,
  2092. _T("*.nef|*.cr2|*.raw|"),
  2093. FALSE,
  2094. IsGrowthtxdlg.m_bGrowthTx,
  2095. strImgNums,
  2096. strPerImgGoods,
  2097. Arydindan.ElementAt(0).ElementAt(60)
  2098. );
  2099. pExport->Release();
  2100. OutputDebugString(_T("导出设计好的片!\n"));
  2101. }
  2102. // 结束;
  2103. #else
  2104. if (IsHasRights2new(12) == 0)return;
  2105. UpdateData();
  2106. POSITION pos;
  2107. pos = m_List1.GetFirstSelectedItemPosition();
  2108. if (pos == NULL)
  2109. {
  2110. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  2111. return;
  2112. }
  2113. int iItem = m_List1.GetNextSelectedItem(pos);
  2114. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  2115. CString branch;
  2116. if (g_bAllBranch)
  2117. branch = m_List1.GetItemText(iItem, 0);
  2118. CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
  2119. CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
  2120. #ifdef CHILD_VERSION
  2121. CString filter = "id='" + id + "';id='" + id + "';id='" + id + "' and name<>'入册' and name<>'入底'";
  2122. #else
  2123. CString filter = "id='" + id + "';id='" + id + "';id='" + id + "' and kind<>'2' and name<>'入册' and name<>'入底'";
  2124. #endif
  2125. g_sendhead.bsql = 0;
  2126. g_sendhead.code[0] = 50;
  2127. g_sendhead.code[1] = 11;
  2128. g_sendhead.code[2] = 56;
  2129. g_sendhead.tabcount = 3;
  2130. if (g_bAllBranch)
  2131. {
  2132. g_branchip = GetIP(branch);
  2133. g_pMainWnd->OnDisconnect();
  2134. g_branchname = branch;
  2135. g_bBranchModify = 1;
  2136. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2137. g_pMainWnd->OnDisconnect();
  2138. g_bBranchModify = 0;
  2139. g_branchip = g_branchname = "";
  2140. }
  2141. else
  2142. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2143. if (g_bSendOK == 0)return;
  2144. CArray<CStringArray, CStringArray>sparray;
  2145. CArray<CStringArray, CStringArray>sparray2;
  2146. DataToArray(&sparray, &g_List1array, &sparray2);
  2147. CString path;
  2148. if (g_bAllBranch)
  2149. {
  2150. CString branchpath = GetBranchPhotoPath(branch);
  2151. path = g_path3 + branchpath + "\\";
  2152. }
  2153. else
  2154. path = g_path3 + "\\";
  2155. path += id;
  2156. path += "\\";
  2157. ////////////////////////////////////////
  2158. CString str, spname;
  2159. CStringArray noarray;
  2160. CStringArray spnamearray;
  2161. int i = 0;
  2162. for ( i = 0; i < sparray.GetSize(); i++)
  2163. {
  2164. str = sparray.ElementAt(i).ElementAt(8);
  2165. spname = sparray.ElementAt(i).ElementAt(5);
  2166. GetNo(str, noarray);
  2167. }
  2168. if (noarray.GetSize() == 0)
  2169. {
  2170. AfxMessageBox("此单未选设计版!", MB_ICONINFORMATION);
  2171. return;
  2172. }
  2173. spnamearray.SetSize(noarray.GetSize());
  2174. for (i = 0; i < noarray.GetSize(); i++)
  2175. {
  2176. str = noarray.ElementAt(i);
  2177. spnamearray.SetAt(i, GetSelName2(str, sparray));
  2178. }
  2179. CString dir;
  2180. GetSavePath(dir);
  2181. if (dir.IsEmpty())return;
  2182. dir.TrimRight('\\');
  2183. dir += "\\";
  2184. dir += id;
  2185. dir += g_branchname;
  2186. if (g_bAllBranch)
  2187. {
  2188. if (GetBranchPhotoPath(branch) != "")
  2189. dir += branch;
  2190. }
  2191. dir += name1;
  2192. dir += name2;
  2193. dir += "选设计";
  2194. dir += "\\";
  2195. CStringArray array;
  2196. CStringArray spnamearray2;
  2197. CString src, des;
  2198. for (i = 0; i < noarray.GetSize(); i++)
  2199. {
  2200. src.Format("%s%s.jpg", path, noarray.ElementAt(i));
  2201. if (PathFileExists(src))
  2202. {
  2203. array.Add(src);
  2204. src = spnamearray.ElementAt(i);
  2205. spnamearray2.Add(spnamearray.ElementAt(i));
  2206. }
  2207. else
  2208. AfxMessageBox("未找到设计版:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
  2209. }
  2210. ::CreateDirectory(dir, NULL);
  2211. //----------------------------------------------------------------------------------------------
  2212. //----------------------------------------------------------------------------------------------
  2213. // 导出选设计的片;
  2214. //----------------------------------------------------------------------------------------------
  2215. //----------------------------------------------------------------------------------------------
  2216. ImportPhoto dlg;
  2217. dlg.m_mode = 1; // 1.未知;
  2218. dlg.m_bOrigin = 1; // 2.未知;
  2219. dlg.m_pArray = &array; // 3.作为导出源的选好的设计片路径集合;
  2220. dlg.m_pArray2 = &spnamearray2; // 4.作为导出目标的选好的设计片路径集合;
  2221. dlg.m_savepath = dir; // 5.保存选好的设计片的目录;
  2222. dlg.DoModal();
  2223. //////////////
  2224. if (g_List1array.GetSize())
  2225. {
  2226. CStdioFile fp;
  2227. fp.Open(dir + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
  2228. fp.WriteString("选设计要求:\n");
  2229. fp.WriteString(g_List1array.ElementAt(0).ElementAt(57));
  2230. fp.WriteString("\n");
  2231. fp.WriteString("\n");
  2232. fp.WriteString("设计版替换照片:\n");
  2233. CString replace = g_List1array.ElementAt(0).ElementAt(59);
  2234. if (!replace.IsEmpty())
  2235. {
  2236. replace.Delete(0, 1);
  2237. replace.Replace("$", "\n");
  2238. }
  2239. fp.WriteString(replace);
  2240. fp.WriteString("\n");
  2241. fp.WriteString("\n");
  2242. fp.WriteString("订单要求:\n");
  2243. fp.WriteString(g_List1array.ElementAt(0).ElementAt(38));
  2244. fp.WriteString("\n");
  2245. fp.WriteString("\n");
  2246. fp.WriteString("客人产品:\n");
  2247. CString str;
  2248. str = "产品名称";
  2249. FillLength(str, 20);
  2250. str += "数量";
  2251. FillLength(str, 30);
  2252. str += "加急";
  2253. FillLength(str, 40);
  2254. str += "取件日期";
  2255. FillLength(str, 50);
  2256. fp.WriteString(str);
  2257. fp.WriteString("\n");
  2258. for (int i = 0; i < sparray2.GetSize(); i++)
  2259. {
  2260. str.Empty();
  2261. str = sparray2.ElementAt(i).ElementAt(0);
  2262. FillLength(str, 20);
  2263. str += sparray2.ElementAt(i).ElementAt(1);
  2264. FillLength(str, 30);
  2265. str += sparray2.ElementAt(i).ElementAt(18);
  2266. FillLength(str, 40);
  2267. str += sparray2.ElementAt(i).ElementAt(19);
  2268. FillLength(str, 50);
  2269. fp.WriteString(str);
  2270. fp.WriteString("\n");
  2271. }
  2272. fp.Close();
  2273. }
  2274. //////////////
  2275. AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  2276. // CString str;
  2277. str = " 导出选设计片 ";
  2278. str += "客人:";
  2279. str += name1 + name2 + id;
  2280. WriteLog(_T("导出选设计片"), str);
  2281. #endif
  2282. }
  2283. void DesignFrom::HidePrice()
  2284. {
  2285. #ifdef LKAY_VERSION
  2286. if (IsHasRights2new(31))return;
  2287. for (int i = 0; i < m_List1array.GetSize(); i++)
  2288. {
  2289. m_List1array.ElementAt(i).SetAt(14 + m_nAdd, "***");
  2290. m_List1array.ElementAt(i).SetAt(15 + m_nAdd, "***");
  2291. m_List1array.ElementAt(i).SetAt(16 + m_nAdd, "***");
  2292. m_List1array.ElementAt(i).SetAt(17 + m_nAdd, "***");
  2293. }
  2294. #else
  2295. if (IsHasRights2new(31))return;
  2296. for (int i = 0; i < m_List1array.GetSize(); i++)
  2297. {
  2298. m_List1array.ElementAt(i).SetAt(17 + m_nAdd, "***");
  2299. m_List1array.ElementAt(i).SetAt(18 + m_nAdd, "***");
  2300. }
  2301. #endif
  2302. }
  2303. void DesignFrom::OnBtnsearchfilter() // 条件查询 按钮;
  2304. {
  2305. SearchFilter dlg;
  2306. dlg.m_mode = 5;
  2307. if (dlg.DoModal() == IDOK)FillGrid();
  2308. g_bSearchFilter = 0;
  2309. }
  2310. void DesignFrom::GetData()
  2311. {
  2312. if (g_bAllBranch == 0)
  2313. {
  2314. if (g_bShowOK == 0)
  2315. {
  2316. #ifdef LKAY_VERSION
  2317. CString filter = "status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  2318. #else
  2319. CString filter = "status3='未取'";
  2320. #endif
  2321. g_sendhead.bsql = 0;
  2322. g_sendhead.code[0] = 31;
  2323. g_sendhead.tabcount = 1;
  2324. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2325. if (g_bSendOK == 0)return;
  2326. }
  2327. else
  2328. {
  2329. g_sendhead.bsql = 0;
  2330. g_sendhead.code[0] = 31;
  2331. g_sendhead.tabcount = 1;
  2332. #ifdef LKAY_VERSION
  2333. CString filter = "dindantype<>'意向客户' or dindantype is null";
  2334. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2335. #else
  2336. g_pMainWnd->ProcessChatMessageRequest2(1);
  2337. #endif
  2338. if (g_bSendOK == 0)return;
  2339. }
  2340. DataToArray(&m_List1array);
  2341. }
  2342. else
  2343. {
  2344. //////////////数据汇总
  2345. m_List1array.RemoveAll();
  2346. CString branch;
  2347. for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
  2348. {
  2349. if (i != -1)
  2350. {
  2351. branch = g_brancharray.ElementAt(i).ElementAt(0);
  2352. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  2353. g_pMainWnd->OnDisconnect();
  2354. g_branchname = branch;
  2355. g_bBranchModify = 1;
  2356. }
  2357. else
  2358. branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
  2359. if (g_bShowOK == 0)
  2360. {
  2361. CString filter = "status3='未取'";
  2362. g_sendhead.bsql = 0;
  2363. g_sendhead.code[0] = 31;
  2364. g_sendhead.tabcount = 1;
  2365. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2366. if (g_bSendOK == 0)continue;
  2367. }
  2368. else
  2369. {
  2370. g_sendhead.bsql = 0;
  2371. g_sendhead.code[0] = 31;
  2372. g_sendhead.tabcount = 1;
  2373. g_pMainWnd->ProcessChatMessageRequest2(1);
  2374. if (g_bSendOK == 0)continue;
  2375. }
  2376. CArray<CStringArray, CStringArray>List1array;
  2377. DataToArray(&List1array);
  2378. int size = m_List1array.GetSize();
  2379. for (int j = 0; j < List1array.GetSize(); j++)
  2380. {
  2381. size++;
  2382. m_List1array.SetSize(size, 1);
  2383. size--;
  2384. m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
  2385. m_List1array.ElementAt(size).InsertAt(0, branch);
  2386. size++;
  2387. }
  2388. }
  2389. g_pMainWnd->OnDisconnect();
  2390. g_bBranchModify = 0;
  2391. g_branchip = g_branchname = "";
  2392. }
  2393. m_List1arraybak.SetSize(m_List1array.GetSize(), 1);
  2394. for (int ii = 0; ii < m_List1array.GetSize(); ii++)
  2395. {
  2396. m_List1arraybak.ElementAt(ii).Copy(m_List1array.ElementAt(ii));
  2397. // 设计要求;原列10
  2398. if (m_List1array.ElementAt(ii).ElementAt(11).GetLength() > 256)
  2399. {
  2400. m_List1array.ElementAt(ii).SetAt(11, m_List1array.ElementAt(ii).ElementAt(11).Left(256) + "...");
  2401. }
  2402. }
  2403. HidePrice();
  2404. FillGrid();
  2405. }
  2406. void DesignFrom::OnBUTprint3() // 更新数据 按钮;
  2407. {
  2408. GetData();
  2409. }
  2410. void DesignFrom::OnBnClickedCloundxy() // 云选样;
  2411. {
  2412. // TODO: 在此添加控件通知处理程序代码
  2413. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  2414. if ( pos == NULL)
  2415. {
  2416. AfxMessageBox(_T("请选中要使用云选片的订单!"));
  2417. return ;
  2418. }
  2419. INT nItem = m_List1.GetNextSelectedItem(pos);
  2420. CString strOrderNum = _T("");
  2421. CString strScenery = _T("");
  2422. CString strCustomerName = _T("");
  2423. CString strCustomerTel = _T("");
  2424. CString strStudioName = _T("");
  2425. CString strStudioTel = _T("");
  2426. CString strUniqueId = _T("");
  2427. CString strClounSite = _T("");
  2428. CString strTemp;
  2429. strOrderNum = m_List1.GetItemText(nItem, 0);
  2430. strCustomerName.Format(_T("%s,%s"), m_List1.GetItemText(nItem, m_nAdd + 1), m_List1.GetItemText(nItem, m_nAdd + 2));
  2431. strCustomerTel.Format(_T("%s,%s"), m_List1.GetItemText(nItem, m_nAdd + 17), m_List1.GetItemText(nItem,m_nAdd + 18));
  2432. strStudioName = g_cominfoarray.ElementAt(0).ElementAt(10);
  2433. strStudioTel = g_cominfoarray.ElementAt(0).ElementAt(11);
  2434. strClounSite = m_List1.m_arLabels.ElementAt(nItem).ElementAt(21);
  2435. INT nIndex = 0;
  2436. strTemp = g_branchname.IsEmpty() ? g_domain : g_branchname;
  2437. if ( ( nIndex = strTemp.Find(_T(".ly.com"))) == -1)
  2438. {
  2439. AfxMessageBox(_T("域名无效!"));
  2440. return;
  2441. }
  2442. strTemp = strTemp.Left(nIndex);
  2443. strTemp = strTemp.Right(6);
  2444. strUniqueId.Format(_T("%s_A_%s_1"), strTemp, strOrderNum);
  2445. if ( lyfzLibrary::LoadCloudSelectionLib() )
  2446. {
  2447. CDlgCloudSelection dlg;
  2448. dlg.SetParamters(1, strUniqueId, g_branchname.IsEmpty() ? g_domain : g_branchname, strStudioName, strStudioTel, strOrderNum,strScenery, m_List1.GetItemText(nItem, m_nAdd + 1),m_List1.GetItemText(nItem, m_nAdd + 2), m_List1.GetItemText(nItem, m_nAdd + 17),m_List1.GetItemText(nItem, m_nAdd + 18), strClounSite);
  2449. dlg.DoModal();
  2450. lyfzLibrary::FreeCloudSelectionLib();
  2451. }
  2452. else
  2453. {
  2454. AfxMessageBox(_T("加载云选片失败,请检查模块文件是否在客户目录下!"));
  2455. }
  2456. }
  2457. void DesignFrom::OnBnClickedResult() // 获取选样结果;
  2458. {
  2459. // TODO: 在此添加控件通知处理程序代码
  2460. CDlgCloundResult dlg;
  2461. dlg.m_pList = &m_List1;
  2462. dlg.m_nAdd = m_nAdd;
  2463. dlg.m_nCloundType = 1;
  2464. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  2465. if ( pos != NULL )
  2466. {
  2467. INT nItem = m_List1.GetNextSelectedItem(pos);
  2468. dlg.m_nSelItem = nItem;
  2469. }
  2470. dlg.DoModal();
  2471. }