ModifyDinDan.cpp 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389
  1. // ModifyDinDan.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "ModifyDinDan.h"
  6. #include "MyMdi.H"
  7. #include "ClientDlg.h"
  8. #include "ClientDlg2.h"
  9. #include "SetStyle.h"
  10. #include "SPLBDlg.h"
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16. BOOL CALLBACK EnumChildProc2(HWND hwnd, LPARAM lParam)
  17. {
  18. CRect rtCtrl, rtWnd;
  19. if (hwnd)
  20. {
  21. ::GetWindowRect(hwnd, &rtCtrl);
  22. ::GetWindowRect(GetParent(hwnd), &rtWnd);
  23. // rtCtrl.OffsetRect(-rtWnd.left,-rtWnd.top-10);
  24. rtCtrl.OffsetRect(-rtWnd.left, -rtWnd.top - 20 * g_HeightScale);
  25. float temp;
  26. temp = (float)rtCtrl.left*g_WidthScale2;
  27. rtCtrl.left = (int)temp;
  28. temp = (float)rtCtrl.top*g_HeightScale2;
  29. rtCtrl.top = (int)temp;
  30. temp = (float)rtCtrl.right*g_WidthScale2;
  31. rtCtrl.right = (int)temp;
  32. temp = (float)rtCtrl.bottom*g_HeightScale2;
  33. rtCtrl.bottom = (int)temp;
  34. ::MoveWindow(hwnd, rtCtrl.left, rtCtrl.top, rtCtrl.Width(), rtCtrl.Height(), TRUE);
  35. return TRUE;
  36. }
  37. else
  38. {
  39. return FALSE;
  40. }
  41. }
  42. ////////////////////////////////////////////////////////////IDC_EDITtaoxijiage/////////////////
  43. ModifyDinDan::ModifyDinDan(CWnd* pParent /*=NULL*/)
  44. : CDialog(ModifyDinDan::IDD)
  45. {
  46. //{{AFX_DATA_INIT(ModifyDinDan) IDC_LIST9
  47. m_taoxijiage = _T("");
  48. m_zs = _T("");
  49. m_discount = _T("");
  50. m_money1 = _T("");
  51. m_money2 = _T("");
  52. m_money3 = _T("");
  53. m_name1 = _T("");
  54. m_name2 = _T("");
  55. m_payed1 = _T("");
  56. m_payed2 = _T("");
  57. m_payed3 = _T("");
  58. m_payed4 = _T("");
  59. m_payed5 = _T("");
  60. m_time1 = _T("");
  61. m_time2 = _T("");
  62. m_time3 = _T("");
  63. m_bz = _T("");
  64. m_clothescount = _T("");
  65. m_clothescount2 = _T("");
  66. m_outside = _T("");
  67. m_outside2 = _T("");
  68. m_style = _T("");
  69. m_waiter6 = g_user.name;
  70. m_id = _T("");
  71. m_time4 = _T("");
  72. m_time5 = _T("");
  73. m_choosephotomoney = _T("");
  74. m_takephotomoney = _T("");
  75. m_cost1 = 0;
  76. //}}AFX_DATA_INIT
  77. }
  78. void ModifyDinDan::DoDataExchange(CDataExchange* pDX)
  79. {
  80. CDialog::DoDataExchange(pDX);
  81. //{{AFX_DATA_MAP(ModifyDinDan)
  82. DDX_Control(pDX, IDC_LIST9, m_listbox1);
  83. DDX_Control(pDX, IDC_COMBOwaiter7, m_combowaiter7);
  84. DDX_Control(pDX, IDC_COMBOwaiter5, m_combowaiter5);
  85. DDX_Control(pDX, IDC_COMBOwaiter4, m_combowaiter4);
  86. DDX_Control(pDX, IDC_COMBOwaiter3, m_combowaiter3);
  87. DDX_Control(pDX, IDC_COMBOwaiter2, m_combowaiter2);
  88. DDX_Control(pDX, IDC_COMBOwaiter1, m_combowaiter1);
  89. DDX_Control(pDX, IDC_COMBOstatus5, m_combostatus5);
  90. DDX_Control(pDX, IDC_COMBOstatus6, m_combostatus6);
  91. DDX_Control(pDX, IDC_COMBOstatus4, m_combostatus4);
  92. DDX_Control(pDX, IDC_COMBOstatus3, m_combostatus3);
  93. DDX_Control(pDX, IDC_COMBOstatus2, m_combostatus2);
  94. DDX_Control(pDX, IDC_COMBOstatus1, m_combostatus1);
  95. DDX_Control(pDX, IDC_COMBOtype, m_combotype);
  96. DDX_Control(pDX, IDC_EDITtime8, m_datectrl5);
  97. DDX_Control(pDX, IDC_EDITtime7, m_datectrl4);
  98. DDX_Control(pDX, IDC_EDITtime3, m_datectrl2);
  99. DDX_Control(pDX, IDC_EDITtime2, m_datectrl1);
  100. DDX_Control(pDX, IDC_EDITpayed1, m_edit2);
  101. DDX_Control(pDX, IDC_EDITdiscount, m_edit1);
  102. DDX_Control(pDX, IDC_COMBObm, m_combobm);
  103. DDX_Control(pDX, IDC_COMBOrenyuan, m_comborenyuan);
  104. DDX_Control(pDX, IDC_LIST1, m_List1);
  105. DDX_Control(pDX, IDC_COMBOtaoxiname, m_combotaoxiname);
  106. DDX_Text(pDX, IDC_EDITtaoxijiage, m_taoxijiage);
  107. DDX_Text(pDX, IDC_EDITzs, m_zs);
  108. DDX_Text(pDX, IDC_EDITdiscount, m_discount);
  109. DDX_Text(pDX, IDC_EDITmoney1, m_money1);
  110. DDX_Text(pDX, IDC_EDITmoney2, m_money2);
  111. DDX_Text(pDX, IDC_EDITmoney3, m_money3);
  112. DDX_Text(pDX, IDC_EDITname1, m_name1);
  113. DDX_Text(pDX, IDC_EDITname2, m_name2);
  114. DDX_Text(pDX, IDC_EDITpayed1, m_payed1);
  115. DDX_Text(pDX, IDC_EDITpayed2, m_payed2);
  116. DDX_Text(pDX, IDC_EDITpayed3, m_payed3);
  117. DDX_Text(pDX, IDC_EDITpayed4, m_payed4);
  118. DDX_Text(pDX, IDC_EDITpayed5, m_payed5);
  119. DDX_Text(pDX, IDC_EDITtime1, m_time1);
  120. DDX_Text(pDX, IDC_EDITtime2, m_time2);
  121. DDX_Text(pDX, IDC_EDITtime3, m_time3);
  122. DDX_Text(pDX, IDC_EDITbz, m_bz);
  123. DDV_MaxChars(pDX, m_bz, 1000);
  124. DDX_Text(pDX, IDC_EDITOclothescount, m_clothescount);
  125. DDX_Text(pDX, IDC_EDITOclothescount2, m_clothescount2);
  126. DDX_Text(pDX, IDC_EDITOoutside, m_outside);
  127. DDX_Text(pDX, IDC_EDITOoutside2, m_outside2);
  128. DDX_Text(pDX, IDC_EDITwaiter6, m_waiter6);
  129. DDX_Text(pDX, IDC_EDITid3, m_id);
  130. DDX_Text(pDX, IDC_EDITtime7, m_time4);
  131. DDX_Text(pDX, IDC_EDITtime8, m_time5);
  132. DDX_Control(pDX, IDC_COMBOarea, m_comboarea);
  133. //}}AFX_DATA_MAP
  134. }
  135. BEGIN_MESSAGE_MAP(ModifyDinDan, CDialog)
  136. //{{AFX_MSG_MAP(ModifyDinDan)
  137. ON_BN_CLICKED(IDC_BUTsave, OnBUTsave)
  138. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  139. ON_CBN_SELCHANGE(IDC_COMBOtaoxiname, OnSelchangeCOMBOtaoxiname)
  140. ON_WM_TIMER()
  141. ON_EN_CHANGE(IDC_EDITtaoxijiage, OnChangeEDITtaoxijiage)
  142. ON_EN_CHANGE(IDC_EDITdiscount, OnChangeEDITdiscount)
  143. ON_EN_CHANGE(IDC_EDITpayed1, OnChangeEDITpayed1)
  144. ON_CBN_DROPDOWN(IDC_COMBObm, OnDropdownCOMBObm)
  145. ON_CBN_DROPDOWN(IDC_COMBOrenyuan, OnDropdownCOMBOrenyuan)
  146. ON_CBN_SELCHANGE(IDC_COMBObm, OnSelchangeCOMBObm)
  147. ON_BN_CLICKED(IDC_BUTclient, OnBUTclient)
  148. ON_BN_CLICKED(IDC_BUTWaiter, OnBUTWaiter)
  149. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  150. ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
  151. ON_BN_CLICKED(IDC_BUTstyle, OnBUTstyle)
  152. ON_BN_CLICKED(IDC_BUTspbox2, OnBUTspbox2)
  153. ON_BN_CLICKED(IDC_BUTdel3, OnBUTdel3)
  154. ON_BN_CLICKED(IDC_BUTaddjd, OnBUTaddjd)
  155. ON_BN_CLICKED(IDC_BUTdeljd, OnBUTdeljd)
  156. //}}AFX_MSG_MAP
  157. END_MESSAGE_MAP()
  158. /////////////////////////////////////////////////////////////////////////////
  159. // ModifyDinDan diagnostics
  160. #ifdef _DEBUG
  161. void ModifyDinDan::AssertValid() const
  162. {
  163. CDialog::AssertValid();
  164. }
  165. void ModifyDinDan::Dump(CDumpContext& dc) const
  166. {
  167. CDialog::Dump(dc);
  168. }
  169. #endif //_DEBUG
  170. /////////////////////////////////////////////////////////////////////////////
  171. // ModifyDinDan message handlers
  172. void ModifyDinDan::OnSelchangeCOMBOtaoxiname()
  173. {
  174. // TODO: Add your control notification handler code here
  175. }
  176. void ModifyDinDan::FillGrid()
  177. {
  178. return;
  179. m_List1.DeleteAllItems();
  180. int pos = 0;
  181. int i = 0;
  182. for ( i = 0; i < m_List2array.GetSize(); i++)
  183. {
  184. if (m_List2array.ElementAt(i).ElementAt(0) != m_taoxiid)continue;
  185. m_List1.InsertItem(pos, m_List2array.ElementAt(i).ElementAt(1));
  186. m_List1.SetItemText(pos, 1, GetSPNameFromId(m_List2array.ElementAt(i).ElementAt(1)));
  187. m_List1.SetItemText(pos, 2, m_List2array.ElementAt(i).ElementAt(2));
  188. pos++;
  189. }
  190. for (i = 0; i < m_List3array.GetSize(); i++)
  191. {
  192. if (m_List3array.ElementAt(i).ElementAt(0) != m_taoxiid)continue;
  193. m_List1.InsertItem(pos, m_List3array.ElementAt(i).ElementAt(1));
  194. m_List1.SetItemText(pos, 1, GetSPNameFromId(m_List3array.ElementAt(i).ElementAt(1)));
  195. m_List1.SetItemText(pos, 2, m_List3array.ElementAt(i).ElementAt(2));
  196. pos++;
  197. }
  198. }
  199. CString ModifyDinDan::GetSPPriceFromId(CString id)
  200. {
  201. for (int i = 0; i < m_sparray.GetSize(); i++)
  202. {
  203. if (id == m_sparray.ElementAt(i).ElementAt(0))
  204. return m_sparray.ElementAt(i).ElementAt(4);
  205. }
  206. return "0";
  207. }
  208. CString ModifyDinDan::GetSPPriceFromIdCost(CString id)
  209. {
  210. for (int i = 0; i < m_sparray.GetSize(); i++)
  211. {
  212. if (id == m_sparray.ElementAt(i).ElementAt(0))
  213. return m_sparray.ElementAt(i).ElementAt(3);
  214. }
  215. return "0";
  216. }
  217. CString ModifyDinDan::GetSPNameFromId(CString id)
  218. {
  219. int i = 0;
  220. for (i = 0; i < m_sparray.GetSize(); i++)
  221. {
  222. if (id == m_sparray.ElementAt(i).ElementAt(0))
  223. return m_sparray.ElementAt(i).ElementAt(1);
  224. }
  225. id.TrimLeft("0");
  226. for (i = 0; i < m_sparray.GetSize(); i++)
  227. {
  228. if (id == m_sparray.ElementAt(i).ElementAt(0))
  229. return m_sparray.ElementAt(i).ElementAt(1);
  230. }
  231. return "";
  232. }
  233. BOOL ModifyDinDan::PreTranslateMessage(MSG* pMsg)
  234. {
  235. // TODO: Add your specialized code here and/or call the base class
  236. if (0)//pMsg->message==WM_LBUTTONDBLCLK)
  237. {
  238. {//list1
  239. CPoint pt;
  240. CRect rc, rc2;
  241. ::GetCursorPos(&pt);
  242. m_List1.GetWindowRect(rc2);
  243. if (rc2.PtInRect(pt) == 0)
  244. return CDialog::PreTranslateMessage(pMsg);
  245. pt.x -= rc2.left;
  246. pt.y -= rc2.top;
  247. POSITION pos;
  248. pos = m_List1.GetFirstSelectedItemPosition();
  249. if (pos == NULL)return 1;
  250. int iItem = m_List1.GetNextSelectedItem(pos);
  251. m_List1.GetSubItemRect(iItem, 4, LVIR_BOUNDS, rc);
  252. if (rc.PtInRect(pt))
  253. return CDialog::PreTranslateMessage(pMsg);
  254. else
  255. return 1;
  256. /* if(iItem<0)
  257. {
  258. m_List1.GetHeaderCtrl()->GetItemRect (0, rc);
  259. int hei=rc.Height ();
  260. rc.top +=hei;
  261. rc.bottom +=hei;
  262. if(rc.PtInRect (pt))
  263. {
  264. m_List1.InsertItem(m_List1.GetItemCount (), "");
  265. m_List1Bakarray.SetSize(m_List1.GetItemCount ());
  266. int pos=m_List1.GetItemCount ()-1;
  267. m_List1Bakarray.ElementAt (pos).Add ("");
  268. m_List1Bakarray.ElementAt (pos).Add ("");
  269. m_List1Bakarray.ElementAt (pos).Add ("");
  270. m_List1Bakarray.ElementAt (pos).Add ("");
  271. m_List1Bakarray.ElementAt (pos).Add ("");
  272. m_List1Bakarray.ElementAt (pos).Add ("");
  273. m_List1Bakarray.ElementAt (pos).Add ("");
  274. m_List1Bakarray.ElementAt (pos).Add ("");
  275. m_List1Bakarray.ElementAt (pos).Add ("");
  276. }
  277. m_List1.GetHeaderCtrl()->GetItemRect (1, rc);
  278. rc.top +=hei;
  279. rc.bottom +=hei;
  280. if(rc.PtInRect (pt))
  281. {
  282. m_List1.InsertItem(m_List1.GetItemCount (), "");
  283. m_List1Bakarray.SetSize(m_List1.GetItemCount ());
  284. int pos=m_List1.GetItemCount ()-1;
  285. m_List1Bakarray.ElementAt (pos).Add ("");
  286. m_List1Bakarray.ElementAt (pos).Add ("");
  287. m_List1Bakarray.ElementAt (pos).Add ("");
  288. m_List1Bakarray.ElementAt (pos).Add ("");
  289. m_List1Bakarray.ElementAt (pos).Add ("");
  290. m_List1Bakarray.ElementAt (pos).Add ("");
  291. m_List1Bakarray.ElementAt (pos).Add ("");
  292. m_List1Bakarray.ElementAt (pos).Add ("");
  293. m_List1Bakarray.ElementAt (pos).Add ("");
  294. }
  295. }
  296. else
  297. {
  298. m_List1.GetSubItemRect( iItem, 0, LVIR_BOUNDS, rc);
  299. int hei=rc.Height ();
  300. rc.top +=hei;
  301. rc.bottom +=hei;
  302. if(rc.PtInRect (pt))
  303. {
  304. if(m_List1.GetItemText (iItem, 0).IsEmpty ()&&m_List1.GetItemText (iItem, 1).IsEmpty ())
  305. goto ll;
  306. m_List1.InsertItem(m_List1.GetItemCount (), "");
  307. m_List1Bakarray.SetSize(m_List1.GetItemCount ());
  308. int pos=m_List1.GetItemCount ()-1;
  309. m_List1Bakarray.ElementAt (pos).Add ("");
  310. m_List1Bakarray.ElementAt (pos).Add ("");
  311. m_List1Bakarray.ElementAt (pos).Add ("");
  312. m_List1Bakarray.ElementAt (pos).Add ("");
  313. m_List1Bakarray.ElementAt (pos).Add ("");
  314. m_List1Bakarray.ElementAt (pos).Add ("");
  315. m_List1Bakarray.ElementAt (pos).Add ("");
  316. m_List1Bakarray.ElementAt (pos).Add ("");
  317. m_List1Bakarray.ElementAt (pos).Add ("");
  318. }
  319. POSITION pos;
  320. pos=m_List1.GetFirstSelectedItemPosition();
  321. if(pos)
  322. {
  323. iItem=m_List1.GetNextSelectedItem(pos);
  324. if(m_List1Bakarray.ElementAt (iItem).ElementAt (8).IsEmpty ()==0)
  325. {
  326. AfxMessageBox("此物品已选片, 不能修改!", MB_ICONSTOP);
  327. return 1;
  328. }
  329. if(m_List1Bakarray.ElementAt (iItem).ElementAt (2)!="" || m_List1Bakarray.ElementAt (iItem).ElementAt (3)!="")
  330. {
  331. AfxMessageBox("此物品已制作, 不能修改!", MB_ICONSTOP);
  332. return 1;
  333. }
  334. if(m_List1Bakarray.ElementAt (iItem).ElementAt (4)!="未完成" && m_List1Bakarray.ElementAt (iItem).ElementAt (4)!="")
  335. {
  336. AfxMessageBox("此物品已制作, 不能修改!", MB_ICONSTOP);
  337. return 1;
  338. }
  339. if(m_List1Bakarray.ElementAt (iItem).ElementAt (5)!="未取" && m_List1Bakarray.ElementAt (iItem).ElementAt (5)!="")
  340. {
  341. AfxMessageBox("此物品已制作, 不能修改!", MB_ICONSTOP);
  342. return 1;
  343. }
  344. }
  345. }*/
  346. }
  347. }
  348. if (pMsg->message == WM_LBUTTONUP)
  349. {
  350. {//list1
  351. CPoint pt;
  352. CRect rc, rc2;
  353. ::GetCursorPos(&pt);
  354. m_List1.GetWindowRect(rc2);
  355. if (rc2.PtInRect(pt) == 0)return CDialog::PreTranslateMessage(pMsg);
  356. CalculateCost();
  357. }
  358. }
  359. return CDialog::PreTranslateMessage(pMsg);
  360. }
  361. void ModifyDinDan::SetSPName1()
  362. {
  363. for (int i = 0; i < m_List1.GetItemCount(); i++)
  364. {
  365. if (GetSPNameFromId(m_List1.GetItemText(i, 1)) != "")
  366. m_List1.SetItemText(i, 2, GetSPNameFromId(m_List1.GetItemText(i, 1)));
  367. }
  368. }
  369. void ModifyDinDan::OnTimer(UINT nIDEvent)
  370. {
  371. // TODO: Add your message handler code here and/or call default
  372. if (nIDEvent == 1)
  373. {
  374. KillTimer(nIDEvent);
  375. SetSPName1();
  376. }
  377. }
  378. void ModifyDinDan::OnBUTsave()
  379. {
  380. if (IsHasRights2(0) == 0)
  381. return;
  382. // TODO: Add your control notification handler code here
  383. UpdateData();
  384. int pos;
  385. CString id = m_id;
  386. BOOL bAdd = 0;
  387. if (m_name1.IsEmpty() && m_name2.IsEmpty())
  388. {
  389. AfxMessageBox("资料不全!", MB_ICONINFORMATION);
  390. return;
  391. }
  392. CString taoxiname;
  393. pos = m_combotaoxiname.GetCurSel();
  394. if (pos != -1)
  395. {
  396. m_combotaoxiname.GetLBText(pos, taoxiname);
  397. }
  398. else
  399. {
  400. m_combotaoxiname.GetWindowText(taoxiname);
  401. m_taoxiid.Empty();
  402. }
  403. CString bm, txtype;
  404. pos = m_combobm.GetCurSel();
  405. if (pos != -1)
  406. {
  407. m_combobm.GetLBText(pos, bm);
  408. }
  409. CString ren;
  410. pos = m_comborenyuan.GetCurSel();
  411. if (pos != -1)
  412. {
  413. m_comborenyuan.GetLBText(pos, ren);
  414. }
  415. else
  416. {
  417. AfxMessageBox("资料不全!", MB_ICONINFORMATION);
  418. return;
  419. }
  420. pos = m_combotype.GetCurSel();
  421. if (pos != -1)
  422. {
  423. m_combotype.GetLBText(pos, txtype);
  424. }
  425. else
  426. {
  427. AfxMessageBox("资料不全,打*号的项目必须填写!", MB_ICONINFORMATION);
  428. return;
  429. }
  430. if (!CheckDateOK(m_time2))return;
  431. if (!CheckDateOK(m_time3))return;
  432. if (!CheckDateOK(m_time4))return;
  433. if (!CheckDateOK(m_time5))return;
  434. CalculateCost();
  435. #ifdef ZHIAI_VERSION
  436. CString area;
  437. pos=m_comboarea.GetCurSel ();
  438. if(pos!=-1)
  439. {
  440. m_comboarea.GetLBText (pos, area);
  441. }
  442. m_outside=area;
  443. #endif
  444. #ifndef NOCALCOST
  445. if (atof(m_taoxijiage) < m_cost1)
  446. {
  447. if (AfxMessageBox("警告:套系价格低于成本, 可能是亏本生意, 是否继续?", MB_YESNO | MB_ICONSTOP) != IDYES)return;
  448. }
  449. #endif
  450. CString m_waiter1, m_waiter2, m_waiter3, m_waiter4, m_waiter5, m_waiter7;
  451. CString m_status1, m_status2, m_status3, m_status4, m_status5, m_status6;
  452. pos = m_combowaiter1.GetCurSel();
  453. if (pos != -1)
  454. {
  455. m_combowaiter1.GetLBText(pos, m_waiter1);
  456. }
  457. pos = m_combowaiter2.GetCurSel();
  458. if (pos != -1)
  459. {
  460. m_combowaiter2.GetLBText(pos, m_waiter2);
  461. }
  462. pos = m_combowaiter3.GetCurSel();
  463. if (pos != -1)
  464. {
  465. m_combowaiter3.GetLBText(pos, m_waiter3);
  466. }
  467. pos = m_combowaiter4.GetCurSel();
  468. if (pos != -1)
  469. {
  470. m_combowaiter4.GetLBText(pos, m_waiter4);
  471. }
  472. pos = m_combowaiter5.GetCurSel();
  473. if (pos != -1)
  474. {
  475. m_combowaiter5.GetLBText(pos, m_waiter5);
  476. }
  477. pos = m_combowaiter7.GetCurSel();
  478. if (pos != -1)
  479. {
  480. m_combowaiter7.GetLBText(pos, m_waiter7);
  481. }
  482. pos = m_combostatus1.GetCurSel();
  483. if (pos != -1)
  484. {
  485. m_combostatus1.GetLBText(pos, m_status1);
  486. }
  487. pos = m_combostatus2.GetCurSel();
  488. if (pos != -1)
  489. {
  490. m_combostatus2.GetLBText(pos, m_status2);
  491. }
  492. pos = m_combostatus3.GetCurSel();
  493. if (pos != -1)
  494. {
  495. m_combostatus3.GetLBText(pos, m_status3);
  496. }
  497. pos = m_combostatus4.GetCurSel();
  498. if (pos != -1)
  499. {
  500. m_combostatus4.GetLBText(pos, m_status4);
  501. }
  502. pos = m_combostatus5.GetCurSel();
  503. if (pos != -1)
  504. {
  505. m_combostatus5.GetLBText(pos, m_status5);
  506. }
  507. pos = m_combostatus6.GetCurSel();
  508. if (pos != -1)
  509. {
  510. m_combostatus6.GetLBText(pos, m_status6);
  511. }
  512. CString sql, str, str2;
  513. CString strRes1, strRes2;
  514. ChinesePinYin::GetFirstLetter(m_name1, strRes1);
  515. ChinesePinYin::GetFirstLetter(m_name2, strRes2);
  516. m_waiter6 = g_user.name;
  517. sql.Format("update dindan set name1='%s',name2='%s',taoxiid='%s',taoxiname='%s',taoxizs='%s',time2='%s',time3='%s',time4='%s',time5='%s',waiter1='%s',waiter2='%s',waiter3='%s',waiter4='%s',waiter5='%s',waiter6='%s',waiter7='%s',status='%s',status2='%s',status3='%s',status4='%s',status5='%s',status6='%s',bm='%s',ren='%s',bz='%s',pinyin1='%s',pinyin2='%s',clothescount='%s',clothescount2='%s',outside='%s',outside2='%s',style='%s',taoxijiage='%s',txtype='%s' where id='%s' ",
  518. m_name1, m_name2, m_taoxiid, taoxiname, m_zs, m_time2, m_time3, m_time4, m_time5, m_waiter1, m_waiter2, m_waiter3, m_waiter4, m_waiter5, m_waiter6, m_waiter7, m_status1, m_status2, m_status3, m_status4, m_status5, m_status6, bm, ren, FilterBZ(m_bz), strRes1, strRes2, m_clothescount, m_clothescount2, m_outside, m_outside2, m_style, m_taoxijiage, txtype, id);
  519. #if JEFF_TEST_ON
  520. // 2015-05-30 若取件状态OK,写日志;
  521. if ( m_status3 == _T("OK") )
  522. {
  523. CString strLog;
  524. strLog.Format(_T(" 订单:%s 在预约修改中被设置为取件OK"),id);
  525. WriteLog("取件", strLog);
  526. }
  527. #endif
  528. sql += "***update client set name1='" + m_name1 + "',name2='" + m_name2 + "' where id='" + id + "'";
  529. if (!m_time3.IsEmpty())
  530. {
  531. CString sql2;
  532. sql2.Format("***update dindansp set hqdate='%s' where id='%s' and hqdate is null", m_time3, id);
  533. sql += sql2;
  534. }
  535. g_sendhead.bsql = 1;
  536. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  537. CArray<CStringArray, CStringArray>sparray;
  538. sparray.SetSize(m_List1.GetItemCount() + m_listbox1.GetCount());
  539. int realcount = 0;
  540. int i = 0;
  541. for ( i = 0; i < m_List1.GetItemCount(); i++)
  542. {
  543. str = m_List1.GetItemText(i, 1);
  544. str.TrimLeft(); str.TrimRight();
  545. str2 = m_List1.GetItemText(i, 2);
  546. str2.TrimLeft(); str2.TrimRight();
  547. if (str.IsEmpty() && str2.IsEmpty())continue;
  548. sparray.ElementAt(realcount).Add(id);
  549. sparray.ElementAt(realcount).Add(m_List1.GetItemText(i, 0));
  550. sparray.ElementAt(realcount).Add(m_List1.GetItemText(i, 1));
  551. sparray.ElementAt(realcount).Add(m_List1.GetItemText(i, 2));
  552. sparray.ElementAt(realcount).Add(m_List1.GetItemText(i, 3));
  553. sparray.ElementAt(realcount).Add(m_List1.GetItemText(i, 4));
  554. sparray.ElementAt(realcount).Add(m_kindarray.ElementAt(i));
  555. sparray.ElementAt(realcount).Add(m_List1.GetItemText(i, 5));
  556. sparray.ElementAt(realcount).Add(m_List1.GetItemText(i, 6));
  557. realcount++;
  558. }
  559. for (i = 0; i < m_listbox1.GetCount(); i++)
  560. {
  561. m_listbox1.GetText(i, str);
  562. sparray.ElementAt(realcount).Add(id);
  563. sparray.ElementAt(realcount).Add(str);
  564. realcount++;
  565. }
  566. sparray.SetSize(realcount);
  567. if (realcount == 0)
  568. {
  569. sparray.SetSize(1);
  570. sparray.ElementAt(0).Add(id);
  571. }
  572. CMemFile memfile;
  573. CArchive ar(&memfile, CArchive::store);
  574. for (int ii = 0; ii < sparray.GetSize(); ii++)
  575. {
  576. sparray.ElementAt(ii).Serialize(ar);
  577. }
  578. ar.Close();
  579. int length = memfile.GetLength();
  580. BYTE *pData = memfile.Detach();
  581. int size = sparray.GetSize();
  582. BYTE *pData2 = new BYTE[length + sizeof(int)];
  583. memcpy(pData2, pData, length);
  584. memcpy(pData2 + length, &size, sizeof(int));
  585. delete[]pData;
  586. length += sizeof(int);
  587. g_nSendCode = 8;
  588. g_pMainWnd->ProcessChatMessageRequest2(pData2, length);
  589. g_nSendCode = 0;
  590. delete[]pData2;
  591. if (g_bSendOK == 0)return;
  592. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  593. CDialog::OnOK();
  594. }
  595. void ModifyDinDan::OnBUTclose()
  596. {
  597. // TODO: Add your control notification handler code here
  598. CDialog::OnCancel();
  599. }
  600. void ModifyDinDan::OnChangeEDITtaoxijiage()
  601. {
  602. // TODO: If this is a RICHEDIT control, the control will not
  603. // send this notification unless you override the CDialog::OnInitDialog()
  604. // function and call CRichEditCtrl().SetEventMask()
  605. // with the ENM_CHANGE flag ORed into the mask.
  606. UpdateData();
  607. CString str;
  608. float list3money = 0;
  609. m_money1.Format("%f", list3money + atof(m_taoxijiage) - atof(m_discount) + atof(m_payed4));
  610. m_money2.Format("%f", atof(m_payed5));
  611. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  612. ConvertToPrice(m_money1);
  613. ConvertToPrice(m_money2);
  614. ConvertToPrice(m_money3);
  615. UpdateData(false);
  616. // TODO: Add your control notification handler code here
  617. }
  618. void ModifyDinDan::OnChangeEDITdiscount()
  619. {
  620. // TODO: If this is a RICHEDIT control, the control will not
  621. // send this notification unless you override the CDialog::OnInitDialog()
  622. // function and call CRichEditCtrl().SetEventMask()
  623. // with the ENM_CHANGE flag ORed into the mask.
  624. OnChangeEDITtaoxijiage();
  625. // TODO: Add your control notification handler code here
  626. }
  627. void ModifyDinDan::OnChangeEDITpayed1()
  628. {
  629. // TODO: If this is a RICHEDIT control, the control will not
  630. // send this notification unless you override the CDialog::OnInitDialog()
  631. // function and call CRichEditCtrl().SetEventMask()
  632. // with the ENM_CHANGE flag ORed into the mask.
  633. OnChangeEDITtaoxijiage();
  634. // TODO: Add your control notification handler code here
  635. }
  636. void ModifyDinDan::OnDropdownCOMBObm()
  637. {
  638. // TODO: Add your control notification handler code here
  639. if (m_combobm.GetCount() < 2)
  640. {
  641. g_sendhead.bsql = 0;
  642. g_sendhead.code[0] = 3;
  643. g_sendhead.tabcount = 1;
  644. g_pMainWnd->ProcessChatMessageRequest2(3); if (g_bSendOK == 0)return;
  645. DataToArray(&g_List1array);
  646. for (int ii = 0; ii < g_List1array.GetSize(); ii++)
  647. m_combobm.AddString(g_List1array.ElementAt(ii).ElementAt(0));
  648. }
  649. }
  650. void ModifyDinDan::OnDropdownCOMBOrenyuan()
  651. {
  652. // TODO: Add your control notification handler code here
  653. if (m_renyuanarray.GetSize() == 0)
  654. {
  655. for (int ii = 0; ii < g_userarray.GetSize(); ii++)
  656. {
  657. m_renyuanarray.Add(g_userarray.ElementAt(ii).ElementAt(2));
  658. m_renyuanarray.Add(g_userarray.ElementAt(ii).ElementAt(1));
  659. }
  660. }
  661. m_comborenyuan.ResetContent();
  662. int pos = m_combobm.GetCurSel();
  663. if (pos == -1)
  664. {
  665. for (int ii = 0; ii < m_renyuanarray.GetSize(); ii += 2)
  666. {
  667. m_comborenyuan.AddString(m_renyuanarray.ElementAt(ii + 1));
  668. }
  669. }
  670. else
  671. {
  672. CString str;
  673. m_combobm.GetLBText(pos, str);
  674. for (int ii = 0; ii < m_renyuanarray.GetSize(); ii += 2)
  675. {
  676. if (str == m_renyuanarray.ElementAt(ii))
  677. m_comborenyuan.AddString(m_renyuanarray.ElementAt(ii + 1));
  678. }
  679. }
  680. }
  681. void ModifyDinDan::OnSelchangeCOMBObm()
  682. {
  683. // TODO: Add your control notification handler code here
  684. m_comborenyuan.ResetContent();
  685. m_comborenyuan.SetCurSel(-1);
  686. }
  687. void ModifyDinDan::ClearCtrl()
  688. {
  689. m_money1 = _T("");
  690. m_money2 = _T("");
  691. m_money3 = _T("");
  692. m_choosephotomoney = _T("");
  693. m_name1 = _T("");
  694. m_name2 = _T("");
  695. m_taoxiid = _T("");
  696. m_taoxijiage = _T("");
  697. m_zs = _T("");
  698. m_time1 = CTime::GetCurrentTime().Format("%Y-%m-%d");
  699. m_time2 = _T("");
  700. m_time3 = _T("");
  701. m_bz = _T("");
  702. m_discount = _T("");
  703. m_payed1 = _T("");
  704. m_payed2 = _T("");
  705. m_payed3 = _T("");
  706. m_payed4 = _T("");
  707. m_payed5 = _T("");
  708. m_clothescount = _T("");
  709. m_clothescount2 = _T("");
  710. m_outside = _T("");
  711. m_outside2 = _T("");
  712. m_style = _T("");
  713. m_waiter1 = _T("");
  714. m_waiter2 = _T("");
  715. m_waiter3 = _T("");
  716. m_waiter4 = _T("");
  717. m_waiter6 = g_user.name;
  718. m_combotaoxiname.SetCurSel(-1);
  719. m_combobm.SetCurSel(-1);
  720. m_comborenyuan.SetCurSel(-1);
  721. UpdateData(false);
  722. m_List1.DeleteAllItems();
  723. }
  724. void ModifyDinDan::OnBUTclient()
  725. {
  726. // TODO: Add your control notification handler code here
  727. UpdateData();
  728. #ifdef CHILD_VERSION
  729. CClientDlg2 dlg;
  730. #else
  731. CClientDlg dlg;
  732. #endif
  733. dlg.m_bAdd = 0;
  734. dlg.id = m_id;
  735. dlg.m_name1 = m_name1;
  736. dlg.m_name2 = m_name2;
  737. if (dlg.DoModal() != IDOK)return;
  738. m_name1 = dlg.m_name1;
  739. m_name2 = dlg.m_name2;
  740. UpdateData(false);
  741. }
  742. void ModifyDinDan::OnBUTWaiter()
  743. {
  744. }
  745. void ModifyDinDan::OnButton1()
  746. {
  747. }
  748. void ModifyDinDan::OnBUTprint()
  749. {
  750. // TODO: Add your control notification handler code here
  751. g_pMainWnd->PrintDinDan(m_id);
  752. }
  753. void ModifyDinDan::OnBUTstyle()
  754. {
  755. // TODO: Add your control notification handler code here
  756. SetStyle dlg;
  757. dlg.m_style = m_style;
  758. if (dlg.DoModal() == IDOK)
  759. m_style = dlg.m_style;
  760. }
  761. void ModifyDinDan::OnBUTspbox2()
  762. {
  763. // TODO: Add your control notification handler code here
  764. SPBox dlg;
  765. if (dlg.DoModal() != IDOK)return;
  766. for (int a = 0; a < dlg.m_spidarray.GetSize(); a++)
  767. {
  768. dlg.m_spid = dlg.m_spidarray.ElementAt(a);
  769. dlg.m_spname = dlg.m_spnamearray.ElementAt(a);
  770. dlg.m_lb = dlg.m_lbarray.ElementAt(a);
  771. int pos = m_List1.GetItemCount();
  772. CString str;
  773. if (dlg.m_lb == "婚庆服务")
  774. m_kindarray.Add("2");
  775. else
  776. m_kindarray.Add("1");
  777. m_List1.InsertItem(pos, "");
  778. m_List1.SetItemText(pos, 1, dlg.m_spid);
  779. m_List1.SetItemText(pos, 2, dlg.m_spname);
  780. m_List1.SetItemText(pos, 3, GetSPPriceFromId(dlg.m_spid));
  781. m_List1.SetItemText(pos, 4, "1");
  782. m_List1Bakarray.SetSize(m_List1.GetItemCount());
  783. m_List1Bakarray.ElementAt(pos).Add("");
  784. m_List1Bakarray.ElementAt(pos).Add("");
  785. m_List1Bakarray.ElementAt(pos).Add("");
  786. m_List1Bakarray.ElementAt(pos).Add("");
  787. m_List1Bakarray.ElementAt(pos).Add("");
  788. m_List1Bakarray.ElementAt(pos).Add("");
  789. m_List1Bakarray.ElementAt(pos).Add("");
  790. m_List1Bakarray.ElementAt(pos).Add("");
  791. m_List1Bakarray.ElementAt(pos).Add("");
  792. }
  793. CalculateCost();
  794. }
  795. void ModifyDinDan::OnBUTdel3()
  796. {
  797. // TODO: Add your control notification handler code here
  798. POSITION pos;
  799. pos = m_List1.GetFirstSelectedItemPosition();
  800. if (pos == NULL)
  801. {
  802. AfxMessageBox("请先选中您要删除的项目!", MB_ICONINFORMATION);
  803. return;
  804. }
  805. int iItem = m_List1.GetNextSelectedItem(pos);
  806. if (m_List1Bakarray.ElementAt(iItem).ElementAt(8).IsEmpty() == 0)
  807. {
  808. AfxMessageBox("此物品已选片, 不能删除!", MB_ICONSTOP);
  809. return;
  810. }
  811. if (m_List1Bakarray.ElementAt(iItem).ElementAt(2) != "" || m_List1Bakarray.ElementAt(iItem).ElementAt(3) != "")
  812. {
  813. AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP);
  814. return;
  815. }
  816. if (m_List1Bakarray.ElementAt(iItem).ElementAt(4) != "未完成" && m_List1Bakarray.ElementAt(iItem).ElementAt(4) != "")
  817. {
  818. AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP);
  819. return;
  820. }
  821. if (m_List1Bakarray.ElementAt(iItem).ElementAt(5) != "未取" && m_List1Bakarray.ElementAt(iItem).ElementAt(5) != "")
  822. {
  823. AfxMessageBox("此物品已制作, 不能删除!", MB_ICONSTOP);
  824. return;
  825. }
  826. m_List1.DeleteItem(iItem);
  827. m_List1Bakarray.RemoveAt(iItem);
  828. m_kindarray.RemoveAt(iItem);
  829. CalculateCost();
  830. int count = m_List1.GetItemCount();
  831. if (count == 0)return;
  832. if (iItem == count)
  833. iItem = 0;
  834. m_List1.SetItemState(iItem, LVIS_SELECTED, LVIS_SELECTED);
  835. }
  836. BOOL ModifyDinDan::OnInitDialog()
  837. {
  838. CDialog::OnInitDialog();
  839. #ifdef NOCALCOST
  840. GetDlgItem(IDC_STATIC1)->ShowWindow(SW_HIDE);
  841. #endif
  842. #ifndef CHILD_VERSION
  843. #ifndef ZHIAI_VERSION
  844. GetDlgItem(IDC_STATIC10)->SetWindowText("服装套数:");
  845. GetDlgItem(IDC_STATIC11)->SetWindowText("造型:");
  846. GetDlgItem(IDC_STATIC12)->SetWindowText("外景:");
  847. GetDlgItem(IDC_STATIC13)->SetWindowText("内景:");
  848. #endif
  849. #endif
  850. // TODO: Add extra initialization here
  851. CRect rc2;
  852. GetWindowRect(rc2);
  853. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  854. g_WidthScale2 = (float)g_rc.Width() / (float)rc2.Width(); // new/Old
  855. g_HeightScale2 = (float)g_rc.Height() / (float)rc2.Height();
  856. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc2, 0);
  857. GetDlgItem(IDC_BUTsave)->EnableWindow(IsHasRights2new(1));
  858. GetDlgItem(IDC_BUTclient)->EnableWindow(IsHasRights2new(1));
  859. m_combotaoxiname.GetWindowRect(rc2);
  860. ScreenToClient(rc2);
  861. rc2.bottom += 200;
  862. m_combotaoxiname.MoveWindow(rc2);
  863. m_combobm.GetWindowRect(rc2);
  864. ScreenToClient(rc2);
  865. rc2.bottom += 200;
  866. m_combobm.MoveWindow(rc2);
  867. m_comborenyuan.GetWindowRect(rc2);
  868. ScreenToClient(rc2);
  869. rc2.bottom += 200;
  870. m_comborenyuan.MoveWindow(rc2);
  871. m_combowaiter1.GetWindowRect(rc2);
  872. ScreenToClient(rc2);
  873. rc2.bottom += 400;
  874. m_combowaiter1.MoveWindow(rc2);
  875. m_combowaiter2.GetWindowRect(rc2);
  876. ScreenToClient(rc2);
  877. rc2.bottom += 400;
  878. m_combowaiter2.MoveWindow(rc2);
  879. m_combowaiter3.GetWindowRect(rc2);
  880. ScreenToClient(rc2);
  881. rc2.bottom += 400;
  882. m_combowaiter3.MoveWindow(rc2);
  883. m_combowaiter4.GetWindowRect(rc2);
  884. ScreenToClient(rc2);
  885. rc2.bottom += 400;
  886. m_combowaiter4.MoveWindow(rc2);
  887. m_combowaiter5.GetWindowRect(rc2);
  888. ScreenToClient(rc2);
  889. rc2.bottom += 400;
  890. m_combowaiter5.MoveWindow(rc2);
  891. m_combowaiter7.GetWindowRect(rc2);
  892. ScreenToClient(rc2);
  893. rc2.bottom += 400;
  894. m_combowaiter7.MoveWindow(rc2);
  895. m_combostatus1.GetWindowRect(rc2);
  896. ScreenToClient(rc2);
  897. rc2.bottom += 200;
  898. m_combostatus1.MoveWindow(rc2);
  899. m_combotype.GetWindowRect(rc2);
  900. ScreenToClient(rc2);
  901. rc2.bottom += 200;
  902. m_combotype.MoveWindow(rc2);
  903. m_combostatus2.GetWindowRect(rc2);
  904. ScreenToClient(rc2);
  905. rc2.bottom += 200;
  906. m_combostatus2.MoveWindow(rc2);
  907. m_combostatus3.GetWindowRect(rc2);
  908. ScreenToClient(rc2);
  909. rc2.bottom += 200;
  910. m_combostatus3.MoveWindow(rc2);
  911. m_combostatus4.GetWindowRect(rc2);
  912. ScreenToClient(rc2);
  913. rc2.bottom += 200;
  914. m_combostatus4.MoveWindow(rc2);
  915. m_combostatus5.GetWindowRect(rc2);
  916. ScreenToClient(rc2);
  917. rc2.bottom += 200;
  918. m_combostatus5.MoveWindow(rc2);
  919. m_combostatus6.GetWindowRect(rc2);
  920. ScreenToClient(rc2);
  921. rc2.bottom += 200;
  922. m_combostatus6.MoveWindow(rc2);
  923. GetDlgItem(IDC_EDITname1)->GetWindowRect(rc2);
  924. SetComboHei(&m_combotaoxiname, rc2.Height());
  925. SetComboHei(&m_combobm, rc2.Height());
  926. SetComboHei(&m_comborenyuan, rc2.Height());
  927. SetComboHei(&m_combowaiter1, rc2.Height());
  928. SetComboHei(&m_combowaiter2, rc2.Height());
  929. SetComboHei(&m_combowaiter3, rc2.Height());
  930. SetComboHei(&m_combowaiter4, rc2.Height());
  931. SetComboHei(&m_combowaiter5, rc2.Height());
  932. SetComboHei(&m_combowaiter7, rc2.Height());
  933. SetComboHei(&m_combostatus1, rc2.Height());
  934. SetComboHei(&m_combotype, rc2.Height());
  935. SetComboHei(&m_combostatus2, rc2.Height());
  936. SetComboHei(&m_combostatus3, rc2.Height());
  937. SetComboHei(&m_combostatus4, rc2.Height());
  938. SetComboHei(&m_combostatus5, rc2.Height());
  939. SetComboHei(&m_combostatus6, rc2.Height());
  940. #ifdef ZHIAI_VERSION
  941. SetComboHei(&m_comboarea, rc2.Height ());
  942. GetDlgItem(IDC_EDITOoutside)->GetWindowRect(rc2);
  943. GetDlgItem(IDC_EDITOoutside)->ShowWindow(0);
  944. ScreenToClient(rc2);
  945. m_comboarea.MoveWindow (rc2);
  946. m_comboarea.GetWindowRect (rc2);
  947. ScreenToClient(rc2);
  948. rc2.bottom +=600;
  949. m_comboarea.MoveWindow (rc2);
  950. #else
  951. m_comboarea.ShowWindow(0);
  952. #endif
  953. m_combotype.AddString("婚纱照");
  954. m_combotype.AddString("写真照");
  955. m_combotype.AddString("宝宝照");
  956. m_combotype.AddString("全家福");
  957. m_combotype.AddString("情侣照");
  958. m_combostatus1.AddString("未拍");
  959. m_combostatus1.AddString("拍照中");
  960. m_combostatus1.AddString("OK");
  961. m_combostatus2.AddString("未选");
  962. m_combostatus2.AddString("OK");
  963. m_combostatus3.AddString("未取");
  964. m_combostatus3.AddString("OK");
  965. m_combostatus4.AddString("未修");
  966. m_combostatus4.AddString("修片中");
  967. m_combostatus4.AddString("OK");
  968. m_combostatus5.AddString("未设计");
  969. m_combostatus5.AddString("设计中");
  970. m_combostatus5.AddString("OK");
  971. m_combostatus6.AddString("未修");
  972. m_combostatus6.AddString("修片中");
  973. m_combostatus6.AddString("OK");
  974. m_List1.InitStyle();
  975. m_List1.m_mode = 1;
  976. m_List1.InsertColumn(0, _T("autuid"), LVCFMT_LEFT, 0);
  977. m_List1.InsertColumn(1, _T("编号"), LVCFMT_LEFT, 55);
  978. m_List1.InsertColumn(2, _T("商品名称"), LVCFMT_LEFT, 190);
  979. m_List1.InsertColumn(3, _T("价格"), LVCFMT_LEFT, 55);
  980. m_List1.InsertColumn(4, _T("数量"), LVCFMT_LEFT, 55);
  981. m_List1.InsertColumn(5, _T("加急"), LVCFMT_LEFT, 45);
  982. m_List1.InsertColumn(6, _T("取件日期"), LVCFMT_LEFT, 90);
  983. CString id = m_id;
  984. int i;
  985. #ifdef ZHIAI_VERSION
  986. g_sendhead.bsql=0;
  987. CString filter="id='"+id+"';id='"+id+"' and kind<>'4' and kind<>'5';id='"+id+"';;;;";
  988. g_sendhead.code[0]=11;
  989. g_sendhead.code[1] = 56;
  990. g_sendhead.code[2]=150;
  991. g_sendhead.code[3]=4;
  992. g_sendhead.code[4]=6;
  993. g_sendhead.code[5]=82;
  994. g_sendhead.tabcount=6;
  995. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return 1;
  996. CArray<CStringArray, CStringArray>txarray;
  997. CArray<CStringArray, CStringArray>areaarray;
  998. DataToArray(&g_List1array, &m_List1Bakarray,&m_List1array, &m_sparray, &txarray, &areaarray);
  999. for( i=0; i<areaarray.GetSize(); i++)
  1000. {
  1001. m_comboarea.AddString(areaarray.ElementAt(i).ElementAt(0));
  1002. }
  1003. #else
  1004. g_sendhead.bsql = 0;
  1005. CString filter = "id='" + id + "';id='" + id + "' and kind<>'4' and kind<>'5';id='" + id + "';;;;";
  1006. g_sendhead.code[0] = 11;
  1007. g_sendhead.code[1] = 56;
  1008. g_sendhead.code[2] = 150;
  1009. g_sendhead.code[3] = 4;
  1010. g_sendhead.code[4] = 6;
  1011. g_sendhead.tabcount = 5;
  1012. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return 1;
  1013. CArray<CStringArray, CStringArray>txarray;
  1014. DataToArray(&g_List1array, &m_List1Bakarray, &m_List1array, &m_sparray, &txarray);
  1015. #endif
  1016. for (i = 0; i < txarray.GetSize(); i++)
  1017. m_combotaoxiname.AddString(txarray.ElementAt(i).ElementAt(1));
  1018. m_combowaiter1.AddString("");
  1019. m_combowaiter2.AddString("");
  1020. m_combowaiter3.AddString("");
  1021. m_combowaiter4.AddString("");
  1022. m_combowaiter5.AddString("");
  1023. m_combowaiter7.AddString("");
  1024. for (i = 0; i < g_userarray.GetSize(); i++)
  1025. {
  1026. m_combowaiter1.AddString(g_userarray.ElementAt(i).ElementAt(1));
  1027. m_combowaiter2.AddString(g_userarray.ElementAt(i).ElementAt(1));
  1028. m_combowaiter3.AddString(g_userarray.ElementAt(i).ElementAt(1));
  1029. m_combowaiter4.AddString(g_userarray.ElementAt(i).ElementAt(1));
  1030. m_combowaiter5.AddString(g_userarray.ElementAt(i).ElementAt(1));
  1031. m_combowaiter7.AddString(g_userarray.ElementAt(i).ElementAt(1));
  1032. }
  1033. for (i = 0; i < m_List1array.GetSize(); i++)
  1034. {
  1035. m_listbox1.AddString(m_List1array.ElementAt(i).ElementAt(1));
  1036. }
  1037. //////////////////////////////////
  1038. CString taoxiname, bm, ren, txtype;
  1039. CString m_waiter1, m_waiter2, m_waiter3, m_waiter4, m_waiter5, m_waiter7;
  1040. CString m_status1, m_status2, m_status3, m_status4, m_status5, m_status6;
  1041. m_takephotomoney = g_List1array.ElementAt(0).ElementAt(2);
  1042. m_choosephotomoney = g_List1array.ElementAt(0).ElementAt(3);
  1043. m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  1044. m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  1045. m_taoxiid = g_List1array.ElementAt(0).ElementAt(6);
  1046. taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  1047. m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  1048. m_zs = g_List1array.ElementAt(0).ElementAt(9);
  1049. m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  1050. m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  1051. m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  1052. bm = g_List1array.ElementAt(0).ElementAt(13);
  1053. ren = g_List1array.ElementAt(0).ElementAt(14);
  1054. m_discount = g_List1array.ElementAt(0).ElementAt(15);
  1055. m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  1056. m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  1057. m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  1058. m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  1059. m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  1060. m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  1061. m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  1062. m_status1 = g_List1array.ElementAt(0).ElementAt(25);
  1063. m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  1064. m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  1065. m_outside = g_List1array.ElementAt(0).ElementAt(28);
  1066. m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  1067. m_style = g_List1array.ElementAt(0).ElementAt(30);
  1068. m_status2 = g_List1array.ElementAt(0).ElementAt(32);
  1069. m_status3 = g_List1array.ElementAt(0).ElementAt(33);
  1070. m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  1071. m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  1072. m_waiter3 = g_List1array.ElementAt(0).ElementAt(36);
  1073. m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  1074. m_bz = g_List1array.ElementAt(0).ElementAt(38);
  1075. m_waiter6 = g_List1array.ElementAt(0).ElementAt(41);
  1076. m_waiter5 = g_List1array.ElementAt(0).ElementAt(42);
  1077. m_waiter7 = g_List1array.ElementAt(0).ElementAt(43);
  1078. m_status4 = g_List1array.ElementAt(0).ElementAt(44);
  1079. m_status5 = g_List1array.ElementAt(0).ElementAt(45);
  1080. m_status6 = g_List1array.ElementAt(0).ElementAt(46);
  1081. txtype = g_List1array.ElementAt(0).ElementAt(52);
  1082. int pos = m_combotaoxiname.FindString(0, taoxiname);
  1083. if (pos == -1)
  1084. {
  1085. m_combotaoxiname.InsertString(0, taoxiname);
  1086. m_combotaoxiname.SetCurSel(0);
  1087. }
  1088. else
  1089. m_combotaoxiname.SetCurSel(pos);
  1090. pos = m_combobm.FindString(0, bm);
  1091. if (pos == -1)
  1092. {
  1093. m_combobm.ResetContent();
  1094. m_combobm.InsertString(0, bm);
  1095. m_combobm.SetCurSel(0);
  1096. }
  1097. else
  1098. m_combobm.SetCurSel(pos);
  1099. pos = m_comborenyuan.FindString(0, ren);
  1100. if (pos == -1)
  1101. {
  1102. m_comborenyuan.InsertString(0, ren);
  1103. m_comborenyuan.SetCurSel(0);
  1104. }
  1105. else
  1106. m_comborenyuan.SetCurSel(pos);
  1107. pos = m_combotype.FindString(0, txtype);
  1108. if (pos == -1)
  1109. {
  1110. m_combotype.InsertString(0, txtype);
  1111. m_combotype.SetCurSel(0);
  1112. }
  1113. else
  1114. m_combotype.SetCurSel(pos);
  1115. pos = m_combowaiter1.FindString(0, m_waiter1);
  1116. if (pos == -1)
  1117. {
  1118. m_combowaiter1.InsertString(0, m_waiter1);
  1119. m_combowaiter1.SetCurSel(0);
  1120. }
  1121. else
  1122. m_combowaiter1.SetCurSel(pos);
  1123. pos = m_combowaiter2.FindString(0, m_waiter2);
  1124. if (pos == -1)
  1125. {
  1126. m_combowaiter2.InsertString(0, m_waiter2);
  1127. m_combowaiter2.SetCurSel(0);
  1128. }
  1129. else
  1130. m_combowaiter2.SetCurSel(pos);
  1131. pos = m_combowaiter3.FindString(0, m_waiter3);
  1132. if (pos == -1)
  1133. {
  1134. m_combowaiter3.InsertString(0, m_waiter3);
  1135. m_combowaiter3.SetCurSel(0);
  1136. }
  1137. else
  1138. m_combowaiter3.SetCurSel(pos);
  1139. pos = m_combowaiter4.FindString(0, m_waiter4);
  1140. if (pos == -1)
  1141. {
  1142. m_combowaiter4.InsertString(0, m_waiter4);
  1143. m_combowaiter4.SetCurSel(0);
  1144. }
  1145. else
  1146. m_combowaiter4.SetCurSel(pos);
  1147. pos = m_combowaiter5.FindString(0, m_waiter5);
  1148. if (pos == -1)
  1149. {
  1150. m_combowaiter5.InsertString(0, m_waiter5);
  1151. m_combowaiter5.SetCurSel(0);
  1152. }
  1153. else
  1154. m_combowaiter5.SetCurSel(pos);
  1155. pos = m_combowaiter7.FindString(0, m_waiter7);
  1156. if (pos == -1)
  1157. {
  1158. m_combowaiter7.InsertString(0, m_waiter7);
  1159. m_combowaiter7.SetCurSel(0);
  1160. }
  1161. else
  1162. m_combowaiter7.SetCurSel(pos);
  1163. pos = m_combostatus1.FindString(0, m_status1);
  1164. if (pos == -1)
  1165. {
  1166. m_combostatus1.InsertString(0, m_status1);
  1167. m_combostatus1.SetCurSel(0);
  1168. }
  1169. else
  1170. m_combostatus1.SetCurSel(pos);
  1171. pos = m_combostatus2.FindString(0, m_status2);
  1172. if (pos == -1)
  1173. {
  1174. m_combostatus2.InsertString(0, m_status2);
  1175. m_combostatus2.SetCurSel(0);
  1176. }
  1177. else
  1178. m_combostatus2.SetCurSel(pos);
  1179. pos = m_combostatus3.FindString(0, m_status3);
  1180. if (pos == -1)
  1181. {
  1182. m_combostatus3.InsertString(0, m_status3);
  1183. m_combostatus3.SetCurSel(0);
  1184. }
  1185. else
  1186. m_combostatus3.SetCurSel(pos);
  1187. pos = m_combostatus4.FindString(0, m_status4);
  1188. if (pos == -1)
  1189. {
  1190. m_combostatus4.InsertString(0, m_status4);
  1191. m_combostatus4.SetCurSel(0);
  1192. }
  1193. else
  1194. m_combostatus4.SetCurSel(pos);
  1195. pos = m_combostatus5.FindString(0, m_status5);
  1196. if (pos == -1)
  1197. {
  1198. m_combostatus5.InsertString(0, m_status5);
  1199. m_combostatus5.SetCurSel(0);
  1200. }
  1201. else
  1202. m_combostatus5.SetCurSel(pos);
  1203. pos = m_combostatus6.FindString(0, m_status6);
  1204. if (pos == -1)
  1205. {
  1206. m_combostatus6.InsertString(0, m_status6);
  1207. m_combostatus6.SetCurSel(0);
  1208. }
  1209. else
  1210. m_combostatus6.SetCurSel(pos);
  1211. #ifdef ZHIAI_VERSION
  1212. pos=m_comboarea.FindString (0, m_outside);
  1213. if(pos==-1)
  1214. {
  1215. m_comboarea.InsertString (0, m_outside);
  1216. m_comboarea.SetCurSel (0);
  1217. }
  1218. else
  1219. m_comboarea.SetCurSel (pos);
  1220. #endif
  1221. UpdateData(false);
  1222. m_List1.DeleteAllItems();
  1223. for (i = 0; i < m_List1Bakarray.GetSize(); i++)
  1224. {
  1225. m_List1.InsertItem(i, m_List1Bakarray.ElementAt(i).ElementAt(6));
  1226. m_List1.SetItemText(i, 1, m_List1Bakarray.ElementAt(i).ElementAt(7));
  1227. m_List1.SetItemText(i, 2, m_List1Bakarray.ElementAt(i).ElementAt(0));
  1228. m_List1.SetItemText(i, 3, m_List1Bakarray.ElementAt(i).ElementAt(17));
  1229. m_List1.SetItemText(i, 4, m_List1Bakarray.ElementAt(i).ElementAt(1));
  1230. m_List1.SetItemText(i, 5, m_List1Bakarray.ElementAt(i).ElementAt(18));
  1231. m_List1.SetItemText(i, 6, m_List1Bakarray.ElementAt(i).ElementAt(19));
  1232. m_kindarray.Add("1");
  1233. }
  1234. OnChangeEDITtaoxijiage();
  1235. CalculateCost();
  1236. return TRUE; // return TRUE unless you set the focus to a control
  1237. // EXCEPTION: OCX Property Pages should return FALSE
  1238. }
  1239. //IDC_EDITmoney3
  1240. void ModifyDinDan::CalculateCost()
  1241. {
  1242. m_cost1 = 0;
  1243. CString str;
  1244. float cost2 = 0;
  1245. int i = 0;
  1246. for ( i = 0; i < m_List1.GetItemCount(); i++)
  1247. {
  1248. cost2 += atof(m_List1.GetItemText(i, 3))*atof(m_List1.GetItemText(i, 4));
  1249. }
  1250. for (i = 0; i < m_List1.GetItemCount(); i++)
  1251. {
  1252. m_cost1 += atof(GetSPPriceFromIdCost(m_List1.GetItemText(i, 1)))*atof(m_List1.GetItemText(i, 4));
  1253. }
  1254. // str.Format ("套系包含商品,成本:%0.1f,售价:%0.1f", m_cost1, cost2);
  1255. str.Format("套系包含商品,总价:%0.1f", cost2);
  1256. ::ConvertToPrice(str);
  1257. SetDlgItemText(IDC_STATIC1, str);
  1258. }
  1259. void ModifyDinDan::OnBUTaddjd()
  1260. {
  1261. // TODO: Add your control notification handler code here
  1262. SPLBDlg dlg;
  1263. dlg.m_mode = 2;
  1264. if (dlg.DoModal() == IDOK)
  1265. {
  1266. for (int i = 0; i < dlg.m_array.GetSize(); i++)
  1267. m_listbox1.AddString(dlg.m_array.ElementAt(i));
  1268. }
  1269. }
  1270. void ModifyDinDan::OnBUTdeljd()
  1271. {
  1272. // TODO: Add your control notification handler code here
  1273. int pos = m_listbox1.GetCurSel();
  1274. if (pos == -1)
  1275. {
  1276. AfxMessageBox("请选中您要删除的景点!", MB_ICONINFORMATION); return;
  1277. }
  1278. m_listbox1.DeleteString(pos);
  1279. int count = m_listbox1.GetCount();
  1280. if (pos < count)
  1281. m_listbox1.SetCurSel(pos);
  1282. else if (count && pos == count)
  1283. m_listbox1.SetCurSel(0);
  1284. }