ModifyDinDan.cpp 39 KB

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