DesignFrom.cpp 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702
  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. WriteOptLog(_T("导出精修,订单号:%s"),strOrderNum);
  731. // 结束;
  732. #else
  733. if (IsHasRights2new(11) == 0)return;
  734. POSITION pos;
  735. pos = m_List1.GetFirstSelectedItemPosition();
  736. if (pos == NULL)
  737. {
  738. AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
  739. return;
  740. }
  741. int iItem = m_List1.GetNextSelectedItem(pos);
  742. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  743. CString branch;
  744. if (g_bAllBranch)
  745. branch = m_List1.GetItemText(iItem, 0);
  746. CString path;
  747. if (g_bAllBranch)
  748. {
  749. CString branchpath = GetBranchPhotoPath(branch);
  750. path = g_path4 + branchpath + "\\";
  751. }
  752. else
  753. path = g_path4 + "\\";
  754. path += id;
  755. path += "\\";
  756. CStringArray array;
  757. CString dir;
  758. GetSavePath(dir);
  759. if (dir.IsEmpty())
  760. {
  761. return;
  762. }
  763. CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
  764. CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
  765. dir.TrimRight('\\');
  766. dir += "\\";
  767. dir += id;
  768. dir += g_branchname;
  769. if (g_bAllBranch)
  770. {
  771. if (GetBranchPhotoPath(branch) != "")
  772. dir += branch;
  773. }
  774. dir += name1;
  775. dir += name2;
  776. dir += "精修好的片";
  777. dir += "\\";
  778. ::CreateDirectory(dir, NULL);
  779. CStringArray desarray;
  780. CStringArray dirarray;
  781. CString savepath = dir;
  782. CString str;
  783. if (1)
  784. {
  785. using namespace helper_coffs;
  786. ffsco o;
  787. o.dirs(1);
  788. o.find(LPCSTR(path), LPCSTR("*.*"));
  789. ffsco::typeT coo;
  790. ffsco::typeT::iterator it;
  791. coo = o.co_dir();
  792. for (it = coo.begin(); coo.end() != it; it++)
  793. {
  794. str = (*it).c_str();
  795. if (FindArray(&dirarray, str) == -1)
  796. {
  797. dirarray.Add(str);
  798. if (str != dirarray.ElementAt(0))
  799. {
  800. str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
  801. if (::CheckFolderFileExist(str) == 0)
  802. ::CreateDirectory(str, NULL);
  803. }
  804. }
  805. }
  806. }
  807. if (1)
  808. {
  809. for (int i = 0; i < dirarray.GetSize(); i++)
  810. {
  811. using namespace helper_coffs;
  812. ffsco o;
  813. o.dirs(0);
  814. o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
  815. ffsco::typeT coo;
  816. ffsco::typeT::iterator it;
  817. coo = o.co_file();
  818. for (it = coo.begin(); coo.end() != it; it++)
  819. {
  820. str = (*it).c_str();
  821. if (str.GetAt(str.ReverseFind('\\') + 1) == 's')continue;
  822. if (str.GetAt(str.ReverseFind('\\') + 1) == 'm')continue;
  823. array.Add(str);
  824. desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
  825. }
  826. }
  827. }
  828. if (array.GetSize() == 0)
  829. {
  830. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  831. return;
  832. }
  833. CCompressOption comoptdlg;
  834. comoptdlg.DoModal();
  835. //----------------------------------------------------------------------------------------------
  836. //----------------------------------------------------------------------------------------------
  837. // 导出精修好片;
  838. //----------------------------------------------------------------------------------------------
  839. //----------------------------------------------------------------------------------------------
  840. ImportPhoto dlg;
  841. dlg.m_nOutputSize = comoptdlg.m_nsize; // 1.导出精修片时的尺寸;
  842. dlg.m_mode = 1; // 2.未知;
  843. dlg.m_pArray = &array; // 3.作为导出源的精修片路径集合;
  844. dlg.m_pDesArray = &desarray; // 4.作为导出目标的精修片路径集合;
  845. dlg.m_savepath = dir; // 5.保存导出精修片的目录;
  846. dlg.DoModal();
  847. AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  848. // CString str;
  849. str = " 导出精修片 ";
  850. str += "客人:";
  851. str += name1 + name2 + id;
  852. WriteLog(_T("导出精修好片"), str);
  853. {
  854. ShowCut dlg;
  855. dlg.m_branch = branch;
  856. dlg.m_mode = 1;
  857. dlg.m_strOrderNum = id;
  858. dlg.DoModal();
  859. }
  860. #endif
  861. }
  862. void DesignFrom::OnBUTimportphoto() // 导入设计版/N8选版 按钮;
  863. {
  864. #ifdef USE_KERNEL_DLL
  865. // 获取列表信息;
  866. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  867. if ( pos == NULL )
  868. {
  869. AfxMessageBox(_T("请选中您要导片的订单号!"), MB_ICONINFORMATION);
  870. return;
  871. }
  872. INT nItemCount = m_List1.GetItemCount();
  873. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  874. // 订单的设计信息店名、域名、订单号、景点名、顾客信息、设计状态、设计日期、设计师;
  875. CString strBranchName = _T("");
  876. CString strBranchId = _T("");
  877. CString strOrderNum = _T("");
  878. CString strScenery = _T("");
  879. CString strCustomerInfo = _T("");
  880. CString strDesignState = _T("");
  881. CString strDesignDate = _T("");
  882. CString strDesigner = _T("");
  883. // 获取域名;
  884. if ( g_bAllBranch )
  885. {// 多店汇总时;
  886. strBranchName = m_List1.GetItemText(nSelectedItem, 0);
  887. strBranchId = GetDomainFromBranch( strBranchName );
  888. }
  889. else
  890. {
  891. if ( g_branchname.IsEmpty() )
  892. {// 连接本店时;
  893. strBranchName = _T("");
  894. strBranchId = g_domain;
  895. }
  896. else
  897. {// 连接分店时;
  898. strBranchName = g_branchname;
  899. strBranchId = GetDomainFromBranch( g_branchname );
  900. }
  901. }
  902. // 获取订单号;
  903. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  904. // 获取设计师;
  905. strDesigner = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  906. // 获取设计状态;
  907. strDesignState = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  908. // 获取设计日期;
  909. strDesignDate = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  910. // 获取顾客信息;
  911. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  912. CDlgChuXiuInfo xpdlg;
  913. xpdlg.m_nXiupianMode = 1;
  914. xpdlg.m_strOrderNumber = strOrderNum;
  915. xpdlg.m_strXiupianRen = strDesigner;
  916. if ( strDesignState == _T("OK") )
  917. xpdlg.m_nXiupianStatus = 0;
  918. else if ( strDesignState == _T("设计中"))
  919. xpdlg.m_nXiupianStatus = 1;
  920. else if ( strDesignState == _T("未设计"))
  921. xpdlg.m_nXiupianStatus = 2;
  922. CString strSQL = _T("");
  923. if( xpdlg.DoModal() == IDOK )
  924. {
  925. if ( xpdlg.m_bGrowthTx )
  926. strScenery = xpdlg.m_strScenery;
  927. if ( xpdlg.m_nXiupianStatus == 0 )
  928. strDesignState = _T("OK");
  929. else if ( xpdlg.m_nXiupianStatus == 1)
  930. strDesignState = _T("设计中");
  931. else if ( xpdlg.m_nXiupianStatus == 2 )
  932. strDesignState = _T("未设计");
  933. strDesigner = xpdlg.m_strXiupianRen;
  934. if (strDesignDate.IsEmpty())
  935. strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s', time10 = '%s' where id = '%s'"), strDesigner, strDesignState, g_date, strOrderNum);
  936. else
  937. strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s' where id = '%s'"), strDesigner, strDesignState, strOrderNum);
  938. /////////////////////////////////////////////////////////////////////////////////////////////////
  939. // 构建数据包;
  940. g_sendhead.bsql = TRUE;
  941. if ( g_bAllBranch )
  942. {// 多店汇总时;
  943. g_branchip = GetBranchIPbyId(strBranchId);
  944. g_pMainWnd->OnDisconnect();
  945. g_branchname = strBranchName;
  946. g_bBranchModify = TRUE;
  947. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  948. g_pMainWnd->OnDisconnect();
  949. g_bBranchModify = FALSE;
  950. g_branchip = g_branchname = _T("");
  951. }
  952. else
  953. {// 连接本店或分店时;
  954. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  955. }
  956. // 刷新界面数据;
  957. if (g_bSendOK == 0)
  958. {
  959. OutputDebugString(_T("接收服务器数据失败!\n"));
  960. return;
  961. }
  962. if (g_bAllBranch == 0)
  963. {// 连接本店或分店时;
  964. GetData();
  965. }
  966. else
  967. {// 多店汇总时;
  968. for (int i = 0; i < m_List1array.GetSize(); i++)
  969. {
  970. if (strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0))
  971. {
  972. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, strDesignState);
  973. if (strDesignDate.IsEmpty())
  974. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  975. m_List1array.ElementAt(i).SetAt(14 + m_nAdd, strDesigner);
  976. FillGrid();
  977. break;
  978. }
  979. }
  980. }
  981. }
  982. else
  983. {
  984. // 开始导入初修片;
  985. if ( MessageBox(_T("是否现在开始导入设计片!"), _T("导片提示:导入设计片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
  986. {// 是否马上导入相片;
  987. return;
  988. }
  989. if ( xpdlg.m_bGrowthTx )
  990. strScenery = xpdlg.m_strScenery;
  991. if ( xpdlg.m_bGrowthTx && strScenery.IsEmpty() )
  992. {
  993. AfxMessageBox(_T("儿童成长套系导片必须选择套系名!"));
  994. return;
  995. }
  996. }
  997. /////////////////////////////////////////////////////////////////////////////////////////////////
  998. if ( g_pIMGProcess == NULL )
  999. {
  1000. return;
  1001. }
  1002. // 获取完信息,开始导入设计片;
  1003. ImgImportInterface *pImport = NULL;
  1004. g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  1005. if ( pImport )
  1006. {
  1007. if ( m_bN8 && PathFileExists(g_szN8Path) )
  1008. {// N8选版功能启用;
  1009. pImport->ImportN8(g_szN8ViewUserDir, strBranchId, strOrderNum, strCustomerInfo, !strScenery.IsEmpty(), strScenery, FALSE);
  1010. WriteOptLog(_T("导入N8,订单号:%s"),strOrderNum);
  1011. }
  1012. else
  1013. {
  1014. pImport->ImportDesignImg(
  1015. FALSE, // 相片源的类型:true = 选择文件夹形式; false = 选择文件形式;
  1016. strBranchId, // 分店域名;
  1017. strOrderNum, // 订单号;
  1018. strCustomerInfo, // 顾客信息;
  1019. !strScenery.IsEmpty(), // 导入时是否生成景点名;
  1020. strScenery, // 要导入并生成的景点名;
  1021. _T("*.jpg|*.jpeg"), // 要导入的扩展名;
  1022. INVALID_COPY_PIX, // 要导入的相片的压缩像素大小;INVALID_COPY_PIX表示不压缩,原比例导入;
  1023. _T("*.nef|*.cr2|*.raw|*.ra2"), // 导入相片时,附加要导入的扩展名;附加的相片不设置压缩像素;
  1024. FALSE, // 导入操作时,是否生成缩略图;只生成lpImportExt的;
  1025. INVALID_COPY_PIX, // 要生成的缩略图的像素大小;
  1026. FALSE // 目标文件存在是否复制,只针对lpImportExt和lpImportWithExt对应的文件,缩略图直接覆盖;
  1027. );
  1028. WriteOptLog(_T("导入设计,订单号:%s"),strOrderNum);
  1029. }
  1030. g_pIMGProcess->Release();
  1031. }
  1032. // 结束;
  1033. #else
  1034. POSITION pos;
  1035. pos = m_List1.GetFirstSelectedItemPosition();
  1036. if (pos == NULL)
  1037. {
  1038. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  1039. return;
  1040. }
  1041. int iItem = m_List1.GetNextSelectedItem(pos);
  1042. CString branch;
  1043. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1044. if (g_bAllBranch)
  1045. branch = m_List1.GetItemText(iItem, 0);
  1046. // 原本4,5,改为5,6
  1047. CString oldstatus = m_List1.GetItemText(iItem, 5 + m_nAdd);
  1048. CString time10 = m_List1.GetItemText(iItem, 6 + m_nAdd);
  1049. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1050. name.TrimLeft(",");
  1051. name.TrimRight(",");
  1052. name = "客人:" + name;
  1053. CString phone = m_List1.GetItemText(iItem, 16 + m_nAdd) + "," + m_List1.GetItemText(iItem, 17 + m_nAdd);
  1054. phone.TrimLeft(",");
  1055. phone.TrimRight(",");
  1056. phone = "电话:" + phone;
  1057. CString strDomain = _T("");
  1058. CString savepath = _T("");
  1059. if (g_bAllBranch)
  1060. strDomain = GetDomainFromBranch(branch);
  1061. else
  1062. {
  1063. if(g_branchname != _T(""))
  1064. strDomain = GetDomainFromBranch(g_branchname);
  1065. }
  1066. //////////////////////////////////////////////////////////////////////////
  1067. // 获取可用的共享目录;
  1068. #if USE_SHARE_FLORD
  1069. TCHAR szSharePath[MAX_PATH] = {0};
  1070. if ( CNetShareInfo::GetInstance()->GetEnableShareDirectory(4, id, strDomain, szSharePath) )
  1071. {
  1072. savepath.Format("%s\\",szSharePath);
  1073. }
  1074. else
  1075. {
  1076. AfxMessageBox(_T("没有可用的共享目录!"));
  1077. return;
  1078. }
  1079. #else
  1080. savepath += id + "\\";
  1081. #endif //#if USE_SHARE_FLORD
  1082. if (::CheckFolderFileExist(savepath) == 0)
  1083. ::CreateDirectory(savepath, NULL);
  1084. /* IsGrowthTx growthtxdlg;
  1085. growthtxdlg.m_id=id;
  1086. growthtxdlg.DoModal ();
  1087. if(growthtxdlg.m_bReturnOK==0)
  1088. return;
  1089. if(growthtxdlg.m_bGrowthTx && growthtxdlg.m_seltxname.IsEmpty ())
  1090. return;
  1091. if(!growthtxdlg.m_seltxname.IsEmpty ())
  1092. {
  1093. savepath+=growthtxdlg.m_seltxname+"\\";
  1094. if(::CheckFolderFileExist (savepath)==0)
  1095. ::CreateDirectory (savepath, NULL);
  1096. }*/
  1097. CString srcdir; CString str;
  1098. GetSavePath(srcdir);
  1099. if (srcdir.IsEmpty())
  1100. {
  1101. CString status5;
  1102. if (AfxMessageBox("客照是否全部设计完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
  1103. status5 = "OK";
  1104. else
  1105. status5 = "设计中";
  1106. CString sql;
  1107. if (time10.IsEmpty())
  1108. sql = "update dindan set status5='" + status5 + "',time10='" + g_date + "' where id='" + id + "'";
  1109. else
  1110. sql = "update dindan set status5='" + status5 + "' where id='" + id + "'";
  1111. g_sendhead.bsql = 1;
  1112. if (g_bAllBranch)
  1113. {
  1114. g_branchip = GetIP(branch);
  1115. g_pMainWnd->OnDisconnect();
  1116. g_branchname = branch;
  1117. g_bBranchModify = 1;
  1118. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1119. g_pMainWnd->OnDisconnect();
  1120. g_bBranchModify = 0;
  1121. g_branchip = g_branchname = "";
  1122. }
  1123. else
  1124. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1125. if (g_bSendOK == 0)return;
  1126. if (g_bAllBranch == 0)
  1127. {
  1128. GetData();
  1129. }
  1130. else
  1131. {
  1132. for (int i = 0; i < m_List1array.GetSize(); i++)
  1133. {
  1134. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1135. {
  1136. m_List1array.ElementAt(i).SetAt(4 + m_nAdd, status5);
  1137. if (time10.IsEmpty())
  1138. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date);
  1139. FillGrid();
  1140. break;
  1141. }
  1142. }
  1143. }
  1144. return;
  1145. }
  1146. if (srcdir.GetLength() < 4)
  1147. {
  1148. AfxMessageBox("请选择正确的您文件所在的目录!", MB_ICONSTOP);
  1149. return;
  1150. }
  1151. if (oldstatus != "未设计")
  1152. {
  1153. CString str;
  1154. str.Format("%s\r\n%s\r\n此单已导入过设计片, 确认您选中的照片没有导入过吗? 否则会覆盖原来的照片, 是否继续?", name, phone);
  1155. if (AfxMessageBox(str, MB_YESNO | MB_ICONSTOP) != IDYES)
  1156. return;
  1157. }
  1158. else
  1159. {
  1160. CString str;
  1161. str.Format("%s\r\n%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone);
  1162. if (AfxMessageBox(str, MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1163. return;
  1164. }
  1165. CStringArray array;
  1166. CStringArray desarray;
  1167. CStringArray dirarray;
  1168. if (1)
  1169. {
  1170. // 1.获取源目录下的所有子目录;
  1171. using namespace helper_coffs;
  1172. ffsco o;
  1173. o.dirs(1);
  1174. o.find(LPCSTR(srcdir), LPCSTR("*.*"));
  1175. ffsco::typeT coo;
  1176. ffsco::typeT::iterator it;
  1177. coo = o.co_dir();
  1178. for (it = coo.begin(); coo.end() != it; it++)
  1179. {
  1180. str = (*it).c_str();
  1181. if (FindArray(&dirarray, str) == -1)
  1182. {
  1183. dirarray.Add(str);
  1184. if (str != dirarray.ElementAt(0))
  1185. {
  1186. str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
  1187. if (::CheckFolderFileExist(str) == 0)
  1188. ::CreateDirectory(str, NULL);
  1189. }
  1190. }
  1191. }
  1192. }
  1193. if (1)
  1194. {
  1195. // 2.从每个子目录下查找所有的相片;
  1196. for (int i = 0; i < dirarray.GetSize(); i++)
  1197. {
  1198. using namespace helper_coffs;
  1199. ffsco o;
  1200. o.dirs(0);
  1201. o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
  1202. ffsco::typeT coo;
  1203. ffsco::typeT::iterator it;
  1204. coo = o.co_file();
  1205. for (it = coo.begin(); coo.end() != it; it++)
  1206. {
  1207. str = (*it).c_str();
  1208. array.Add(str);
  1209. desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
  1210. }
  1211. }
  1212. }
  1213. if (array.GetSize() == 0)return;
  1214. //----------------------------------------------------------------------------------------------
  1215. //----------------------------------------------------------------------------------------------
  1216. // 导入设计的片;
  1217. //----------------------------------------------------------------------------------------------
  1218. //----------------------------------------------------------------------------------------------
  1219. ImportPhoto dlg;
  1220. dlg.m_branch = branch; // 1.订单分店名;
  1221. dlg.m_nphototype = 3; // 2.未知;
  1222. dlg.m_pArray = &array; // 3.作为源的设计片路径集合;
  1223. dlg.m_pDesArray = &desarray; // 4.作为目标的设计片路径集合;
  1224. dlg.m_savepath = savepath; // 5.导出时的保存目录;
  1225. #ifdef ENTERPRISE_VERSION
  1226. // if(!g_branchname.IsEmpty ())
  1227. {
  1228. dlg.m_bSaveUploadTask = g_bSaveUploadTask4;
  1229. dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(81);
  1230. dlg.m_uploadtaskarray.Add(id + ";" + name);
  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. dlg.m_uploadtaskarray.Add("");
  1238. dlg.m_uploadtaskarray.Add("");
  1239. dlg.m_uploadtaskarray.Add("");
  1240. }
  1241. #endif
  1242. dlg.DoModal();
  1243. CString status5;
  1244. if (AfxMessageBox("客照是否全部设计完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
  1245. status5 = "OK";
  1246. else
  1247. status5 = "设计中";
  1248. CString sql;
  1249. if (time10.IsEmpty())
  1250. sql = "update dindan set status5='" + status5 + "',waiter4='" + g_user.name + "',time10='" + g_date + "' where id='" + id + "'";
  1251. else
  1252. sql = "update dindan set status5='" + status5 + "',waiter4='" + g_user.name + "' where id='" + id + "'";
  1253. g_sendhead.bsql = 1;
  1254. if (g_bAllBranch)
  1255. {
  1256. g_branchip = GetIP(branch);
  1257. g_pMainWnd->OnDisconnect();
  1258. g_branchname = branch;
  1259. g_bBranchModify = 1;
  1260. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1261. g_pMainWnd->OnDisconnect();
  1262. g_bBranchModify = 0;
  1263. g_branchip = g_branchname = "";
  1264. }
  1265. else
  1266. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1267. if (g_bSendOK == 0)return;
  1268. savepath += "ok";
  1269. ::DeleteFile(savepath); // 删除ok文件;
  1270. AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
  1271. if (g_bAllBranch == 0)
  1272. {
  1273. GetData();
  1274. }
  1275. else
  1276. {
  1277. for (int i = 0; i < m_List1array.GetSize(); i++)
  1278. {
  1279. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1280. {
  1281. m_List1array.ElementAt(i).SetAt(4 + m_nAdd, status5);
  1282. if (time10.IsEmpty())
  1283. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date);
  1284. m_List1array.ElementAt(i).SetAt(13 + m_nAdd, g_user.name);
  1285. FillGrid();
  1286. break;
  1287. }
  1288. }
  1289. }
  1290. #endif
  1291. }
  1292. // Jeff:选设计版按钮;
  1293. void DesignFrom::OnBUTshowphoto() //Jeff:选设计版、N8按钮;
  1294. {
  1295. POSITION pos;
  1296. pos = m_List1.GetFirstSelectedItemPosition();
  1297. if (pos == NULL)
  1298. {
  1299. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1300. return;
  1301. }
  1302. int nSelectedItem = m_List1.GetNextSelectedItem(pos);
  1303. // 订单号;
  1304. CString strOrderNum = m_List1.GetItemText(nSelectedItem, 0);
  1305. // 设计状态;
  1306. CString strDesignStatus = m_List1.GetItemText(nSelectedItem, 5);
  1307. // 设计日期;
  1308. CString strDesignDate = m_List1.GetItemText(nSelectedItem, 6);
  1309. // 选设计人;
  1310. CString strXuanPainRen = m_List1.GetItemText(nSelectedItem, 13);
  1311. //////////////////////////////////////////////////////////////////////////
  1312. if ( m_bN8 && PathFileExists(g_szN8Path) )
  1313. {// N8选版;
  1314. // SETUP1.获取List控件的记录信息和域名信息;
  1315. CString strTemp = _T("");
  1316. CString strBranchId = _T("");
  1317. CString strBranchName =_T("");
  1318. CString strScenery = _T("");
  1319. // 获取域名;
  1320. if ( g_bAllBranch )
  1321. {// 多店汇总;
  1322. strBranchName = m_List1.GetItemText(nSelectedItem, 0);
  1323. strBranchId = GetDomainFromBranch(strBranchName);
  1324. }
  1325. else
  1326. {
  1327. if ( g_branchname.IsEmpty() )
  1328. {// 连接本店时;
  1329. strBranchId = g_domain;
  1330. }
  1331. else
  1332. {//连接分店时;
  1333. strBranchName = g_branchname;
  1334. strBranchId = GetDomainFromBranch( g_branchname );
  1335. }
  1336. }
  1337. // SETUP2.获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1338. IsGrowthTx IsGrowthtxdlg;
  1339. IsGrowthtxdlg.m_mode = 1;
  1340. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1341. IsGrowthtxdlg.DoModal();
  1342. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1343. {
  1344. return;
  1345. }
  1346. if ( IsGrowthtxdlg.m_bGrowthTx )
  1347. {
  1348. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1349. strScenery = IsGrowthtxdlg.m_seltxname;
  1350. }
  1351. // SETUP3.获得选版目录,并判断是否存在或已选;
  1352. BOOL bViewFinish = FALSE;
  1353. CString strUserPath = _T("");
  1354. CString strUserPath2 = _T("");
  1355. if ( strBranchId != g_domain )
  1356. {
  1357. if ( IsGrowthtxdlg.m_bGrowthTx )
  1358. {
  1359. strUserPath.Format(_T("%s\\%s"), strBranchId, strOrderNum);
  1360. strUserPath2.Format(_T("%s\\%s"), strBranchId, strOrderNum);
  1361. }
  1362. else
  1363. {
  1364. strUserPath.Format(_T("%s\\%s"), strBranchId, strOrderNum);
  1365. strUserPath2.Format(_T("%s\\[已选]%s"), strBranchId, strOrderNum);
  1366. }
  1367. }
  1368. else
  1369. {
  1370. if ( IsGrowthtxdlg.m_bGrowthTx )
  1371. {
  1372. strUserPath.Format(_T("%s"), strOrderNum);
  1373. strUserPath2.Format(_T("%s"), strOrderNum);
  1374. }
  1375. else
  1376. {
  1377. strUserPath.Format(_T("%s"), strOrderNum);
  1378. strUserPath2.Format(_T("[已选]%s"), strOrderNum);
  1379. }
  1380. }
  1381. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  1382. {
  1383. strUserPath += _T("\\[已选]") + strScenery;
  1384. }
  1385. strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
  1386. if ( PathFileExists(strTemp) )
  1387. {
  1388. if (IsGrowthtxdlg.m_bGrowthTx)
  1389. AfxMessageBox(_T("该套系选版已完成!"));
  1390. else
  1391. AfxMessageBox(_T("该订单选版已完成!"));
  1392. bViewFinish = TRUE;
  1393. }
  1394. else
  1395. {
  1396. strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath);
  1397. if ( !PathFileExists(strTemp) )
  1398. {
  1399. if (IsGrowthtxdlg.m_bGrowthTx)
  1400. AfxMessageBox(_T("未找到该套系数据,选版未设计!"));
  1401. else
  1402. AfxMessageBox(_T("未找到该订单数据,选版未设计!"));
  1403. return;
  1404. }
  1405. }
  1406. //////////////////////////////////////////////////////////////////////////
  1407. // 传参N8运行;
  1408. CString strParamter = _T("");
  1409. strParamter.Format(_T("/t \"<task userfolder='%s' staffid='%s' serverip='%s'/>\""),
  1410. strUserPath,
  1411. g_user.account,
  1412. g_szN8SvIP);
  1413. //strUserPath = strTemp;
  1414. //////////////////////////////////////////////////////////////////////////
  1415. #ifdef CHILD_VERSION
  1416. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  1417. strTemp.Format(_T("id = '%s' and growthxname = '%s'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
  1418. else
  1419. strTemp.Format(_T("id = '%s'"), strOrderNum, strOrderNum, strOrderNum);
  1420. #else
  1421. strTemp.Format(_T("id = '%s'"), strOrderNum, strOrderNum, strOrderNum);
  1422. #endif//CHILD_VERSION
  1423. g_sendhead.bsql = FALSE;
  1424. g_sendhead.code[0] = 50; // dindansp;
  1425. g_sendhead.tabcount = 1;
  1426. if( g_bAllBranch )
  1427. {//多店汇总时;
  1428. g_branchip = GetBranchIPbyId(strBranchId);
  1429. g_pMainWnd->OnDisconnect();
  1430. g_branchname = strBranchName;
  1431. g_bBranchModify = TRUE;
  1432. g_pMainWnd->ProcessChatMessageRequest2(strTemp);
  1433. g_pMainWnd->OnDisconnect();
  1434. g_bBranchModify = FALSE;
  1435. g_branchip = g_branchname = _T("");
  1436. }
  1437. else
  1438. {// 连接本店或分店时;
  1439. g_pMainWnd->ProcessChatMessageRequest2(strTemp);
  1440. }
  1441. if( !g_bSendOK )
  1442. return ;
  1443. CArray<CStringArray, CStringArray> Arydindansp;
  1444. DataToArray( &Arydindansp );
  1445. //////////////////////////////////////////////////////////////////////////
  1446. strTemp.Format(_T("%s\\选版结果\\"), strUserPath);
  1447. if ( !PathFileExists(strTemp) )
  1448. {
  1449. CreateDirectory(strTemp,NULL);
  1450. }
  1451. N8Process::CResultProduct rp;
  1452. if ( !PathFileExists(strTemp + _T("Product.data")) )
  1453. rp.CreateXML(strTemp + _T("Product.data"));
  1454. rp.SetXMLPath(strTemp + _T("Product.data"));
  1455. N8Process::CResultVgProduct rvgp;
  1456. if ( !PathFileExists(strTemp + _T("VgProduct.data")) )
  1457. rvgp.CreateXML(strTemp + _T("VgProduct.data"));
  1458. rvgp.SetXMLPath(strTemp + _T("VgProduct.data"));
  1459. for ( int i = 0; i < Arydindansp.GetSize(); i++ )
  1460. {
  1461. rp.InsertItem(Arydindansp.ElementAt(i).ElementAt(1), NULL, Arydindansp.ElementAt(i).ElementAt(5), NULL, NULL);
  1462. rvgp.InsertItem(Arydindansp.ElementAt(i).ElementAt(1), NULL, Arydindansp.ElementAt(i).ElementAt(5), NULL, NULL);
  1463. }
  1464. STARTUPINFO si;
  1465. PROCESS_INFORMATION pi;
  1466. ZeroMemory(&si, sizeof(STARTUPINFO));
  1467. si.cb = sizeof(STARTUPINFO);
  1468. ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
  1469. TCHAR szCommonLine[MAX_PATH] = {0};
  1470. sprintf(szCommonLine, _T("%s"), strParamter);
  1471. if ( !CreateProcess(g_szN8Path, szCommonLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) )
  1472. {
  1473. return;
  1474. }
  1475. WaitForSingleObject(pi.hProcess, INFINITE);
  1476. AfxMessageBox(_T("选版结束"));
  1477. if ( !bViewFinish )
  1478. {
  1479. strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
  1480. if ( PathFileExists(strTemp) )
  1481. {
  1482. bViewFinish = TRUE;
  1483. }
  1484. }
  1485. CString strViewFinishXml = _T("");
  1486. if ( bViewFinish )
  1487. {
  1488. strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
  1489. if ( PathFileExists(strTemp) )
  1490. {
  1491. CString strXML = _T("");
  1492. strTemp.TrimRight(_T("\\"));
  1493. int nIndex = strTemp.ReverseFind(_T('\\'));
  1494. if ( nIndex != -1 )
  1495. {
  1496. strXML = strTemp.Mid(nIndex+1);
  1497. strTemp = strTemp.Left(nIndex);
  1498. }
  1499. strViewFinishXml.Format(_T("%s\\%s.xml"), strTemp, strXML);
  1500. if ( !PathFileExists(strViewFinishXml) )
  1501. {
  1502. strViewFinishXml.Empty();
  1503. }
  1504. }
  1505. }
  1506. printf("\t目录1:%s\n,\t目录2:%s",strUserPath,strUserPath2);
  1507. CDlgN8ViewReuslt N8dlg;
  1508. if ( !bViewFinish )
  1509. N8dlg.m_strUserDir.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath);
  1510. else
  1511. N8dlg.m_strUserDir.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
  1512. printf("\t最终目录:%s\n",N8dlg.m_strUserDir);
  1513. N8dlg.m_strOrderNum = strOrderNum;
  1514. if ( bViewFinish )
  1515. {
  1516. N8dlg.m_bViewFinish = TRUE;
  1517. if ( !strViewFinishXml.IsEmpty() )
  1518. N8dlg.m_strViewFinishxml = strViewFinishXml;
  1519. }
  1520. if (IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  1521. N8dlg.m_strScenery = strScenery;
  1522. N8dlg.m_strCustomer.Format(_T("%s,%s"), m_List1.GetItemText(nSelectedItem, 1), m_List1.GetItemText(nSelectedItem, 2));
  1523. // 读取\版面\Ablum.pwt文件;
  1524. // 读取\选版结果\Product.data文件;
  1525. // 读取\选版结果\VgProduct.data文件;
  1526. // 读取[已选].xml文件;
  1527. N8dlg.DoModal();
  1528. CloseHandle(pi.hProcess);
  1529. CloseHandle(pi.hThread);
  1530. return;
  1531. }
  1532. //////////////////////////////////////////////////////////////////////////
  1533. ChooseDesignSkin dlg; // 选设计对话框;
  1534. dlg.SetLiaPath("3.lia");
  1535. dlg.m_strOrderNumber = strOrderNum;
  1536. dlg.m_path = g_path3 + "\\";
  1537. dlg.m_path += strOrderNum;
  1538. dlg.m_path += "\\";
  1539. dlg.DoModal();
  1540. g_bInSkin = 0;
  1541. for (int i = 0; i < m_List1array.GetSize(); i++)
  1542. {
  1543. if (strOrderNum == m_List1array.ElementAt(i).ElementAt(0))
  1544. {
  1545. m_List1array.ElementAt(i).SetAt(11, dlg.m_bz3); // 看设计备注;
  1546. m_List1array.ElementAt(i).SetAt(7, dlg.m_status8); // 看设计状态;
  1547. m_List1array.ElementAt(i).SetAt(10, dlg.m_time5); // 取件日期;
  1548. if (dlg.m_status8 != "OK")
  1549. m_List1array.ElementAt(i).SetAt(5, "设计中");
  1550. else
  1551. m_List1array.ElementAt(i).SetAt(5, "OK");
  1552. FillGrid();
  1553. break;
  1554. }
  1555. }
  1556. }
  1557. void DesignFrom::OnButton1() // 查询 按钮;
  1558. {
  1559. UpdateData();
  1560. m_filter.TrimLeft();
  1561. m_filter.TrimRight();
  1562. FillGrid();
  1563. }
  1564. // 已选未设计 按钮; "已选未设计"命名不合理,不知是"已选片OK未设计"还是"已精修未设计",意义待定
  1565. void DesignFrom::OnButton2() // 已精修未设计 按钮;
  1566. {
  1567. UpdateData();
  1568. m_filter.TrimLeft();
  1569. m_filter.TrimRight();
  1570. FillGrid(1);
  1571. }
  1572. void DesignFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  1573. {
  1574. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  1575. POSITION pos;
  1576. pos = m_List1.GetFirstSelectedItemPosition();
  1577. if (pos == NULL)
  1578. {
  1579. return;
  1580. }
  1581. int iItem = m_List1.GetNextSelectedItem(pos);
  1582. // CString waiter4=m_List1.GetItemText (iItem, 11);
  1583. if (IsHasRights2new(7) || IsHasRights2new(49))
  1584. {
  1585. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1586. // GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
  1587. }
  1588. else
  1589. {
  1590. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1591. // GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(0);
  1592. }
  1593. /* if(waiter4.IsEmpty () && IsHasRights2new(7) || IsHasRights2new(49) )
  1594. {
  1595. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1596. GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
  1597. }
  1598. else if(waiter4==g_user.name && IsHasRights2new(7) )
  1599. {
  1600. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1601. GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
  1602. }
  1603. else
  1604. {
  1605. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1606. GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(0);
  1607. }*/
  1608. *pResult = 0;
  1609. }
  1610. void DesignFrom::OnBUTimportphoto2() // 查看 按钮;
  1611. {
  1612. POSITION pos;
  1613. pos = m_List1.GetFirstSelectedItemPosition();
  1614. if (pos == NULL)
  1615. {
  1616. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1617. return;
  1618. }
  1619. int iItem = m_List1.GetNextSelectedItem(pos);
  1620. CString branch;
  1621. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1622. if (g_bAllBranch)
  1623. branch = m_List1.GetItemText(iItem, 0);
  1624. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1625. name.TrimLeft(",");
  1626. name.TrimRight(",");
  1627. name = "客人:" + name;
  1628. ShowPic dlg;
  1629. dlg.m_id = id;
  1630. dlg.m_name = name;
  1631. dlg.m_name2 = m_List1.GetItemText(iItem, 1 + m_nAdd) + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1632. // 设计要求(原列10)
  1633. dlg.remark = m_List1.GetItemText(iItem, 11 + m_nAdd);
  1634. dlg.m_mode = 5;
  1635. CString strDomain = _T("");
  1636. CString savepath = _T("");
  1637. if (g_bAllBranch)
  1638. {
  1639. if(branch == _T(""))
  1640. savepath = g_path3 + "\\";
  1641. else
  1642. {
  1643. strDomain = GetDomainFromBranch(branch);
  1644. savepath = g_path3 + "\\" + strDomain + "\\";
  1645. }
  1646. if (::CheckFolderFileExist(savepath) == 0)
  1647. ::CreateDirectory(savepath, NULL);
  1648. }
  1649. else
  1650. {
  1651. if(g_branchname == _T(""))
  1652. savepath = g_path3 + "\\";
  1653. else
  1654. strDomain = GetDomainFromBranch(g_branchname);
  1655. }
  1656. #if !USE_SHARE_FLORD
  1657. // 根据域名,相片类型,订单号查找相片;
  1658. dlg.m_aryOfShareDirectory.RemoveAll();
  1659. CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
  1660. #endif
  1661. dlg.m_branch = strDomain;
  1662. dlg.m_path = g_path3 + _T("\\");
  1663. dlg.m_path += id;
  1664. dlg.m_path += "\\";
  1665. dlg.DoModal();
  1666. }
  1667. void DesignFrom::OnBUTimportphoto3() // 导出 (设计好的片) 按钮;
  1668. {
  1669. #ifdef USE_KERNEL_DLL
  1670. // 判断登陆用户是否有导出原片的权限;
  1671. if ( !IsHasRights2new(12) )
  1672. {
  1673. AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
  1674. return;
  1675. }
  1676. // 获取列表信息:域名、订单号、景点名、顾客信息;
  1677. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  1678. if ( pos == NULL )
  1679. {
  1680. AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
  1681. return;
  1682. }
  1683. INT nItemCount = m_List1.GetItemCount();
  1684. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  1685. CString strBranchId = _T("");
  1686. CString strOrderNum = _T("");
  1687. // 初修列表不支持景点名,需要从其他地方获取;
  1688. CString strScenery = _T("");
  1689. CString strCustomerInfo = _T("");
  1690. // 获取域名;
  1691. if ( g_bAllBranch )
  1692. {// 多店汇总时;
  1693. strBranchId = GetDomainFromBranch( m_List1.GetItemText(nSelectedItem, 0) );
  1694. }
  1695. else
  1696. {
  1697. if ( g_branchname.IsEmpty() )
  1698. {// 连接本店时;
  1699. strBranchId = g_domain;
  1700. }
  1701. else
  1702. {// 连接分店时;
  1703. strBranchId = GetDomainFromBranch( g_branchname );
  1704. }
  1705. }
  1706. // 获取订单号;
  1707. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  1708. // 获取顾客信息;
  1709. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  1710. // 加上设计要求;
  1711. strCustomerInfo += _T("$");
  1712. strCustomerInfo += m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
  1713. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1714. IsGrowthTx IsGrowthtxdlg;
  1715. IsGrowthtxdlg.m_mode = 1;
  1716. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1717. IsGrowthtxdlg.DoModal();
  1718. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1719. {
  1720. return;
  1721. }
  1722. if ( IsGrowthtxdlg.m_bGrowthTx )
  1723. {
  1724. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1725. strScenery = IsGrowthtxdlg.m_seltxname;
  1726. if ( strScenery == _T("全部") )
  1727. {
  1728. strScenery.Empty();
  1729. }
  1730. }
  1731. // 导出原片时,是否压缩导出;
  1732. DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
  1733. /////////////////////////////////////////////////////////////////////////////////////////////////
  1734. if ( g_pIMGProcess == NULL )
  1735. {
  1736. return ;
  1737. }
  1738. // 获取完信息,开始导出原片;
  1739. ImgExportInterface *pExport = NULL;
  1740. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  1741. if ( pExport )
  1742. {
  1743. pExport->ExportDesignImg(
  1744. TRUE,
  1745. strBranchId,
  1746. strOrderNum,
  1747. strCustomerInfo,
  1748. !strScenery.IsEmpty(),
  1749. strScenery,
  1750. _T("*.jpg|*.jpeg"),
  1751. dwExportPix,
  1752. _T("*.nef|*.cr2|*.raw|*.ra2"),
  1753. FALSE,
  1754. FALSE
  1755. );
  1756. }
  1757. g_pIMGProcess->Release();
  1758. WriteOptLog(_T("导出设计,订单号:%s"),strOrderNum);
  1759. // 结束;
  1760. #else
  1761. if (IsHasRights2new(12) == 0)return;
  1762. POSITION pos;
  1763. pos = m_List1.GetFirstSelectedItemPosition();
  1764. if (pos == NULL)
  1765. {
  1766. AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
  1767. return;
  1768. }
  1769. int iItem = m_List1.GetNextSelectedItem(pos);
  1770. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1771. CString branch;
  1772. if (g_bAllBranch)
  1773. branch = m_List1.GetItemText(iItem, 0);
  1774. CString path;
  1775. if (g_bAllBranch)
  1776. {
  1777. CString branchpath = GetBranchPhotoPath(branch);
  1778. path = g_path3 + branchpath + "\\";
  1779. }
  1780. else
  1781. path = g_path3 + "\\";
  1782. path += id;
  1783. path += "\\";
  1784. CStringArray array;
  1785. CString dir;
  1786. GetSavePath(dir);
  1787. if (dir.IsEmpty())
  1788. {
  1789. return;
  1790. }
  1791. CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
  1792. CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
  1793. CString remark = m_List1.GetItemText(iItem, 11 + m_nAdd); // 设计要求,原列10
  1794. dir.TrimRight('\\');
  1795. dir += "\\";
  1796. dir += id;
  1797. dir += g_branchname;
  1798. if (g_bAllBranch)
  1799. {
  1800. if (GetBranchPhotoPath(branch) != "")
  1801. dir += branch;
  1802. }
  1803. dir += name1;
  1804. dir += name2;
  1805. dir += "设计好的片";
  1806. dir += "\\";
  1807. ::CreateDirectory(dir, NULL);
  1808. CStringArray desarray;
  1809. CStringArray dirarray;
  1810. CString savepath = dir;
  1811. CString str;
  1812. if (1)
  1813. {
  1814. using namespace helper_coffs;
  1815. ffsco o;
  1816. o.dirs(1);
  1817. o.find(LPCSTR(path), LPCSTR("*.*"));
  1818. ffsco::typeT coo;
  1819. ffsco::typeT::iterator it;
  1820. coo = o.co_dir();
  1821. for (it = coo.begin(); coo.end() != it; it++)
  1822. {
  1823. str = (*it).c_str();
  1824. if (FindArray(&dirarray, str) == -1)
  1825. {
  1826. dirarray.Add(str);
  1827. if (str != dirarray.ElementAt(0))
  1828. {
  1829. str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
  1830. if (::CheckFolderFileExist(str) == 0)
  1831. ::CreateDirectory(str, NULL);
  1832. }
  1833. }
  1834. }
  1835. }
  1836. if (1)
  1837. {
  1838. for (int i = 0; i < dirarray.GetSize(); i++)
  1839. {
  1840. using namespace helper_coffs;
  1841. ffsco o;
  1842. o.dirs(0);
  1843. o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
  1844. ffsco::typeT coo;
  1845. ffsco::typeT::iterator it;
  1846. coo = o.co_file();
  1847. for (it = coo.begin(); coo.end() != it; it++)
  1848. {
  1849. str = (*it).c_str();
  1850. if (str.GetAt(str.ReverseFind('\\') + 1) == 's')continue;
  1851. if (str.GetAt(str.ReverseFind('\\') + 1) == 'm')continue;
  1852. array.Add(str);
  1853. desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
  1854. }
  1855. }
  1856. }
  1857. if (array.GetSize() == 0)
  1858. {
  1859. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  1860. return;
  1861. }
  1862. CStdioFile fp;
  1863. fp.Open(dir + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
  1864. fp.WriteString(remark);
  1865. fp.Close();
  1866. CCompressOption comoptdlg;
  1867. comoptdlg.DoModal();
  1868. //----------------------------------------------------------------------------------------------
  1869. //----------------------------------------------------------------------------------------------
  1870. // 导出设计好片;
  1871. //----------------------------------------------------------------------------------------------
  1872. //----------------------------------------------------------------------------------------------
  1873. ImportPhoto dlg;
  1874. dlg.m_nOutputSize = comoptdlg.m_nsize; // 1.导出设计好的片的尺寸;
  1875. dlg.m_mode = 1; // 2.未知;
  1876. dlg.m_pArray = &array; // 3.作为导出时的源设计片路径集合;
  1877. dlg.m_pDesArray = &desarray; // 4.作为导出时的目标设计片路径集合;
  1878. dlg.m_savepath = dir; // 5.导出设计片时的保存路径;
  1879. dlg.DoModal();
  1880. AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  1881. // CString str;
  1882. str = " 导出设计片 ";
  1883. str += "客人:";
  1884. str += name1 + name2 + id;
  1885. WriteLog(_T("导出设计好片"), str);
  1886. #endif
  1887. }
  1888. void DesignFrom::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  1889. {
  1890. POSITION pos;
  1891. pos = m_List1.GetFirstSelectedItemPosition();
  1892. if (pos == NULL)return;
  1893. int iItem = m_List1.GetNextSelectedItem(pos);
  1894. g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1895. *pResult = 0;
  1896. }
  1897. // 需要处理更换分隔符造成的问题;
  1898. // 已处理分隔符问题;
  1899. void DesignFrom::OnButton3() // 导出选设计 按钮;导出N8选版;
  1900. {
  1901. #ifdef USE_KERNEL_DLL
  1902. // 判断用户是否有权限导出选设计的片
  1903. if ( !IsHasRights2new(12))
  1904. {
  1905. AfxMessageBox(_T("您没有权限导出选设计的片!"));
  1906. return;
  1907. }
  1908. // 获取列表信息;
  1909. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  1910. if ( pos == NULL )
  1911. {
  1912. AfxMessageBox(_T("请您选中要导片的订单!"));
  1913. return;
  1914. }
  1915. INT nItemCount = m_List1.GetItemCount();
  1916. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  1917. // 获取域名、订单号、景点名、顾客信息、设计状态、设计日期、设计师、选设计人、选设计状态(看设计状态)、选设计日期;
  1918. CString strBranchName = _T("");
  1919. CString strBranchId = _T("");
  1920. CString strOrderNum = _T("");
  1921. CString strScenery = _T("");
  1922. CString strCustomerInfo = _T("");
  1923. CString strDesignState = _T("");
  1924. CString strDesignDate = _T("");
  1925. CString strDesigner = _T("");
  1926. CString strXuanpianRen = _T("");
  1927. CString strXuanpianState = _T("");
  1928. CString strXuanpianDate = _T("");
  1929. // 获取订单号;
  1930. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  1931. // 获取顾客信息;
  1932. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  1933. // 获取设计状态;
  1934. strDesignState = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  1935. // 获取设计日期;
  1936. strDesignState = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  1937. // 获取设计师;
  1938. strDesigner = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
  1939. // 获取看设计状态;
  1940. strXuanpianState = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
  1941. // 获取选设计日期;
  1942. strXuanpianDate = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
  1943. // 获取看设计师;
  1944. strXuanpianRen = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  1945. if ( strDesignState == _T("未设计") )
  1946. {
  1947. MessageBox(_T("此单未设计!"), _T("影楼管理"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION );
  1948. return;
  1949. }
  1950. // 获取域名;
  1951. if ( g_bAllBranch )
  1952. {// 多店汇总;
  1953. strBranchName = m_List1.GetItemText(nSelectedItem, 0);
  1954. strBranchId = GetDomainFromBranch(strBranchName);
  1955. }
  1956. else
  1957. {
  1958. if ( g_branchname.IsEmpty() )
  1959. {// 连接本店时;
  1960. strBranchId = g_domain;
  1961. }
  1962. else
  1963. {//连接分店时;
  1964. strBranchName = g_branchname;
  1965. strBranchId = GetDomainFromBranch( g_branchname );
  1966. }
  1967. }
  1968. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1969. IsGrowthTx IsGrowthtxdlg;
  1970. IsGrowthtxdlg.m_mode = 1;
  1971. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1972. IsGrowthtxdlg.DoModal();
  1973. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1974. {
  1975. return;
  1976. }
  1977. if ( IsGrowthtxdlg.m_bGrowthTx )
  1978. {
  1979. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1980. strScenery = IsGrowthtxdlg.m_seltxname;
  1981. if ( strScenery == _T("全部") )
  1982. {
  1983. strScenery.Empty();
  1984. }
  1985. }
  1986. if ( m_bN8 && PathFileExists(g_szN8Path) )
  1987. {// N8选版;
  1988. ImgExportInterface *pN8Export = NULL;
  1989. if ( g_pIMGProcess == NULL )
  1990. {
  1991. return ;
  1992. }
  1993. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pN8Export);
  1994. if ( pN8Export )
  1995. {// 导出选好的片;
  1996. pN8Export->ExportN8(
  1997. g_szN8ViewUserDir,
  1998. strBranchId,
  1999. strOrderNum,
  2000. strCustomerInfo,
  2001. !strScenery.IsEmpty(),
  2002. strScenery,
  2003. FALSE
  2004. );
  2005. pN8Export->Release();
  2006. WriteOptLog(_T("导出N8,订单号:%s"),strOrderNum);
  2007. OutputDebugString(_T("导出N8!\n"));
  2008. }
  2009. return;
  2010. }
  2011. //////////////////////////////////////////////////////////////////////////
  2012. CString strSQL = _T("");
  2013. #ifdef CHILD_VERSION
  2014. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  2015. strSQL.Format(_T("id = '%s' and growthxname = '%s'; id = '%s'; id = '%s' and name <> '入册' and name <> '入底'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
  2016. else
  2017. strSQL.Format(_T("id = '%s'; id = '%s'; id = '%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  2018. #else
  2019. strSQL.Format(_T("id = '%s'; id = '%s'; id = '%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  2020. #endif//CHILD_VERSION
  2021. g_sendhead.bsql = FALSE;
  2022. g_sendhead.code[0] = 50; // dindansp;
  2023. g_sendhead.code[1] = 11; // dindan;
  2024. g_sendhead.code[2] = 56; // dindansp;
  2025. g_sendhead.tabcount = 3;
  2026. if( g_bAllBranch )
  2027. {//多店汇总时;
  2028. g_branchip = GetBranchIPbyId(strBranchId);
  2029. g_pMainWnd->OnDisconnect();
  2030. g_branchname = strBranchName;
  2031. g_bBranchModify = TRUE;
  2032. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  2033. g_pMainWnd->OnDisconnect();
  2034. g_bBranchModify = FALSE;
  2035. g_branchip = g_branchname = _T("");
  2036. }
  2037. else
  2038. {// 连接本店或分店时;
  2039. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  2040. }
  2041. if( !g_bSendOK )
  2042. return ;
  2043. CArray<CStringArray, CStringArray> Arydindan;
  2044. CArray<CStringArray, CStringArray> Arydindansp;
  2045. CArray<CStringArray, CStringArray> Arydindansp2;
  2046. DataToArray( &Arydindansp, &Arydindan, &Arydindansp2 );
  2047. CString strTemp = _T("");
  2048. CStringArray AryImgNums;
  2049. CStringArray AryPerImgGoods;
  2050. // 获取所有dindansp记录no2字段中的相片编号;
  2051. int i = 0;
  2052. int nSize = Arydindansp.GetSize();
  2053. for ( i = 0; i < nSize; i++)
  2054. {
  2055. strTemp = Arydindansp.ElementAt(i).ElementAt(8); // dindansp表中的no2字段;
  2056. GetNo(strTemp, AryImgNums);
  2057. }
  2058. // 获取每张相片编号对应的商品,每个商品间用分号隔开;
  2059. nSize = AryImgNums.GetSize();
  2060. AryPerImgGoods.SetSize(nSize);
  2061. for ( i = 0; i < nSize; i++ )
  2062. {
  2063. strTemp = AryImgNums.ElementAt(i);
  2064. AryPerImgGoods.SetAt(i, GetSelName(strTemp, Arydindansp));
  2065. }
  2066. // 由于VC6.0传CStringArray给VC9.0DLL 时,会产生无法避免的兼容性问题,故使用CString传;
  2067. CString strImgNums = _T("");
  2068. for ( i = 0; i < AryImgNums.GetSize(); i++ )
  2069. {
  2070. strImgNums += AryImgNums.ElementAt(i);
  2071. strImgNums += _T("?|?");
  2072. }
  2073. CString strPerImgGoods = _T("");
  2074. for ( i = 0; i < AryPerImgGoods.GetSize(); i++ )
  2075. {// 商品名称,应该禁止包含非法字符;
  2076. strPerImgGoods += AryPerImgGoods.ElementAt(i);
  2077. strPerImgGoods += _T("?|?");
  2078. }
  2079. // 保存导出相片的路径;
  2080. CString strSaveDirectory = _T("");
  2081. ImgExportInterface *pExport = NULL;
  2082. if ( g_pIMGProcess == NULL )
  2083. {
  2084. return ;
  2085. }
  2086. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  2087. if ( pExport )
  2088. {// 导出选好的片;
  2089. pExport->ExportSelectedDesignImg(
  2090. strBranchId,
  2091. strOrderNum,
  2092. strCustomerInfo,
  2093. !strScenery.IsEmpty(),
  2094. strScenery,
  2095. _T("*.jpg|*.jpeg"),
  2096. INVALID_COPY_PIX,
  2097. _T("*.nef|*.cr2|*.raw|"),
  2098. FALSE,
  2099. IsGrowthtxdlg.m_bGrowthTx,
  2100. strImgNums,
  2101. strPerImgGoods,
  2102. Arydindan.ElementAt(0).ElementAt(60)
  2103. );
  2104. pExport->Release();
  2105. WriteOptLog(_T("导出选设计,订单号:%s"),strOrderNum);
  2106. OutputDebugString(_T("导出设计好的片!\n"));
  2107. }
  2108. // 结束;
  2109. #else
  2110. if (IsHasRights2new(12) == 0)return;
  2111. UpdateData();
  2112. POSITION pos;
  2113. pos = m_List1.GetFirstSelectedItemPosition();
  2114. if (pos == NULL)
  2115. {
  2116. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  2117. return;
  2118. }
  2119. int iItem = m_List1.GetNextSelectedItem(pos);
  2120. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  2121. CString branch;
  2122. if (g_bAllBranch)
  2123. branch = m_List1.GetItemText(iItem, 0);
  2124. CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
  2125. CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
  2126. #ifdef CHILD_VERSION
  2127. CString filter = "id='" + id + "';id='" + id + "';id='" + id + "' and name<>'入册' and name<>'入底'";
  2128. #else
  2129. CString filter = "id='" + id + "';id='" + id + "';id='" + id + "' and kind<>'2' and name<>'入册' and name<>'入底'";
  2130. #endif
  2131. g_sendhead.bsql = 0;
  2132. g_sendhead.code[0] = 50;
  2133. g_sendhead.code[1] = 11;
  2134. g_sendhead.code[2] = 56;
  2135. g_sendhead.tabcount = 3;
  2136. if (g_bAllBranch)
  2137. {
  2138. g_branchip = GetIP(branch);
  2139. g_pMainWnd->OnDisconnect();
  2140. g_branchname = branch;
  2141. g_bBranchModify = 1;
  2142. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2143. g_pMainWnd->OnDisconnect();
  2144. g_bBranchModify = 0;
  2145. g_branchip = g_branchname = "";
  2146. }
  2147. else
  2148. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2149. if (g_bSendOK == 0)return;
  2150. CArray<CStringArray, CStringArray>sparray;
  2151. CArray<CStringArray, CStringArray>sparray2;
  2152. DataToArray(&sparray, &g_List1array, &sparray2);
  2153. CString path;
  2154. if (g_bAllBranch)
  2155. {
  2156. CString branchpath = GetBranchPhotoPath(branch);
  2157. path = g_path3 + branchpath + "\\";
  2158. }
  2159. else
  2160. path = g_path3 + "\\";
  2161. path += id;
  2162. path += "\\";
  2163. ////////////////////////////////////////
  2164. CString str, spname;
  2165. CStringArray noarray;
  2166. CStringArray spnamearray;
  2167. int i = 0;
  2168. for ( i = 0; i < sparray.GetSize(); i++)
  2169. {
  2170. str = sparray.ElementAt(i).ElementAt(8);
  2171. spname = sparray.ElementAt(i).ElementAt(5);
  2172. GetNo(str, noarray);
  2173. }
  2174. if (noarray.GetSize() == 0)
  2175. {
  2176. AfxMessageBox("此单未选设计版!", MB_ICONINFORMATION);
  2177. return;
  2178. }
  2179. spnamearray.SetSize(noarray.GetSize());
  2180. for (i = 0; i < noarray.GetSize(); i++)
  2181. {
  2182. str = noarray.ElementAt(i);
  2183. spnamearray.SetAt(i, GetSelName2(str, sparray));
  2184. }
  2185. CString dir;
  2186. GetSavePath(dir);
  2187. if (dir.IsEmpty())return;
  2188. dir.TrimRight('\\');
  2189. dir += "\\";
  2190. dir += id;
  2191. dir += g_branchname;
  2192. if (g_bAllBranch)
  2193. {
  2194. if (GetBranchPhotoPath(branch) != "")
  2195. dir += branch;
  2196. }
  2197. dir += name1;
  2198. dir += name2;
  2199. dir += "选设计";
  2200. dir += "\\";
  2201. CStringArray array;
  2202. CStringArray spnamearray2;
  2203. CString src, des;
  2204. for (i = 0; i < noarray.GetSize(); i++)
  2205. {
  2206. src.Format("%s%s.jpg", path, noarray.ElementAt(i));
  2207. if (PathFileExists(src))
  2208. {
  2209. array.Add(src);
  2210. src = spnamearray.ElementAt(i);
  2211. spnamearray2.Add(spnamearray.ElementAt(i));
  2212. }
  2213. else
  2214. AfxMessageBox("未找到设计版:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
  2215. }
  2216. ::CreateDirectory(dir, NULL);
  2217. //----------------------------------------------------------------------------------------------
  2218. //----------------------------------------------------------------------------------------------
  2219. // 导出选设计的片;
  2220. //----------------------------------------------------------------------------------------------
  2221. //----------------------------------------------------------------------------------------------
  2222. ImportPhoto dlg;
  2223. dlg.m_mode = 1; // 1.未知;
  2224. dlg.m_bOrigin = 1; // 2.未知;
  2225. dlg.m_pArray = &array; // 3.作为导出源的选好的设计片路径集合;
  2226. dlg.m_pArray2 = &spnamearray2; // 4.作为导出目标的选好的设计片路径集合;
  2227. dlg.m_savepath = dir; // 5.保存选好的设计片的目录;
  2228. dlg.DoModal();
  2229. //////////////
  2230. if (g_List1array.GetSize())
  2231. {
  2232. CStdioFile fp;
  2233. fp.Open(dir + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
  2234. fp.WriteString("选设计要求:\n");
  2235. fp.WriteString(g_List1array.ElementAt(0).ElementAt(57));
  2236. fp.WriteString("\n");
  2237. fp.WriteString("\n");
  2238. fp.WriteString("设计版替换照片:\n");
  2239. CString replace = g_List1array.ElementAt(0).ElementAt(59);
  2240. if (!replace.IsEmpty())
  2241. {
  2242. replace.Delete(0, 1);
  2243. replace.Replace("$", "\n");
  2244. }
  2245. fp.WriteString(replace);
  2246. fp.WriteString("\n");
  2247. fp.WriteString("\n");
  2248. fp.WriteString("订单要求:\n");
  2249. fp.WriteString(g_List1array.ElementAt(0).ElementAt(38));
  2250. fp.WriteString("\n");
  2251. fp.WriteString("\n");
  2252. fp.WriteString("客人产品:\n");
  2253. CString str;
  2254. str = "产品名称";
  2255. FillLength(str, 20);
  2256. str += "数量";
  2257. FillLength(str, 30);
  2258. str += "加急";
  2259. FillLength(str, 40);
  2260. str += "取件日期";
  2261. FillLength(str, 50);
  2262. fp.WriteString(str);
  2263. fp.WriteString("\n");
  2264. for (int i = 0; i < sparray2.GetSize(); i++)
  2265. {
  2266. str.Empty();
  2267. str = sparray2.ElementAt(i).ElementAt(0);
  2268. FillLength(str, 20);
  2269. str += sparray2.ElementAt(i).ElementAt(1);
  2270. FillLength(str, 30);
  2271. str += sparray2.ElementAt(i).ElementAt(18);
  2272. FillLength(str, 40);
  2273. str += sparray2.ElementAt(i).ElementAt(19);
  2274. FillLength(str, 50);
  2275. fp.WriteString(str);
  2276. fp.WriteString("\n");
  2277. }
  2278. fp.Close();
  2279. }
  2280. //////////////
  2281. AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  2282. // CString str;
  2283. str = " 导出选设计片 ";
  2284. str += "客人:";
  2285. str += name1 + name2 + id;
  2286. WriteLog(_T("导出选设计片"), str);
  2287. #endif
  2288. }
  2289. void DesignFrom::HidePrice()
  2290. {
  2291. #ifdef LKAY_VERSION
  2292. return;
  2293. #else
  2294. return;
  2295. #endif
  2296. }
  2297. void DesignFrom::OnBtnsearchfilter() // 条件查询 按钮;
  2298. {
  2299. SearchFilter dlg;
  2300. dlg.m_mode = 5;
  2301. if (dlg.DoModal() == IDOK)FillGrid();
  2302. g_bSearchFilter = 0;
  2303. }
  2304. void DesignFrom::GetData()
  2305. {
  2306. if (g_bAllBranch == 0)
  2307. {
  2308. if (g_bShowOK == 0)
  2309. {
  2310. #ifdef LKAY_VERSION
  2311. CString filter = "status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  2312. #else
  2313. CString filter = "status3='未取'";
  2314. #endif
  2315. g_sendhead.bsql = 0;
  2316. g_sendhead.code[0] = 31;
  2317. g_sendhead.tabcount = 1;
  2318. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2319. if (g_bSendOK == 0)return;
  2320. }
  2321. else
  2322. {
  2323. g_sendhead.bsql = 0;
  2324. g_sendhead.code[0] = 31;
  2325. g_sendhead.tabcount = 1;
  2326. #ifdef LKAY_VERSION
  2327. CString filter = "dindantype<>'意向客户' or dindantype is null";
  2328. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2329. #else
  2330. g_pMainWnd->ProcessChatMessageRequest2(1);
  2331. #endif
  2332. if (g_bSendOK == 0)return;
  2333. }
  2334. DataToArray(&m_List1array);
  2335. }
  2336. else
  2337. {
  2338. //////////////数据汇总
  2339. m_List1array.RemoveAll();
  2340. CString branch;
  2341. for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
  2342. {
  2343. if (i != -1)
  2344. {
  2345. branch = g_brancharray.ElementAt(i).ElementAt(0);
  2346. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  2347. g_pMainWnd->OnDisconnect();
  2348. g_branchname = branch;
  2349. g_bBranchModify = 1;
  2350. }
  2351. else
  2352. branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
  2353. if (g_bShowOK == 0)
  2354. {
  2355. CString filter = "status3='未取'";
  2356. g_sendhead.bsql = 0;
  2357. g_sendhead.code[0] = 31;
  2358. g_sendhead.tabcount = 1;
  2359. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2360. if (g_bSendOK == 0)continue;
  2361. }
  2362. else
  2363. {
  2364. g_sendhead.bsql = 0;
  2365. g_sendhead.code[0] = 31;
  2366. g_sendhead.tabcount = 1;
  2367. g_pMainWnd->ProcessChatMessageRequest2(1);
  2368. if (g_bSendOK == 0)continue;
  2369. }
  2370. CArray<CStringArray, CStringArray>List1array;
  2371. DataToArray(&List1array);
  2372. int size = m_List1array.GetSize();
  2373. for (int j = 0; j < List1array.GetSize(); j++)
  2374. {
  2375. size++;
  2376. m_List1array.SetSize(size, 1);
  2377. size--;
  2378. m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
  2379. m_List1array.ElementAt(size).InsertAt(0, branch);
  2380. size++;
  2381. }
  2382. }
  2383. g_pMainWnd->OnDisconnect();
  2384. g_bBranchModify = 0;
  2385. g_branchip = g_branchname = "";
  2386. }
  2387. m_List1arraybak.SetSize(m_List1array.GetSize(), 1);
  2388. for (int ii = 0; ii < m_List1array.GetSize(); ii++)
  2389. {
  2390. m_List1arraybak.ElementAt(ii).Copy(m_List1array.ElementAt(ii));
  2391. // 设计要求;原列10
  2392. if (m_List1array.ElementAt(ii).ElementAt(11).GetLength() > 256)
  2393. {
  2394. m_List1array.ElementAt(ii).SetAt(11, m_List1array.ElementAt(ii).ElementAt(11).Left(256) + "...");
  2395. }
  2396. }
  2397. HidePrice();
  2398. FillGrid();
  2399. }
  2400. void DesignFrom::OnBUTprint3() // 更新数据 按钮;
  2401. {
  2402. GetData();
  2403. }
  2404. void DesignFrom::OnBnClickedCloundxy() // 云选样;
  2405. {
  2406. // TODO: 在此添加控件通知处理程序代码
  2407. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  2408. if ( pos == NULL)
  2409. {
  2410. AfxMessageBox(_T("请选中要使用云选片的订单!"));
  2411. return ;
  2412. }
  2413. INT nItem = m_List1.GetNextSelectedItem(pos);
  2414. CString strOrderNum = _T("");
  2415. CString strScenery = _T("");
  2416. CString strCustomerName = _T("");
  2417. CString strCustomerTel = _T("");
  2418. CString strStudioName = _T("");
  2419. CString strStudioTel = _T("");
  2420. CString strUniqueId = _T("");
  2421. CString strClounSite = _T("");
  2422. CString strTemp;
  2423. strOrderNum = m_List1.GetItemText(nItem, 0);
  2424. strCustomerName.Format(_T("%s,%s"), m_List1.GetItemText(nItem, m_nAdd + 1), m_List1.GetItemText(nItem, m_nAdd + 2));
  2425. strCustomerTel.Format(_T("%s,%s"), m_List1.GetItemText(nItem, m_nAdd + 17), m_List1.GetItemText(nItem,m_nAdd + 18));
  2426. strStudioName = g_cominfoarray.ElementAt(0).ElementAt(10);
  2427. strStudioTel = g_cominfoarray.ElementAt(0).ElementAt(11);
  2428. strClounSite = m_List1.m_arLabels.ElementAt(nItem).ElementAt(21);
  2429. INT nIndex = 0;
  2430. strTemp = g_branchname.IsEmpty() ? g_domain : g_branchname;
  2431. if ( ( nIndex = strTemp.Find(_T(".ly.com"))) == -1)
  2432. {
  2433. AfxMessageBox(_T("域名无效!"));
  2434. return;
  2435. }
  2436. strTemp = strTemp.Left(nIndex);
  2437. strTemp = strTemp.Right(6);
  2438. strUniqueId.Format(_T("%s_A_%s_1"), strTemp, strOrderNum);
  2439. if ( lyfzLibrary::LoadCloudSelectionLib() )
  2440. {
  2441. CDlgCloudSelection dlg;
  2442. 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);
  2443. dlg.DoModal();
  2444. lyfzLibrary::FreeCloudSelectionLib();
  2445. }
  2446. else
  2447. {
  2448. AfxMessageBox(_T("加载云选片失败,请检查模块文件是否在客户目录下!"));
  2449. }
  2450. }
  2451. void DesignFrom::OnBnClickedResult() // 获取选样结果;
  2452. {
  2453. // TODO: 在此添加控件通知处理程序代码
  2454. CDlgCloundResult dlg;
  2455. dlg.m_pList = &m_List1;
  2456. dlg.m_nAdd = m_nAdd;
  2457. dlg.m_nCloundType = 1;
  2458. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  2459. if ( pos != NULL )
  2460. {
  2461. INT nItem = m_List1.GetNextSelectedItem(pos);
  2462. dlg.m_nSelItem = nItem;
  2463. }
  2464. dlg.DoModal();
  2465. }