SPLBDlg.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. // SPLBDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "SPLBDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SPLBDlg dialog
  13. SPLBDlg::SPLBDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(SPLBDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SPLBDlg)
  17. m_edit1 = _T("");
  18. m_mode=0;
  19. //}}AFX_DATA_INIT
  20. }
  21. void SPLBDlg::DoDataExchange(CDataExchange* pDX)
  22. {
  23. CDialog::DoDataExchange(pDX);
  24. //{{AFX_DATA_MAP(SPLBDlg)
  25. DDX_Control(pDX, IDC_LIST1, m_List1);
  26. DDX_Text(pDX, IDC_EDIT1, m_edit1);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(SPLBDlg, CDialog)
  30. //{{AFX_MSG_MAP(SPLBDlg)
  31. ON_BN_CLICKED(IDC_BUTadd, OnBUTadd)
  32. ON_BN_CLICKED(IDC_BUTdel, OnBUTdel)
  33. ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
  34. ON_NOTIFY(NM_DBLCLK, IDC_LIST1, OnDblclkList1)
  35. ON_BN_CLICKED(IDC_BUTadd3, OnBUTadd3)
  36. ON_NOTIFY(NM_CLICK, IDC_LIST1, OnClickList1)
  37. ON_BN_CLICKED(IDC_BUTadd4, OnBUTadd4)
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. /////////////////////////////////////////////////////////////////////////////
  41. // SPLBDlg message handlers
  42. BOOL SPLBDlg::OnInitDialog()
  43. {
  44. CDialog::OnInitDialog();
  45. // TODO: Add extra initialization here
  46. CRect rc;
  47. m_List1.GetClientRect (rc);
  48. CString strHeadings;
  49. if(m_mode==2 || m_mode==19)
  50. {
  51. GetDlgItem(IDOK)->ShowWindow(SW_SHOW);
  52. GetDlgItem(IDC_BUTTON5)->ShowWindow(SW_SHOW);
  53. GetDlgItem(IDC_STATIC1)->ShowWindow(SW_HIDE);
  54. GetDlgItem(IDC_STATIC2)->ShowWindow(SW_HIDE);
  55. CRect rc3,rc2;
  56. GetWindowRect(rc3);
  57. GetDlgItem(IDC_BUTadd)->GetWindowRect(rc2);
  58. rc3.right =rc2.left ;
  59. MoveWindow(rc3);
  60. }
  61. else
  62. {
  63. GetDlgItem(IDOK)->ShowWindow(SW_HIDE);
  64. GetDlgItem(IDC_BUTTON5)->ShowWindow(SW_HIDE);
  65. }
  66. if(m_mode==19)GetDlgItem(IDC_BUTadd4)->ShowWindow(SW_SHOW);
  67. if(m_mode==1 || m_mode==2)
  68. {
  69. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  70. strHeadings.Format ("景点名称,%d", rc.Width()-18);
  71. GetDlgItem(IDC_STATIC1)->SetWindowText("景点");
  72. GetDlgItem(IDC_STATIC2)->SetWindowText("景点名称:");
  73. GetDlgItem(IDC_BUTadd)->SetWindowText("添加景点");
  74. GetDlgItem(IDC_BUTdel)->SetWindowText("删除景点");SetWindowText("景点设置");
  75. }
  76. else if(m_mode==3)
  77. {
  78. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  79. strHeadings.Format ("套系类别名称,%d", rc.Width()-18);
  80. GetDlgItem(IDC_STATIC1)->SetWindowText("套系类别");
  81. GetDlgItem(IDC_STATIC2)->SetWindowText("套系类别名称:");
  82. GetDlgItem(IDC_BUTadd)->SetWindowText("添加套系类别");
  83. GetDlgItem(IDC_BUTdel)->SetWindowText("删除套系类别");SetWindowText("套系类别设置");
  84. }
  85. else if(m_mode==4)
  86. {
  87. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  88. strHeadings.Format ("拍摄名称,%d", rc.Width()-18);
  89. GetDlgItem(IDC_STATIC1)->SetWindowText("拍摄名称");
  90. GetDlgItem(IDC_STATIC2)->SetWindowText("拍摄名称:");
  91. GetDlgItem(IDC_BUTadd)->SetWindowText("添加拍摄名称");
  92. GetDlgItem(IDC_BUTdel)->SetWindowText("删除拍摄名称");SetWindowText("拍摄名称设置");
  93. }
  94. else if(m_mode==5)
  95. {
  96. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  97. strHeadings.Format ("工作内容,%d", rc.Width()-18);
  98. GetDlgItem(IDC_STATIC1)->SetWindowText("工作内容");
  99. GetDlgItem(IDC_STATIC2)->SetWindowText("工作内容:");
  100. GetDlgItem(IDC_BUTadd)->SetWindowText("添加工作内容");
  101. GetDlgItem(IDC_BUTdel)->SetWindowText("删除工作内容");SetWindowText("工作内容设置");
  102. }
  103. else if(m_mode==6)
  104. {
  105. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  106. strHeadings.Format ("二销类别,%d", rc.Width()-18);
  107. GetDlgItem(IDC_STATIC1)->SetWindowText("二销类别");
  108. GetDlgItem(IDC_STATIC2)->SetWindowText("二销类别:");
  109. GetDlgItem(IDC_BUTadd)->SetWindowText("添加二销类别");
  110. GetDlgItem(IDC_BUTdel)->SetWindowText("删除二销类别");SetWindowText("二销类别设置");
  111. }
  112. else if(m_mode==7)
  113. {
  114. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  115. strHeadings.Format ("前期类别,%d", rc.Width()-18);
  116. GetDlgItem(IDC_STATIC1)->SetWindowText("前期类别");
  117. GetDlgItem(IDC_STATIC2)->SetWindowText("前期类别:");
  118. GetDlgItem(IDC_BUTadd)->SetWindowText("添加前期类别");
  119. GetDlgItem(IDC_BUTdel)->SetWindowText("删除前期类别");SetWindowText("前期类别设置");
  120. }
  121. else if(m_mode==8)
  122. {
  123. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  124. strHeadings.Format ("客户来源名称,%d", rc.Width()-18);
  125. GetDlgItem(IDC_STATIC1)->SetWindowText("客户来源");
  126. GetDlgItem(IDC_STATIC2)->SetWindowText("客户来源名称:");
  127. GetDlgItem(IDC_BUTadd)->SetWindowText("添加客户来源");
  128. GetDlgItem(IDC_BUTdel)->SetWindowText("删除客户来源");SetWindowText("客户来源设置");
  129. }
  130. else if(m_mode==9)
  131. {
  132. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  133. strHeadings.Format ("流失原因名称,%d", rc.Width()-18);
  134. GetDlgItem(IDC_STATIC1)->SetWindowText("流失原因");
  135. GetDlgItem(IDC_STATIC2)->SetWindowText("流失原因名称:");
  136. GetDlgItem(IDC_BUTadd)->SetWindowText("添加流失原因");
  137. GetDlgItem(IDC_BUTdel)->SetWindowText("删除流失原因");SetWindowText("流失原因设置");
  138. }
  139. else if(m_mode==10)
  140. {
  141. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  142. strHeadings.Format ("接单点名称,%d", rc.Width()-18);
  143. GetDlgItem(IDC_STATIC1)->SetWindowText("接单点");
  144. GetDlgItem(IDC_STATIC2)->SetWindowText("接单点名称:");
  145. GetDlgItem(IDC_BUTadd)->SetWindowText("添加接单点");
  146. GetDlgItem(IDC_BUTdel)->SetWindowText("删除接单点");SetWindowText("接单点设置");
  147. }
  148. else if(m_mode==11)
  149. {
  150. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  151. strHeadings.Format ("摆放区域名称,%d", rc.Width()-18);
  152. GetDlgItem(IDC_STATIC1)->SetWindowText("摆放区域");
  153. GetDlgItem(IDC_STATIC2)->SetWindowText("摆放区域名称:");
  154. GetDlgItem(IDC_BUTadd)->SetWindowText("添加摆放区域");
  155. GetDlgItem(IDC_BUTdel)->SetWindowText("删除摆放区域");SetWindowText("摆放区域设置");
  156. }
  157. else if(m_mode==12)
  158. {
  159. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  160. strHeadings.Format ("套系大类名称,%d", rc.Width()-18);
  161. GetDlgItem(IDC_STATIC1)->SetWindowText("套系大类");
  162. GetDlgItem(IDC_STATIC2)->SetWindowText("套系大类名称:");
  163. GetDlgItem(IDC_BUTadd)->SetWindowText("添加套系大类");
  164. GetDlgItem(IDC_BUTdel)->SetWindowText("删除套系大类");SetWindowText("套系大类设置");
  165. }
  166. else if(m_mode==13)
  167. {
  168. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  169. strHeadings.Format ("二销项目名称,%d", rc.Width()-18);
  170. GetDlgItem(IDC_STATIC1)->SetWindowText("二销项目");
  171. GetDlgItem(IDC_STATIC2)->SetWindowText("二销项目名称:");
  172. GetDlgItem(IDC_BUTadd)->SetWindowText("添加二销项目");
  173. GetDlgItem(IDC_BUTdel)->SetWindowText("删除二销项目");SetWindowText("二销项目设置");
  174. }
  175. else if(m_mode==14)
  176. {
  177. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  178. strHeadings.Format ("业务种类名称,%d", rc.Width()-18);
  179. GetDlgItem(IDC_STATIC1)->SetWindowText("业务种类");
  180. GetDlgItem(IDC_STATIC2)->SetWindowText("业务种类名称:");
  181. GetDlgItem(IDC_BUTadd)->SetWindowText("添加业务种类");
  182. GetDlgItem(IDC_BUTdel)->SetWindowText("删除业务种类");SetWindowText("业务种类设置");
  183. }
  184. else if(m_mode==15)
  185. {
  186. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  187. strHeadings.Format ("业务意向名称,%d", rc.Width()-18);
  188. GetDlgItem(IDC_STATIC1)->SetWindowText("业务意向");
  189. GetDlgItem(IDC_STATIC2)->SetWindowText("业务意向名称:");
  190. GetDlgItem(IDC_BUTadd)->SetWindowText("添加业务意向");
  191. GetDlgItem(IDC_BUTdel)->SetWindowText("删除业务意向");SetWindowText("业务意向设置");
  192. }
  193. else if(m_mode==16)
  194. {
  195. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  196. strHeadings.Format ("客户类别名称,%d", rc.Width()-18);
  197. GetDlgItem(IDC_STATIC1)->SetWindowText("客户类别");
  198. GetDlgItem(IDC_STATIC2)->SetWindowText("客户类别名称:");
  199. GetDlgItem(IDC_BUTadd)->SetWindowText("添加客户类别");
  200. GetDlgItem(IDC_BUTdel)->SetWindowText("删除客户类别");SetWindowText("客户类别设置");
  201. }
  202. else if(m_mode==17)
  203. {
  204. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  205. strHeadings.Format ("来单医院名称,%d", rc.Width()-18);
  206. GetDlgItem(IDC_STATIC1)->SetWindowText("来单医院");
  207. GetDlgItem(IDC_STATIC2)->SetWindowText("来单医院名称:");
  208. GetDlgItem(IDC_BUTadd)->SetWindowText("添加来单医院");
  209. GetDlgItem(IDC_BUTdel)->SetWindowText("删除来单医院");SetWindowText("来单医院设置");
  210. }
  211. else if(m_mode==18 || m_mode==19)
  212. {
  213. GetDlgItem(IDC_BUTadd3)->ShowWindow(SW_HIDE);
  214. strHeadings.Format ("客人要求,%d", rc.Width()-18);
  215. GetDlgItem(IDC_STATIC1)->SetWindowText("客人要求");
  216. GetDlgItem(IDC_STATIC2)->SetWindowText("客人要求:");
  217. GetDlgItem(IDC_BUTadd)->SetWindowText("添加客人要求");
  218. GetDlgItem(IDC_BUTdel)->SetWindowText("删除客人要求");SetWindowText("客人要求设置");
  219. }
  220. else
  221. strHeadings.Format ("商品类别名称,%d", rc.Width()-18);
  222. m_List1.SetHeadings( strHeadings );
  223. FillGrid();
  224. CenterWindow ();
  225. return TRUE; // return TRUE unless you set the focus to a control
  226. // EXCEPTION: OCX Property Pages should return FALSE
  227. }
  228. void SPLBDlg::FillGrid()
  229. {
  230. g_sendhead.bsql=0;
  231. if(m_mode==1 || m_mode==2)
  232. g_sendhead.code[0]=149;
  233. else if(m_mode==3)
  234. g_sendhead.code[0]=157;
  235. else if(m_mode==4)
  236. g_sendhead.code[0]=158;
  237. else if(m_mode==5)
  238. g_sendhead.code[0]=159;
  239. else if(m_mode==6)
  240. g_sendhead.code[0]=160;
  241. else if(m_mode==7)
  242. g_sendhead.code[0]=169;
  243. else if(m_mode==8)
  244. g_sendhead.code[0]=186;
  245. else if(m_mode==9)
  246. g_sendhead.code[0]=187;
  247. else if(m_mode==10)
  248. g_sendhead.code[0]=188;
  249. else if(m_mode==11)
  250. g_sendhead.code[0]=190;
  251. else if(m_mode==12)
  252. g_sendhead.code[0]=194;
  253. else if(m_mode==13)
  254. g_sendhead.code[0]=195;
  255. else if(m_mode==14)
  256. g_sendhead.code[0]=200;
  257. else if(m_mode==15)
  258. g_sendhead.code[0]=201;
  259. else if(m_mode==16)
  260. g_sendhead.code[0]=202;
  261. else if(m_mode==17)
  262. g_sendhead.code[0]=203;
  263. else if(m_mode==18||m_mode==19)
  264. g_sendhead.code[0]=215;
  265. else
  266. g_sendhead.code[0]=2;
  267. g_sendhead.tabcount=1;
  268. g_pMainWnd->ProcessChatMessageRequest2(2);if(g_bSendOK==0)return;
  269. DataToArray(&g_List1array);
  270. m_List1.DeleteAllItems2 ();
  271. int ii=0;
  272. {
  273. m_List1.m_arLabels.SetSize( g_List1array.GetSize (), 1 );
  274. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  275. m_List1.m_arLabels.ElementAt (ii).Copy (g_List1array.ElementAt (ii));
  276. }
  277. m_List1.m_LabelCount=ii;
  278. m_List1.SetItemCountEx (ii);
  279. if(m_mode==0)
  280. {
  281. #ifndef CHILD_VERSION
  282. BOOL bFind=0;
  283. for(ii=0; ii<g_List1array.GetSize (); ii++)
  284. {
  285. if(g_List1array.ElementAt (ii).ElementAt (0)=="婚庆服务")
  286. {
  287. bFind=1;
  288. break;
  289. }
  290. }
  291. if(bFind==0)
  292. {
  293. CString sql;
  294. sql.Format ("insert into shangpinlb (name)values('%s')", "婚庆服务");
  295. g_sendhead.bsql=1;
  296. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  297. FillGrid();
  298. }
  299. #endif
  300. }
  301. }
  302. void SPLBDlg::OnBUTadd()
  303. {
  304. // TODO: Add your control notification handler code here
  305. UpdateData();
  306. m_edit1.TrimLeft ();
  307. m_edit1.TrimRight ();
  308. if(m_edit1.IsEmpty ())
  309. {
  310. if(m_mode==1 || m_mode==2)
  311. AfxMessageBox("景点名称不能为空!", MB_ICONINFORMATION);
  312. else if(m_mode==3)
  313. AfxMessageBox("套系类别名称不能为空!", MB_ICONINFORMATION);
  314. else if(m_mode==4)
  315. AfxMessageBox("拍摄名称不能为空!", MB_ICONINFORMATION);
  316. else if(m_mode==5)
  317. AfxMessageBox("工作内容不能为空!", MB_ICONINFORMATION);
  318. else if(m_mode==6)
  319. AfxMessageBox("二销类别不能为空!", MB_ICONINFORMATION);
  320. else if(m_mode==7)
  321. AfxMessageBox("前期类别不能为空!", MB_ICONINFORMATION);
  322. else if(m_mode==8)
  323. AfxMessageBox("客户来源不能为空!", MB_ICONINFORMATION);
  324. else if(m_mode==9)
  325. AfxMessageBox("流失原因不能为空!", MB_ICONINFORMATION);
  326. else if(m_mode==10)
  327. AfxMessageBox("接单点不能为空!", MB_ICONINFORMATION);
  328. else if(m_mode==11)
  329. AfxMessageBox("摆放区域不能为空!", MB_ICONINFORMATION);
  330. else if(m_mode==12)
  331. AfxMessageBox("套系大类不能为空!", MB_ICONINFORMATION);
  332. else if(m_mode==13)
  333. AfxMessageBox("二销项目不能为空!", MB_ICONINFORMATION);
  334. else if(m_mode==14)
  335. AfxMessageBox("业务种类不能为空!", MB_ICONINFORMATION);
  336. else if(m_mode==15)
  337. AfxMessageBox("业务意向不能为空!", MB_ICONINFORMATION);
  338. else if(m_mode==16)
  339. AfxMessageBox("客户类别不能为空!", MB_ICONINFORMATION);
  340. else if(m_mode==17)
  341. AfxMessageBox("来单医院不能为空!", MB_ICONINFORMATION);
  342. else if(m_mode==18)
  343. AfxMessageBox("客人要求不能为空!", MB_ICONINFORMATION);
  344. else
  345. AfxMessageBox("商品类别不能为空!", MB_ICONINFORMATION);
  346. this->GetDlgItem (IDC_EDIT1)->SetFocus();
  347. return;
  348. }
  349. if(m_mode==4)
  350. {
  351. m_edit1.Replace (",", ""); UpdateData(0);
  352. }
  353. for(int i=0; i<m_List1.GetItemCount (); i++)
  354. {
  355. if(m_List1.GetItemText (i, 0)==m_edit1)
  356. {
  357. if(m_mode==1 || m_mode==2)
  358. AfxMessageBox("已有此景点!", MB_ICONINFORMATION);
  359. else if(m_mode==3)
  360. AfxMessageBox("已有此套系类别!", MB_ICONINFORMATION);
  361. else if(m_mode==4)
  362. AfxMessageBox("已有此拍摄名称!", MB_ICONINFORMATION);
  363. else if(m_mode==5)
  364. AfxMessageBox("已有此工作内容!", MB_ICONINFORMATION);
  365. else if(m_mode==6)
  366. AfxMessageBox("已有此二销类别!", MB_ICONINFORMATION);
  367. else if(m_mode==7)
  368. AfxMessageBox("已有此前期类别!", MB_ICONINFORMATION);
  369. else if(m_mode==8)
  370. AfxMessageBox("已有此客户来源!", MB_ICONINFORMATION);
  371. else if(m_mode==9)
  372. AfxMessageBox("已有此流失原因!", MB_ICONINFORMATION);
  373. else if(m_mode==10)
  374. AfxMessageBox("已有此接单点!", MB_ICONINFORMATION);
  375. else if(m_mode==11)
  376. AfxMessageBox("已有此摆放区域!", MB_ICONINFORMATION);
  377. else if(m_mode==12)
  378. AfxMessageBox("已有此套系大类!", MB_ICONINFORMATION);
  379. else if(m_mode==13)
  380. AfxMessageBox("已有此二销项目!", MB_ICONINFORMATION);
  381. else if(m_mode==14)
  382. AfxMessageBox("已有此业务种类!", MB_ICONINFORMATION);
  383. else if(m_mode==15)
  384. AfxMessageBox("已有此业务意向!", MB_ICONINFORMATION);
  385. else if(m_mode==16)
  386. AfxMessageBox("已有此客户类别!", MB_ICONINFORMATION);
  387. else if(m_mode==17)
  388. AfxMessageBox("已有此来单医院!", MB_ICONINFORMATION);
  389. else if(m_mode==18)
  390. AfxMessageBox("已有此客人要求!", MB_ICONINFORMATION);
  391. else
  392. AfxMessageBox("已有此类别!", MB_ICONINFORMATION);
  393. this->GetDlgItem (IDC_EDIT1)->SetFocus();
  394. return;
  395. }
  396. }
  397. CString sql;
  398. if(m_mode==1 || m_mode==2)
  399. sql.Format ("insert into jd (name)values('%s')", m_edit1);
  400. else if(m_mode==3)
  401. sql.Format ("insert into txlb (name)values('%s')", m_edit1);
  402. else if(m_mode==4)
  403. sql.Format ("insert into growthtx (name)values('%s')", m_edit1);
  404. else if(m_mode==5)
  405. sql.Format ("insert into worktype (name)values('%s')", m_edit1);
  406. else if(m_mode==6)
  407. sql.Format ("insert into expendtype (name)values('%s')", m_edit1);
  408. else if(m_mode==7)
  409. sql.Format ("insert into baseexpendtype (name)values('%s')", m_edit1);
  410. else if(m_mode==8)
  411. sql.Format ("insert into clientfrom (name)values('%s')", m_edit1);
  412. else if(m_mode==9)
  413. sql.Format ("insert into clientreason (name)values('%s')", m_edit1);
  414. else if(m_mode==10)
  415. sql.Format ("insert into jdd (name)values('%s')", m_edit1);
  416. else if(m_mode==11)
  417. sql.Format ("insert into dressarea (name)values('%s')", m_edit1);
  418. else if(m_mode==12)
  419. sql.Format ("insert into [txlb2] (name)values('%s')", m_edit1);
  420. else if(m_mode==13)
  421. sql.Format ("insert into [sale2type] (name)values('%s')", m_edit1);
  422. else if(m_mode==14)
  423. sql.Format ("insert into [businesstype] (name)values('%s')", m_edit1);
  424. else if(m_mode==15)
  425. sql.Format ("insert into [businessintention] (name)values('%s')", m_edit1);
  426. else if(m_mode==16)
  427. sql.Format ("insert into [clienttype] (name)values('%s')", m_edit1);
  428. else if(m_mode==17)
  429. sql.Format ("insert into [hospital] (name)values('%s')", m_edit1);
  430. else if(m_mode==18)
  431. sql.Format ("insert into [clientqequirement] (name)values('%s')", m_edit1);
  432. else
  433. sql.Format ("insert into shangpinlb (name)values('%s')", m_edit1);
  434. g_sendhead.bsql=1;
  435. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  436. FillGrid();
  437. }
  438. void SPLBDlg::OnBUTdel()
  439. {
  440. // TODO: Add your control notification handler code here
  441. POSITION pos;
  442. pos=m_List1.GetFirstSelectedItemPosition();
  443. if(pos==NULL)
  444. {
  445. if(m_mode==1 || m_mode==2)
  446. AfxMessageBox("请选中您要删除的景点!", MB_ICONINFORMATION);
  447. else if(m_mode==3)
  448. AfxMessageBox("请选中您要删除的套系类别!", MB_ICONINFORMATION);
  449. else if(m_mode==4)
  450. AfxMessageBox("请选中您要删除的拍摄名称!", MB_ICONINFORMATION);
  451. else if(m_mode==5)
  452. AfxMessageBox("请选中您要删除的工作内容!", MB_ICONINFORMATION);
  453. else if(m_mode==6)
  454. AfxMessageBox("请选中您要删除的二销类别!", MB_ICONINFORMATION);
  455. else if(m_mode==7)
  456. AfxMessageBox("请选中您要删除的前期类别!", MB_ICONINFORMATION);
  457. else if(m_mode==8)
  458. AfxMessageBox("请选中您要删除的客户来源!", MB_ICONINFORMATION);
  459. else if(m_mode==9)
  460. AfxMessageBox("请选中您要删除的流失原因!", MB_ICONINFORMATION);
  461. else if(m_mode==10)
  462. AfxMessageBox("请选中您要删除的接单点!", MB_ICONINFORMATION);
  463. else if(m_mode==11)
  464. AfxMessageBox("请选中您要删除的摆放区域!", MB_ICONINFORMATION);
  465. else if(m_mode==12)
  466. AfxMessageBox("请选中您要删除的套系大类!", MB_ICONINFORMATION);
  467. else if(m_mode==13)
  468. AfxMessageBox("请选中您要删除的二销项目!", MB_ICONINFORMATION);
  469. else if(m_mode==14)
  470. AfxMessageBox("请选中您要删除的业务种类!", MB_ICONINFORMATION);
  471. else if(m_mode==15)
  472. AfxMessageBox("请选中您要删除的业务意向!", MB_ICONINFORMATION);
  473. else if(m_mode==16)
  474. AfxMessageBox("请选中您要删除的客户类别!", MB_ICONINFORMATION);
  475. else if(m_mode==17)
  476. AfxMessageBox("请选中您要删除的来单医院!", MB_ICONINFORMATION);
  477. else if(m_mode==18)
  478. AfxMessageBox("请选中您要删除的客人要求!", MB_ICONINFORMATION);
  479. else
  480. AfxMessageBox("请选中您要删除的类别!", MB_ICONINFORMATION);
  481. return;
  482. }
  483. if(AfxMessageBox("确认删除吗?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  484. int iItem=m_List1.GetNextSelectedItem(pos);
  485. CString name=m_List1.GetItemText (iItem, 0);
  486. CString sql;
  487. if(m_mode==1 || m_mode==2)
  488. sql.Format ("delete from jd where name='%s'", name);
  489. else if(m_mode==3)
  490. sql.Format ("delete from txlb where name='%s'", name);
  491. else if(m_mode==4)
  492. sql.Format ("delete from growthtx where name='%s'", name);
  493. else if(m_mode==5)
  494. sql.Format ("delete from worktype where name='%s'", name);
  495. else if(m_mode==6)
  496. sql.Format ("delete from expendtype where name='%s'", name);
  497. else if(m_mode==7)
  498. sql.Format ("delete from baseexpendtype where name='%s'", name);
  499. else if(m_mode==8)
  500. sql.Format ("delete from clientfrom where name='%s'", name);
  501. else if(m_mode==9)
  502. sql.Format ("delete from clientreason where name='%s'", name);
  503. else if(m_mode==10)
  504. sql.Format ("delete from jdd where name='%s'", name);
  505. else if(m_mode==11)
  506. sql.Format ("delete from dressarea where name='%s'", name);
  507. else if(m_mode==12)
  508. sql.Format ("delete from [txlb2] where name='%s'", name);
  509. else if(m_mode==13)
  510. sql.Format ("delete from [sale2type] where name='%s'", name);
  511. else if(m_mode==14)
  512. sql.Format ("delete from businesstype where name='%s'", name);
  513. else if(m_mode==15)
  514. sql.Format ("delete from businessintention where name='%s'", name);
  515. else if(m_mode==16)
  516. sql.Format ("delete from [clienttype] where name='%s'", name);
  517. else if(m_mode==17)
  518. sql.Format ("delete from [hospital] where name='%s'", name);
  519. else if(m_mode==18)
  520. sql.Format ("delete from [clientqequirement] where name='%s'", name);
  521. else
  522. sql.Format ("delete from shangpinlb where name='%s'***delete from shangpin where splb='%s'", name, name);
  523. g_sendhead.bsql=1;
  524. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  525. FillGrid();
  526. }
  527. void SPLBDlg::OnOK()
  528. {
  529. // TODO: Add extra validation here
  530. if(m_mode==19)
  531. { POSITION pos;
  532. pos=m_List1.GetFirstSelectedItemPosition();
  533. if(pos==NULL)
  534. {
  535. return;
  536. }
  537. int iItem=m_List1.GetNextSelectedItem(pos);
  538. m_edit1=m_List1.GetItemText (iItem, 0);CDialog::OnOK();
  539. return;
  540. }
  541. if(m_mode!=2)
  542. {
  543. CDialog::OnCancel ();
  544. return;
  545. }
  546. POSITION pos;
  547. pos=m_List1.GetFirstSelectedItemPosition();
  548. if(pos==NULL)
  549. {
  550. AfxMessageBox("请先选中景点!", MB_ICONINFORMATION);
  551. return;
  552. }
  553. int iItem;
  554. m_array.RemoveAll ();
  555. while (pos)
  556. {
  557. iItem = m_List1.GetNextSelectedItem(pos);
  558. m_array.Add (m_List1.GetItemText (iItem, 0));
  559. }
  560. CDialog::OnOK();
  561. }
  562. void SPLBDlg::OnButton5()
  563. {
  564. // TODO: Add your control notification handler code here
  565. CDialog::OnCancel ();
  566. }
  567. void SPLBDlg::OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult)
  568. {
  569. // TODO: Add your control notification handler code here
  570. OnOK();
  571. *pResult = 0;
  572. }
  573. void SPLBDlg::OnBUTadd3()
  574. {
  575. // TODO: Add your control notification handler code here
  576. POSITION pos;
  577. pos=m_List1.GetFirstSelectedItemPosition();
  578. if(pos==NULL)
  579. {
  580. AfxMessageBox("请选中您要修改的类别!", MB_ICONINFORMATION);
  581. return;
  582. }
  583. int iItem=m_List1.GetNextSelectedItem(pos);
  584. CString name=m_List1.GetItemText (iItem, 0);
  585. UpdateData();
  586. m_edit1.TrimLeft ();
  587. m_edit1.TrimRight ();
  588. if(m_edit1.IsEmpty ())
  589. {
  590. AfxMessageBox("商品类别不能为空!", MB_ICONINFORMATION);
  591. this->GetDlgItem (IDC_EDIT1)->SetFocus();
  592. return;
  593. }
  594. if(m_edit1==name)return;
  595. if(AfxMessageBox("确认修改吗?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  596. CString sql,sql2;
  597. sql.Format ("update shangpinlb set name='%s' where name='%s'", m_edit1, name);
  598. sql2.Format ("update shangpin set splb='%s' where splb='%s'", m_edit1, name);
  599. sql+="***"+sql2;
  600. g_sendhead.bsql=1;
  601. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  602. FillGrid();
  603. }
  604. void SPLBDlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult)
  605. {
  606. // TODO: Add your control notification handler code here
  607. POSITION pos;
  608. pos=m_List1.GetFirstSelectedItemPosition();
  609. if(pos==NULL)
  610. {
  611. return;
  612. }
  613. int iItem=m_List1.GetNextSelectedItem(pos);
  614. m_edit1=m_List1.GetItemText (iItem, 0);
  615. UpdateData(0);
  616. *pResult = 0;
  617. }
  618. void SPLBDlg::OnBUTadd4()
  619. {
  620. // TODO: Add your control notification handler code here
  621. SPLBDlg dlg;
  622. dlg.m_mode=18;
  623. dlg.DoModal ();
  624. FillGrid();
  625. }