OrderServiceControlsEx.cs 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Collections;
  10. using LYFZ.Model.API;
  11. namespace LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls
  12. {
  13. public class SetCustomControls_ServiceColumnHeaderModel
  14. {
  15. private string _PgmID = "";
  16. private string _ServiceNumber;
  17. private string _ServiceCostPrice;
  18. private string _ServiceUnit;
  19. private string _ServiceOrderID;
  20. /// <summary>
  21. /// 套系赠送商品ID(用于检查是否修改过套系商品)
  22. /// </summary>
  23. public string PgmID
  24. {
  25. get { return _PgmID; }
  26. set { _PgmID = value; }
  27. }
  28. /// <summary>
  29. /// 服务编号
  30. /// </summary>
  31. public string ServiceNumber
  32. {
  33. get { return _ServiceNumber; }
  34. set { _ServiceNumber = value; }
  35. }
  36. /// <summary>
  37. /// 服务成本价
  38. /// </summary>
  39. public string ServiceCostPrice
  40. {
  41. get { return _ServiceCostPrice; }
  42. set { _ServiceCostPrice = value; }
  43. }
  44. /// <summary>
  45. /// 服务单位
  46. /// </summary>
  47. public string ServiceUnit
  48. {
  49. get { return _ServiceUnit; }
  50. set { _ServiceUnit = value; }
  51. }
  52. /// <summary>
  53. /// 订单服务ID
  54. /// </summary>
  55. public string ServiceOrderID
  56. {
  57. get { return _ServiceOrderID; }
  58. set { _ServiceOrderID = value; }
  59. }
  60. }
  61. public partial class OrderServiceControlsEx : LYFZ.Software.UI.DoorCityProcess.SetCustomControls.OrderServiceControlsEx
  62. {
  63. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  64. LYFZ.BLL.BLL_ErpOrderDigital orvbll = new BLL.BLL_ErpOrderDigital();
  65. LYFZ.BLL.BLL_ErpWeddingService wsbll = new BLL.BLL_ErpWeddingService();
  66. public bool bUpgrade = false;
  67. public OrderServiceControlsEx()
  68. {
  69. this.btnUp.Click += btnUp_Click;
  70. this.btnDown.Click += btnDown_Click;
  71. this.btnServiceAllDelete.Click += btnServiceAllDelete_Click;
  72. this.btnServiceDelete.Click += btnServiceDelete_Click;
  73. this.btnServiceToolbox.Click += btnServiceToolbox_Click;
  74. this.listViewData_Service.Click += listViewData_Service_Click;
  75. this.listViewData_Service.MouseDown += listViewData_Service_MouseDown;
  76. this.listViewData_Service.MouseDoubleClick += listViewData_Service_MouseDoubleClick;
  77. this.listViewData_Service.ItemDrag += listViewData_Service_ItemDrag;
  78. this.listViewData_Service.DragEnter += listViewData_Service_DragEnter;
  79. this.listViewData_Service.DragDrop += listViewData_Service_DragDrop;
  80. this.listViewData_Service.ColumnClick += listViewData_Service_ColumnClick;
  81. this.listViewData_Service.Resize += listViewData_Service_Resize;
  82. this.txtText.KeyPress += txtText_KeyPress;
  83. this.txtText.Leave += txtText_Leave;
  84. this.IsClickToolbox = false;
  85. this.listViewData_Service.View = View.Details;
  86. this.listViewData_Service.GridLines = true;
  87. string[] StrColumns = "服务名称,服务价格,来源,服务数量,备注".Split(',');
  88. int SurplusCount = 230 + 100 * 2 + 70 + 23;
  89. for (int i = 0; i < StrColumns.Length; i++)
  90. {
  91. ColumnHeader ch = new ColumnHeader();
  92. ch.Text = StrColumns[i].Trim();
  93. switch (StrColumns[i].Trim())
  94. {
  95. case "服务名称": ch.Width = 230; break;
  96. case "来源": ch.Width = 70; break;
  97. case "备注": ch.Width = this.listViewData_Service.Width - SurplusCount; break;
  98. default: ch.Width = 100; break;
  99. }
  100. switch (StrColumns[i].Trim())
  101. {
  102. case "服务价格":
  103. ch.TextAlign = HorizontalAlignment.Right;
  104. break;
  105. case "服务数量":
  106. case "来源":
  107. ch.TextAlign = HorizontalAlignment.Center;
  108. break;
  109. default:
  110. ch.TextAlign = HorizontalAlignment.Left;
  111. break;
  112. }
  113. this.listViewData_Service.Columns.Add(ch);
  114. }
  115. this.mlistImage.ImageSize = new Size(25, 25);
  116. this.mlistImage.ColorDepth = ColorDepth.Depth32Bit;
  117. this.listViewData_Service.SmallImageList = mlistImage;
  118. lvwColumnSorter = new ComponentLibrary.ListViewColumnSorter();
  119. this.listViewData_Service.ListViewItemSorter = lvwColumnSorter;
  120. }
  121. /// <summary>
  122. /// 订单编号
  123. /// </summary>
  124. public string StrNumber = "";
  125. /// <summary>
  126. /// 相片集合
  127. /// </summary>
  128. ImageList mlistImage = new ImageList();
  129. /// <summary>
  130. /// 登录者员工ID
  131. /// </summary>
  132. string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  133. LYFZ.ComponentLibrary.ListViewColumnSorter lvwColumnSorter;
  134. private EnumPublic.OrderType _OrdType;
  135. /// <summary>
  136. /// 订单类型
  137. /// </summary>
  138. public EnumPublic.OrderType OrdType
  139. {
  140. set
  141. {
  142. _OrdType = value;
  143. if (this.OrdType == EnumPublic.OrderType.儿童订单)
  144. {
  145. this.btnDown.Visible = false;
  146. this.btnUp.Visible = false;
  147. this.listViewData_Service.AllowDrop = false;
  148. }
  149. else
  150. {
  151. this.btnDown.Visible = true;
  152. this.btnUp.Visible = true;
  153. this.listViewData_Service.AllowDrop = true;
  154. }
  155. if (this.OrdType == EnumPublic.OrderType.服务订单)
  156. { this.IsClickToolbox = true; }
  157. }
  158. get { return _OrdType; }
  159. }
  160. private bool _isClickToolbox;
  161. /// <summary>
  162. /// 是否能点击工具箱
  163. /// </summary>
  164. public bool IsClickToolbox
  165. {
  166. get { return _isClickToolbox; }
  167. set { _isClickToolbox = value; }
  168. }
  169. private List<string> _StrGroupList = new List<string>();
  170. /// <summary>
  171. /// 组的list
  172. /// </summary>
  173. public List<string> StrGroupList
  174. {
  175. get { return _StrGroupList; }
  176. set
  177. {
  178. _StrGroupList = value;
  179. this.GroupChange();
  180. }
  181. }
  182. /// <summary>
  183. /// 拍摄次数组变更
  184. /// </summary>
  185. void GroupChange()
  186. {
  187. List<string> GroupList = new List<string>();
  188. for (int i = 0; i < this.StrGroupList.Count; i++)
  189. { GroupList.Add(this.StrGroupList[i]); }
  190. if (this.listViewData_Service.Groups["未分组"] == null)
  191. { this.CreateDefaultGroup(); }
  192. List<ListViewGroup> DeleteGroup = new List<ListViewGroup>();
  193. List<ListViewItem> ChangeItemList = new List<ListViewItem>();
  194. if (GroupList.Count > 0)
  195. {
  196. for (int i = 0; i < this.listViewData_Service.Groups.Count; i++)
  197. {
  198. if (this.listViewData_Service.Groups[i].Header.Trim() != "未分组")
  199. {
  200. bool IsFind = false;
  201. for (int j = 0; j < GroupList.Count; j++)
  202. {
  203. if (this.listViewData_Service.Groups[i].Header.Trim() == GroupList[j].Trim())
  204. { GroupList.RemoveAt(j); IsFind = true; break; }
  205. }
  206. if (!IsFind)
  207. {
  208. for (int j = 0; j < this.listViewData_Service.Groups[i].Items.Count; j++)
  209. { ChangeItemList.Add(this.listViewData_Service.Groups[i].Items[j]); }
  210. DeleteGroup.Add(this.listViewData_Service.Groups[i]);
  211. }
  212. }
  213. }
  214. ListViewGroup man_lvg = null;
  215. for (int i = 0; i < GroupList.Count; i++)
  216. {
  217. man_lvg = new ListViewGroup();
  218. man_lvg.Name = GroupList[i].Trim();
  219. man_lvg.Header = GroupList[i].Trim();
  220. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  221. this.listViewData_Service.Groups.Add(man_lvg);
  222. }
  223. }
  224. else
  225. {
  226. for (int i = 0; i < this.listViewData_Service.Groups.Count; i++)
  227. {
  228. if (this.listViewData_Service.Groups[i].Header.Trim() != "未分组")
  229. {
  230. for (int j = 0; j < this.listViewData_Service.Groups[i].Items.Count; j++)
  231. { ChangeItemList.Add(this.listViewData_Service.Groups[i].Items[j]); }
  232. DeleteGroup.Add(this.listViewData_Service.Groups[i]);
  233. }
  234. }
  235. }
  236. for (int i = 0; i < ChangeItemList.Count; i++)
  237. { ((ListViewItem)ChangeItemList[i]).Group = this.listViewData_Service.Groups["未分组"]; }
  238. for (int i = 0; i < DeleteGroup.Count; i++)
  239. { this.listViewData_Service.Groups.Remove(DeleteGroup[i]); }
  240. }
  241. /// <summary>
  242. /// 创建默认分组
  243. /// </summary>
  244. void CreateDefaultGroup()
  245. {
  246. if (this.listViewData_Service.Groups["未分组"] == null)
  247. {
  248. ListViewGroup man_lvg = new ListViewGroup();
  249. man_lvg.Name = "未分组";
  250. man_lvg.Header = "未分组";
  251. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  252. this.listViewData_Service.Groups.Add(man_lvg);
  253. this.listViewData_Service.ShowGroups = true;
  254. }
  255. }
  256. /// <summary>
  257. /// 获取当前列表
  258. /// </summary>
  259. /// <returns></returns>
  260. public DataTable GetListViewData()
  261. {
  262. DataTable NewTable = new DataTable();
  263. NewTable.Columns.Add("PgmID", typeof(string));
  264. for (int i = 0; i < this.listViewData_Service.Columns.Count; i++)
  265. {
  266. NewTable.Columns.Add(this.listViewData_Service.Columns[i].Text.Trim(), typeof(string));
  267. }
  268. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  269. {
  270. if (string.IsNullOrEmpty(this.listViewData_Service.Items[i].SubItems["来源"].Text.Trim()))
  271. {
  272. DataRow newRow = NewTable.NewRow();
  273. for (int j = 0; j < this.listViewData_Service.Columns.Count; j++)
  274. {
  275. if (j == 0)
  276. {
  277. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.Items[i].Tag;
  278. newRow["PgmID"] = ColumnModel.PgmID;
  279. newRow[this.listViewData_Service.Columns[j].Text.Trim()] = this.listViewData_Service.Items[i].Text.Trim();
  280. }
  281. else
  282. { newRow[this.listViewData_Service.Columns[j].Text.Trim()] = this.listViewData_Service.Items[i].SubItems[this.listViewData_Service.Columns[j].Text.Trim()].Text.Trim(); }
  283. }
  284. NewTable.Rows.Add(newRow);
  285. }
  286. }
  287. return NewTable;
  288. }
  289. /// <summary>
  290. /// 获取列表详情数据
  291. /// </summary>
  292. /// <returns></returns>
  293. public string GetOrderServiceContentDetails()
  294. {
  295. string StrContentDetails = "";
  296. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  297. { StrContentDetails += "名称:" + this.listViewData_Service.Items[i].Text.Trim() + " 套数:" + this.listViewData_Service.Items[i].SubItems["服务数量"].Text.Trim() + " ;"; }
  298. return StrContentDetails;
  299. }
  300. /// <summary>
  301. /// 上移
  302. /// </summary>
  303. /// <param name="sender"></param>
  304. /// <param name="e"></param>
  305. void btnUp_Click(object sender, EventArgs e)
  306. {
  307. if (this.listViewData_Service.Items.Count > 0 && this.listViewData_Service.SelectedItems.Count > 0)
  308. {
  309. int selectionIdx = this.listViewData_Service.SelectedIndices[0];
  310. if (selectionIdx > 0)
  311. {
  312. ListViewItem lvItem = new ListViewItem();
  313. ListViewItem.ListViewSubItem ListSubItem = null;
  314. for (int i = 0; i < this.listViewData_Service.Columns.Count; i++)
  315. {
  316. if (i == 0)
  317. {
  318. lvItem.ImageKey = this.listViewData_Service.SelectedItems[0].ImageKey;
  319. lvItem.Text = this.listViewData_Service.SelectedItems[0].Text;
  320. lvItem.Tag = this.listViewData_Service.SelectedItems[0].Tag;
  321. }
  322. else
  323. {
  324. ListSubItem = new ListViewItem.ListViewSubItem();
  325. ListSubItem.Name = this.listViewData_Service.Columns[i].Text.Trim();
  326. ListSubItem.Text = this.listViewData_Service.SelectedItems[0].SubItems[this.listViewData_Service.Columns[i].Text.Trim()].Text.Trim();
  327. lvItem.SubItems.Add(ListSubItem);
  328. }
  329. }
  330. this.listViewData_Service.Items.Remove(this.listViewData_Service.SelectedItems[0]);
  331. this.listViewData_Service.Items.Insert(selectionIdx - 1, lvItem);
  332. this.listViewData_Service.Items[selectionIdx - 1].Selected = true;
  333. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Service);
  334. this.listViewData_Service.Select();
  335. }
  336. }
  337. }
  338. /// <summary>
  339. /// 下移
  340. /// </summary>
  341. /// <param name="sender"></param>
  342. /// <param name="e"></param>
  343. void btnDown_Click(object sender, EventArgs e)
  344. {
  345. if (this.listViewData_Service.Items.Count > 0 && this.listViewData_Service.SelectedItems.Count > 0)
  346. {
  347. int selectionIdx = this.listViewData_Service.SelectedIndices[0];
  348. if (selectionIdx < (this.listViewData_Service.Items.Count - 1))
  349. {
  350. ListViewItem lvItem = new ListViewItem();
  351. ListViewItem.ListViewSubItem ListSubItem = null;
  352. for (int i = 0; i < this.listViewData_Service.Columns.Count; i++)
  353. {
  354. if (i == 0)
  355. {
  356. lvItem.ImageKey = this.listViewData_Service.SelectedItems[0].ImageKey;
  357. lvItem.Text = this.listViewData_Service.SelectedItems[0].Text;
  358. lvItem.Tag = this.listViewData_Service.SelectedItems[0].Tag;
  359. }
  360. else
  361. {
  362. ListSubItem = new ListViewItem.ListViewSubItem();
  363. ListSubItem.Name = this.listViewData_Service.Columns[i].Text.Trim();
  364. ListSubItem.Text = this.listViewData_Service.SelectedItems[0].SubItems[this.listViewData_Service.Columns[i].Text.Trim()].Text.Trim();
  365. lvItem.SubItems.Add(ListSubItem);
  366. }
  367. }
  368. this.listViewData_Service.Items.Remove(this.listViewData_Service.SelectedItems[0]);
  369. this.listViewData_Service.Items.Insert(selectionIdx + 1, lvItem);
  370. this.listViewData_Service.Items[selectionIdx + 1].Selected = true;
  371. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Service);
  372. this.listViewData_Service.Select();
  373. }
  374. }
  375. }
  376. #region 拖放事件
  377. /// <summary>
  378. /// 点击开始拖放
  379. /// </summary>
  380. /// <param name="sender"></param>
  381. /// <param name="e"></param>
  382. void listViewData_Service_ItemDrag(object sender, ItemDragEventArgs e)
  383. {
  384. if (e.Button == MouseButtons.Left)
  385. {
  386. if (this.listViewData_Service.SelectedIndices[0] > -1)
  387. { this.listViewData_Service.DoDragDrop(this.listViewData_Service.Items[this.listViewData_Service.SelectedIndices[0]], DragDropEffects.Move); }
  388. }
  389. }
  390. /// <summary>
  391. /// 拖放时去入控件时间
  392. /// </summary>
  393. /// <param name="sender"></param>
  394. /// <param name="e"></param>
  395. void listViewData_Service_DragEnter(object sender, DragEventArgs e)
  396. {
  397. e.Effect = DragDropEffects.Move;
  398. }
  399. /// <summary>
  400. /// 拖放完成操作后
  401. /// </summary>
  402. /// <param name="sender"></param>
  403. /// <param name="e"></param>
  404. void listViewData_Service_DragDrop(object sender, DragEventArgs e)
  405. {
  406. Point p = this.listViewData_Service.PointToClient(new Point(e.X, e.Y));
  407. int selectionIdx = 0;
  408. ListViewHitTestInfo ItemHit = this.listViewData_Service.HitTest(p.X, p.Y);
  409. if (ItemHit.Item != null)
  410. { selectionIdx = ItemHit.Item.Index; }
  411. else
  412. { selectionIdx = this.listViewData_Service.Items.Count - 1; }
  413. if (selectionIdx < 0) return;
  414. if (e.Data.GetDataPresent(typeof(ListViewItem)))
  415. {
  416. ListViewItem lvItem = new ListViewItem();
  417. ListViewItem.ListViewSubItem ListSubItem = null;
  418. for (int i = 0; i < this.listViewData_Service.Columns.Count; i++)
  419. {
  420. if (i == 0)
  421. {
  422. lvItem.ImageKey = this.listViewData_Service.SelectedItems[0].ImageKey;
  423. lvItem.Text = this.listViewData_Service.SelectedItems[0].Text;
  424. lvItem.Tag = this.listViewData_Service.SelectedItems[0].Tag;
  425. }
  426. else
  427. {
  428. ListSubItem = new ListViewItem.ListViewSubItem();
  429. ListSubItem.Name = this.listViewData_Service.Columns[i].Text.Trim();
  430. ListSubItem.Text = this.listViewData_Service.SelectedItems[0].SubItems[this.listViewData_Service.Columns[i].Text.Trim()].Text.Trim();
  431. lvItem.SubItems.Add(ListSubItem);
  432. }
  433. }
  434. this.listViewData_Service.Items.Remove(this.listViewData_Service.SelectedItems[0]);
  435. this.listViewData_Service.Items.Insert(selectionIdx, lvItem);
  436. this.listViewData_Service.Items[selectionIdx].Selected = true;
  437. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Service);
  438. this.listViewData_Service.Select();
  439. }
  440. }
  441. #endregion
  442. /// <summary>
  443. /// 删除全部服务
  444. /// </summary>
  445. /// <param name="sender"></param>
  446. /// <param name="e"></param>
  447. void btnServiceAllDelete_Click(object sender, EventArgs e)
  448. {
  449. if (this.listViewData_Service.Items.Count > 0)
  450. {
  451. if (MessageBoxCustom.Show("是否要全部删除", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  452. { return; }
  453. bool IsFind = false;
  454. DataTable tbl = orbll.GetView_Custom("tb_ErpWeddingService", StrWhere: "Ws_Number = '" + this.StrNumber + "'", ShowColumnName: "ID,Ws_Status").Tables[0];
  455. tbl.PrimaryKey = new DataColumn[] { tbl.Columns["ID"] };
  456. List<ListViewItem> StrList = new List<ListViewItem>();
  457. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  458. {
  459. if (string.IsNullOrEmpty(this.listViewData_Service.Items[i].SubItems["来源"].Text.Trim()))
  460. {
  461. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.Items[0].Tag;
  462. if (string.IsNullOrEmpty(ColumnModel.ServiceOrderID))
  463. { StrList.Add(this.listViewData_Service.Items[i]); continue; }
  464. else
  465. {
  466. bool IsTrue = false;
  467. DataRow dataRow = tbl.Rows.Find(ColumnModel.ServiceOrderID.Trim());
  468. if (dataRow != null)
  469. {
  470. if (dataRow["Ws_Status"].ToString().Trim() == "1")
  471. { IsTrue = true; IsFind = true; continue; }
  472. }
  473. if (!IsTrue)
  474. { StrList.Add(this.listViewData_Service.Items[i]); }
  475. }
  476. }
  477. }
  478. for (int i = 0; i < StrList.Count; i++)
  479. { this.listViewData_Service.Items.Remove(StrList[i]); }
  480. this.GetShowAmount();
  481. if (IsFind)
  482. { MessageBoxCustom.Show("未删除服务已OK,不能删除"); }
  483. }
  484. }
  485. /// <summary>
  486. /// 删除服务
  487. /// </summary>
  488. /// <param name="sender"></param>
  489. /// <param name="e"></param>
  490. void btnServiceDelete_Click(object sender, EventArgs e)
  491. {
  492. List<ListViewItem> StrList = new List<ListViewItem>();
  493. if (!string.IsNullOrEmpty(this.StrNumber))
  494. {
  495. if (MessageBoxCustom.Show("是否要删除?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  496. { return; }
  497. bool IsFind = false;
  498. DataTable tbl = new DataTable();
  499. if (!string.IsNullOrEmpty(this.StrNumber))
  500. {
  501. tbl = orbll.GetView_Custom("tb_ErpWeddingService", StrWhere: "Ws_Number = '" + this.StrNumber + "'", ShowColumnName: "ID,Ws_Status").Tables[0];
  502. tbl.PrimaryKey = new DataColumn[] { tbl.Columns["ID"] };
  503. }
  504. for (int i = 0; i < this.listViewData_Service.SelectedItems.Count; i++)
  505. {
  506. if (string.IsNullOrEmpty(this.listViewData_Service.SelectedItems[i].SubItems["来源"].Text.Trim()))
  507. {
  508. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.SelectedItems[i].Tag;
  509. if (string.IsNullOrEmpty(ColumnModel.ServiceOrderID.Trim()))
  510. { StrList.Add(this.listViewData_Service.SelectedItems[i]); }
  511. else
  512. {
  513. bool IsTrue = false;
  514. if (tbl.Rows.Count > 0)
  515. {
  516. DataRow dtRow = tbl.Rows.Find(ColumnModel.ServiceOrderID.Trim());
  517. if (dtRow["Ws_Status"].ToString().Trim() == "1")
  518. { IsFind = true; IsTrue = true; }
  519. }
  520. if (!IsTrue)
  521. { StrList.Add(this.listViewData_Service.SelectedItems[i]); }
  522. }
  523. }
  524. }
  525. for (int i = 0; i < StrList.Count; i++)
  526. { this.listViewData_Service.Items.Remove(StrList[i]); }
  527. if (IsFind)
  528. {
  529. if (this.listViewData_Service.SelectedItems.Count > 1)
  530. { MessageBoxCustom.Show("未删除服务已OK,不能删除!"); }
  531. else
  532. { MessageBoxCustom.Show("此服务已OK,不能删除!"); }
  533. }
  534. }
  535. else
  536. {
  537. for (int i = 0; i < this.listViewData_Service.SelectedItems.Count; i++)
  538. {
  539. if (string.IsNullOrEmpty(this.listViewData_Service.SelectedItems[i].SubItems["来源"].Text.Trim()))
  540. { StrList.Add(this.listViewData_Service.SelectedItems[i]); }
  541. }
  542. for (int i = 0; i < StrList.Count; i++)
  543. { this.listViewData_Service.Items.Remove(StrList[i]); }
  544. }
  545. this.GetShowAmount();
  546. }
  547. /// <summary>
  548. /// 删除数据
  549. /// </summary>
  550. public void DeleteSightByNotAction()
  551. {
  552. List<ListViewItem> StrList = new List<ListViewItem>();
  553. DataTable tbl = new DataTable();
  554. if (!string.IsNullOrEmpty(this.StrNumber))
  555. {
  556. tbl = orbll.GetView_Custom("tb_ErpWeddingService", StrWhere: "Ws_Number = '" + this.StrNumber + "'", ShowColumnName: "ID,Ws_Status").Tables[0];
  557. tbl.PrimaryKey = new DataColumn[] { tbl.Columns["ID"] };
  558. }
  559. if (!string.IsNullOrEmpty(this.StrNumber))
  560. {
  561. foreach (ListViewItem item in this.listViewData_Service.Items)
  562. {
  563. if (MessageBoxCustom.Show("是否要删除?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  564. { return; }
  565. //for (int i = 0; i < this.listViewData_Service.SelectedItems.Count; i++)
  566. //{
  567. if (string.IsNullOrEmpty(item.SubItems["来源"].Text.Trim()))
  568. {
  569. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)item.Tag;
  570. if (string.IsNullOrEmpty(ColumnModel.ServiceOrderID.Trim()))
  571. { StrList.Add(item); }
  572. else
  573. {
  574. bool IsTrue = false;
  575. if (tbl.Rows.Count > 0)
  576. {
  577. DataRow dtRow = tbl.Rows.Find(ColumnModel.ServiceOrderID.Trim());
  578. if (dtRow["Ws_Status"].ToString().Trim() == "1")
  579. {
  580. //IsFind = true;
  581. IsTrue = true;
  582. }
  583. }
  584. if (!IsTrue)
  585. { StrList.Add(item); }
  586. }
  587. }
  588. //}
  589. }
  590. }
  591. for (int i = 0; i < StrList.Count; i++)
  592. { this.listViewData_Service.Items.Remove(StrList[i]); }
  593. this.GetShowAmount();
  594. this.bUpgrade = true;
  595. }
  596. /// <summary>
  597. /// 服务工具箱
  598. /// </summary>
  599. /// <param name="sender"></param>
  600. /// <param name="e"></param>
  601. void btnServiceToolbox_Click(object sender, EventArgs e)
  602. {
  603. if (!this.IsClickToolbox)
  604. { MessageBoxCustom.Show("请先选择套系名称!"); return; }
  605. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm frm = new SetSmallForm.ToolboxListViewSamllForm();
  606. frm.LoadType = "婚庆服务";
  607. frm.ShowDialog();
  608. if (frm.IsSaveed)
  609. { this.SetOrderServiceValue(frm.mlist, frm.mlist_SmallImage); }
  610. }
  611. /// <summary>
  612. /// 获取套系服务总价
  613. /// </summary>
  614. /// <returns></returns>
  615. public decimal GetServiceAoumnt()
  616. { return Convert.ToDecimal(this.txt_H.Tag); }
  617. /// <summary>
  618. /// 列表点击
  619. /// </summary>
  620. /// <param name="sender"></param>
  621. /// <param name="e"></param>
  622. void listViewData_Service_Click(object sender, EventArgs e)
  623. { this.txtText.Visible = false; }
  624. /// <summary>
  625. /// 右键显示菜单
  626. /// </summary>
  627. /// <param name="sender"></param>
  628. /// <param name="e"></param>
  629. void listViewData_Service_MouseDown(object sender, MouseEventArgs e)
  630. {
  631. if (e.Button == MouseButtons.Right)
  632. {
  633. LYFZ.ComponentLibrary.ContextMenuStripEx contextmenu = new ComponentLibrary.ContextMenuStripEx();
  634. contextmenu.Name = "Source";
  635. contextmenu.ItemClicked += contextmenu_ItemClicked;
  636. //弹出操作菜单
  637. contextmenu.Items.Clear();
  638. contextmenu.Show(MousePosition.X, MousePosition.Y);
  639. if (this.listViewData_Service.Groups.Count > 0)
  640. {
  641. for (int i = 0; i < this.listViewData_Service.Groups.Count; i++)
  642. {
  643. if (this.listViewData_Service.Groups[i].Header.Trim() != "未分组")
  644. {
  645. ToolStripMenuItem item = new ToolStripMenuItem();
  646. item.Text = this.listViewData_Service.Groups[i].Header.Trim();
  647. item.Name = "GroupBy";
  648. contextmenu.Items.Add(item);
  649. }
  650. }
  651. ToolStripSeparator tools = new ToolStripSeparator();
  652. contextmenu.Items.Add(tools);
  653. }
  654. if (this.listViewData_Service.SelectedItems.Count > 0)
  655. {
  656. ToolStripMenuItem item = new ToolStripMenuItem();
  657. item.Text = "放大(" + this.listViewData_Service.SelectedItems[0].Text.Trim() + ")";
  658. item.Name = "ZoomView";
  659. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.SelectedItems[0].Tag;
  660. item.Tag = ColumnModel.ServiceNumber.Trim();
  661. contextmenu.Items.Add(item);
  662. }
  663. contextmenu.Show();
  664. }
  665. }
  666. /// <summary>
  667. /// 右键菜单选择事件
  668. /// </summary>
  669. /// <param name="sender"></param>
  670. /// <param name="e"></param>
  671. void contextmenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  672. {
  673. ToolStripItem item = e.ClickedItem;
  674. if (!string.IsNullOrEmpty(item.Text.Trim()))
  675. {
  676. switch (item.Name.Trim())
  677. {
  678. case "ZoomView":
  679. DataTable tbl = orbll.GetView_Custom("tb_ErpProduct", StrWhere: "Prod_Number = '" + item.Tag.ToString().Trim() + "'", ShowColumnName: "Prod_Thumbnail").Tables[0];
  680. if (tbl.Rows.Count > 0)
  681. {
  682. if (!string.IsNullOrEmpty(tbl.Rows[0]["Prod_Thumbnail"].ToString().Trim()))
  683. {
  684. LYFZ.Software.MainBusiness.InitialSet.Product.FrmProductPic frm = new InitialSet.Product.FrmProductPic();
  685. frm.FrmImage = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte(tbl.Rows[0]["Prod_Thumbnail"].ToString()));
  686. frm.ShowDialog();
  687. }
  688. else
  689. { MessageBoxCustom.Show("产品未上传相片!"); return; }
  690. }
  691. break;
  692. case "GroupBy":
  693. string StrMages = "";
  694. for (int i = 0; i < this.listViewData_Service.SelectedItems.Count; i++)
  695. {
  696. bool IsFind = false;
  697. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.SelectedItems[i].Tag;
  698. if (!string.IsNullOrEmpty(ColumnModel.ServiceOrderID.Trim()))
  699. {
  700. DataTable dt = orbll.GetView_Custom("tb_ErpWeddingService", StrWhere: "ID = '" + ColumnModel.ServiceOrderID.Trim() + "'", ShowColumnName: "Ws_ProdName,Ws_Status").Tables[0];
  701. if (dt.Rows[0]["Ws_Status"].ToString().Trim() == "1")
  702. {
  703. StrMages += dt.Rows[0]["Ws_ProdName"].ToString().Trim() + ",";
  704. IsFind = true;
  705. }
  706. }
  707. if (!IsFind)
  708. { this.listViewData_Service.Groups[item.Text.Trim()].Items.Add(this.listViewData_Service.SelectedItems[i]); }
  709. }
  710. if (!string.IsNullOrEmpty(StrMages.Trim()))
  711. { MessageBoxCustom.Show("服务:" + StrMages.TrimEnd(',') + "。服务已完成,不能移动分组!"); }
  712. //for (int i = 0; i < this.listViewData_Service.SelectedItems.Count; i++)
  713. //{ this.listViewData_Service.Groups[item.Text.Trim()].Items.Add(this.listViewData_Service.SelectedItems[i]); }
  714. break;
  715. }
  716. }
  717. }
  718. /// <summary>
  719. /// 双击编辑子项
  720. /// </summary>
  721. /// <param name="sender"></param>
  722. /// <param name="e"></param>
  723. void listViewData_Service_MouseDoubleClick(object sender, MouseEventArgs e)
  724. {
  725. this.listViewData_Service_Click(this, null);
  726. ListViewHitTestInfo info = listViewData_Service.HitTest(e.X, e.Y);
  727. if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
  728. {
  729. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.SelectedItems[0].Tag;
  730. DataTable tbl = orbll.GetView_Custom("tb_ErpWeddingService", StrWhere: "ID = '" + ColumnModel.ServiceOrderID + "'", ShowColumnName: "Ws_Status").Tables[0];
  731. if (tbl.Rows.Count > 0)
  732. {
  733. if (tbl.Rows[0]["Ws_Status"].ToString().Trim() == "1")
  734. { MessageBoxCustom.Show("此服务已经服务完成,不能修改!"); return; }
  735. }
  736. Rectangle rect = info.SubItem.Bounds;
  737. switch (info.SubItem.Name.Trim())
  738. {
  739. case "服务价格":
  740. if (this.OrdType == EnumPublic.OrderType.婚庆订单 || this.OrdType == EnumPublic.OrderType.服务订单)
  741. {
  742. if (!string.IsNullOrEmpty(this.listViewData_Service.SelectedItems[0].SubItems["来源"].Text.Trim()))
  743. { return; }
  744. this.txtText.Location = new Point(rect.Location.X + this.listViewData_Service.Location.X + 3, rect.Location.Y + this.listViewData_Service.Location.Y + 2);
  745. this.txtText.Size = rect.Size;
  746. this.txtText.Visible = true;
  747. this.txtText.Tag = info.SubItem.Name.Trim();
  748. this.txtText.Text = info.SubItem.Text.Trim();
  749. this.txtText.Focus();
  750. }
  751. break;
  752. case "备注":
  753. case "服务数量":
  754. if (info.SubItem.Name.Trim() == "备注")
  755. { this.txtText.MaxLength = 400; }
  756. else
  757. {
  758. if (!string.IsNullOrEmpty(this.listViewData_Service.SelectedItems[0].SubItems["来源"].Text.Trim()))
  759. { return; }
  760. else
  761. { this.txtText.MaxLength = 3; }
  762. }
  763. this.txtText.Location = new Point(rect.Location.X + this.listViewData_Service.Location.X + 3, rect.Location.Y + this.listViewData_Service.Location.Y + 2);
  764. this.txtText.Size = rect.Size;
  765. this.txtText.Visible = true;
  766. this.txtText.Tag = info.SubItem.Name.Trim();
  767. this.txtText.Text = info.SubItem.Text.Trim();
  768. this.txtText.Focus();
  769. break;
  770. }
  771. }
  772. else
  773. {
  774. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.SelectedItems[0].Tag;
  775. DataTable tbl = orbll.GetView_Custom("tb_ErpProduct", StrWhere: "Prod_Number = '" + ColumnModel.ServiceNumber.Trim() + "'", ShowColumnName: "Prod_Thumbnail").Tables[0];
  776. if (tbl.Rows.Count > 0)
  777. {
  778. if (!string.IsNullOrEmpty(tbl.Rows[0]["Prod_Thumbnail"].ToString().Trim()))
  779. {
  780. LYFZ.Software.MainBusiness.InitialSet.Product.FrmProductPic frm = new InitialSet.Product.FrmProductPic();
  781. frm.FrmImage = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte(tbl.Rows[0]["Prod_Thumbnail"].ToString()));
  782. frm.ShowDialog();
  783. }
  784. else
  785. { MessageBoxCustom.Show("产品未上传相片!"); return; }
  786. }
  787. }
  788. }
  789. /// <summary>
  790. /// 文本框控件离开事件
  791. /// </summary>
  792. /// <param name="sender"></param>
  793. /// <param name="e"></param>
  794. void txtText_Leave(object sender, EventArgs e)
  795. {
  796. try
  797. {
  798. if (this.txtText.Tag != null)
  799. {
  800. string StrText = "";
  801. switch (this.txtText.Tag.ToString().Trim())
  802. {
  803. case "服务价格":
  804. if (!string.IsNullOrEmpty(this.txtText.Text.Trim()))
  805. {
  806. if (LYFZ.Command.Command_Validate.IsNumeric(this.txtText.Text.Trim()))
  807. { StrText = this.txtText.Text.Trim(); }
  808. }
  809. this.listViewData_Service.SelectedItems[0].SubItems[this.txtText.Tag.ToString().Trim()].Text = StrText == "" ? "0.00" : StrText;
  810. GetShowAmount();
  811. break;
  812. case "服务数量":
  813. if (!string.IsNullOrEmpty(this.txtText.Text.Trim()))
  814. {
  815. if (LYFZ.Command.Command_Validate.IsNumberSign(this.txtText.Text.Trim()))
  816. {
  817. if (this.txtText.Text.Trim() == "0")
  818. { StrText = "1"; }
  819. else
  820. { StrText = this.txtText.Text.Trim(); }
  821. }
  822. }
  823. this.listViewData_Service.SelectedItems[0].SubItems[this.txtText.Tag.ToString().Trim()].Text = StrText == "" ? "1" : StrText;
  824. GetShowAmount();
  825. break;
  826. case "备注":
  827. this.listViewData_Service.SelectedItems[0].SubItems[this.txtText.Tag.ToString().Trim()].Text = this.txtText.Text.Trim();
  828. break;
  829. }
  830. }
  831. }
  832. catch
  833. { }
  834. this.txtText.Visible = false;
  835. }
  836. /// <summary>
  837. /// 文本框输入限制
  838. /// </summary>
  839. /// <param name="sender"></param>
  840. /// <param name="e"></param>
  841. void txtText_KeyPress(object sender, KeyPressEventArgs e)
  842. {
  843. if (this.txtText.Tag != null)
  844. {
  845. switch (this.txtText.Tag.ToString().Trim())
  846. {
  847. case "服务价格":
  848. if (Convert.ToString(e.KeyChar) == ".")
  849. {
  850. string StrValue = this.txtText.Text.Trim();
  851. if (StrValue.IndexOf('.') != -1)
  852. { e.Handled = true; }
  853. }
  854. else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  855. { e.Handled = true; }
  856. break;
  857. case "服务数量":
  858. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  859. { e.Handled = true; }
  860. break;
  861. }
  862. }
  863. }
  864. /// <summary>
  865. /// 点击排序
  866. /// </summary>
  867. /// <param name="sender"></param>
  868. /// <param name="e"></param>
  869. void listViewData_Service_ColumnClick(object sender, ColumnClickEventArgs e)
  870. {
  871. this.listViewData_Service_Click(this, null);
  872. // 检查点击的列是不是现在的排序列.
  873. if (e.Column == lvwColumnSorter.SortColumn)
  874. {
  875. // 重新设置此列的排序方法.
  876. if (lvwColumnSorter.Order == SortOrder.Ascending)
  877. { lvwColumnSorter.Order = SortOrder.Descending; }
  878. else
  879. { lvwColumnSorter.Order = SortOrder.Ascending; }
  880. }
  881. else
  882. {
  883. // 设置排序列,默认为正向排序
  884. lvwColumnSorter.SortColumn = e.Column;
  885. lvwColumnSorter.Order = SortOrder.Ascending;
  886. }
  887. // 用新的排序方法对ListView排序
  888. this.listViewData_Service.Sort();
  889. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  890. {
  891. if ((i % 2) > 0)
  892. { this.listViewData_Service.Items[i].BackColor = System.Drawing.Color.PapayaWhip; }
  893. else
  894. { this.listViewData_Service.Items[i].BackColor = System.Drawing.Color.PowderBlue; }
  895. }
  896. }
  897. /// <summary>
  898. /// 窗体大小发生变化
  899. /// </summary>
  900. /// <param name="sender"></param>
  901. /// <param name="e"></param>
  902. void listViewData_Service_Resize(object sender, EventArgs e)
  903. {
  904. int CountWidth = 0;
  905. for (int i = 0; i < this.listViewData_Service.Columns.Count; i++)
  906. {
  907. if (i > 0)
  908. { CountWidth += this.listViewData_Service.Columns[i].Width; }
  909. }
  910. this.listViewData_Service.Columns[0].Width = this.listViewData_Service.Width - CountWidth - 23;
  911. }
  912. /// <summary>
  913. /// 设置订单服务资料
  914. /// </summary>
  915. /// <param name="mlist"></param>
  916. public void SetOrderServiceValue(List<LYFZ.Model.Model_ErpProduct> mlist, ImageList mlist_SmallImage)
  917. {
  918. for (int i = 0; i < mlist_SmallImage.Images.Keys.Count; i++)
  919. {
  920. if (!this.mlistImage.Images.Keys.Contains(mlist_SmallImage.Images.Keys[i].Trim()))
  921. { this.mlistImage.Images.Add(mlist_SmallImage.Images.Keys[i].Trim(), mlist_SmallImage.Images[mlist_SmallImage.Images.Keys[i].Trim()]); }
  922. }
  923. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = null;
  924. for (int i = 0; i < mlist.Count; i++)
  925. {
  926. ListViewItem lvItem = new ListViewItem();
  927. ColumnModel = new SetCustomControls_ServiceColumnHeaderModel();
  928. ColumnModel.ServiceNumber = mlist[i].Prod_Number.Trim();
  929. ColumnModel.ServiceCostPrice = mlist[i].Prod_CostPrice.ToString().Trim();
  930. ColumnModel.ServiceUnit = mlist[i].Prod_Unit.ToString().Trim();
  931. ColumnModel.ServiceOrderID = "";
  932. lvItem.Tag = ColumnModel;
  933. lvItem.ImageKey = mlist[i].Prod_Number.Trim();
  934. lvItem.Text = mlist[i].Prod_Name.Trim();
  935. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  936. ListSubItem.Name = "服务价格";
  937. ListSubItem.Text = mlist[i].Prod_SalesPrice.ToString().Trim();
  938. lvItem.SubItems.Add(ListSubItem);
  939. ListSubItem = new ListViewItem.ListViewSubItem();
  940. ListSubItem.Name = "来源";
  941. ListSubItem.Text = "";
  942. lvItem.SubItems.Add(ListSubItem);
  943. ListSubItem = new ListViewItem.ListViewSubItem();
  944. ListSubItem.Name = "服务数量";
  945. ListSubItem.Text = "1";
  946. lvItem.SubItems.Add(ListSubItem);
  947. ListSubItem = new ListViewItem.ListViewSubItem();
  948. ListSubItem.Name = "备注";
  949. ListSubItem.Text = "";
  950. lvItem.SubItems.Add(ListSubItem);
  951. if ((this.listViewData_Service.Items.Count % 2) > 0)
  952. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  953. else
  954. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  955. if (this.listViewData_Service.Groups.Count > 0)
  956. { this.listViewData_Service.Groups["未分组"].Items.Add(lvItem); }
  957. this.listViewData_Service.Items.Add(lvItem);
  958. }
  959. this.GetShowAmount();
  960. }
  961. /// <summary>
  962. /// 设置订单服务资料
  963. /// </summary>
  964. /// <param name="mlist"></param>
  965. public void SetOrderServiceValue(string StrOrdNumber, bool IsActivity, string StrSeriesName)
  966. {
  967. if (this.bUpgrade)
  968. {
  969. DeleteSightByNotAction();
  970. }
  971. else
  972. {
  973. this.listViewData_Service.Groups.Clear();
  974. this.listViewData_Service.Items.Clear();
  975. }
  976. if (this.OrdType == EnumPublic.OrderType.儿童订单)
  977. { this.GroupChange(); }
  978. if (!string.IsNullOrEmpty(StrSeriesName))
  979. { this.IsClickToolbox = true; }
  980. string StrTableName = "(select tb_ErpWeddingService.ID,Ws_ProdNumber,Ws_OrderByNumber,Ws_ProdName,Ws_ProdSoldPrice,Ws_ProdQuantity,Ws_ProdCostPrice,Ws_Number,Ws_Unit,Prod_Unit,Prod_Thumbnail,Ws_OpenOrderRemark,Ws_OpenOrderSource," +
  981. "case when Ws_ViceNumber = '' or Ws_ViceNumber is null then '未分组' else (select top 1 Ordpg_Sights from tb_ErpOrdersPhotography where Ordpg_ViceNumber = Ws_ViceNumber) end AS Ordpg_Sights" +
  982. " from tb_ErpWeddingService Left Join tb_ErpProduct on Prod_Number = Ws_ProdNumber) AS tb";
  983. DataTable dt = orbll.GetView_Custom(StrTableName, StrWhere: "Ws_Number = '" + StrOrdNumber + "'", ShowColumnName: "*", filedOrder: "Ws_OrderByNumber ASC").Tables[0];
  984. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = null;
  985. for (int i = 0; i < dt.Rows.Count; i++)
  986. {
  987. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetProductImage(dt.Rows[i]["Prod_Thumbnail"].ToString().Trim());
  988. if (!this.mlistImage.Images.Keys.Contains(dt.Rows[i]["Ws_ProdNumber"].ToString().Trim()))
  989. { this.mlistImage.Images.Add(dt.Rows[i]["Ws_ProdNumber"].ToString().Trim(), img); }
  990. ListViewItem lvItem = new ListViewItem();
  991. ColumnModel = new SetCustomControls_ServiceColumnHeaderModel();
  992. ColumnModel.ServiceNumber = dt.Rows[i]["Ws_ProdNumber"].ToString().Trim();
  993. ColumnModel.ServiceCostPrice = dt.Rows[i]["Ws_ProdCostPrice"].ToString().Trim();
  994. if (string.IsNullOrEmpty(dt.Rows[i]["Ws_Unit"].ToString().Trim()))
  995. { ColumnModel.ServiceUnit = dt.Rows[i]["Prod_Unit"].ToString().Trim(); }
  996. else
  997. { ColumnModel.ServiceUnit = dt.Rows[i]["Ws_Unit"].ToString().Trim(); }
  998. ColumnModel.ServiceOrderID = dt.Rows[i]["ID"].ToString().Trim();
  999. lvItem.Tag = ColumnModel;
  1000. lvItem.ImageKey = dt.Rows[i]["Ws_ProdNumber"].ToString().Trim();
  1001. lvItem.Text = dt.Rows[i]["Ws_ProdName"].ToString().Trim();
  1002. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  1003. ListSubItem.Name = "服务价格";
  1004. ListSubItem.Text = dt.Rows[i]["Ws_ProdSoldPrice"].ToString().Trim();
  1005. lvItem.SubItems.Add(ListSubItem);
  1006. ListSubItem = new ListViewItem.ListViewSubItem();
  1007. ListSubItem.Name = "来源";
  1008. ListSubItem.Text = dt.Rows[i]["Ws_OpenOrderSource"].ToString().Trim();
  1009. lvItem.SubItems.Add(ListSubItem);
  1010. ListSubItem = new ListViewItem.ListViewSubItem();
  1011. ListSubItem.Name = "服务数量";
  1012. ListSubItem.Text = dt.Rows[i]["Ws_ProdQuantity"].ToString().Trim();
  1013. lvItem.SubItems.Add(ListSubItem);
  1014. ListSubItem = new ListViewItem.ListViewSubItem();
  1015. ListSubItem.Name = "备注";
  1016. ListSubItem.Text = dt.Rows[i]["Ws_OpenOrderRemark"].ToString().Trim();
  1017. lvItem.SubItems.Add(ListSubItem);
  1018. if ((this.listViewData_Service.Items.Count % 2) > 0)
  1019. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  1020. else
  1021. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  1022. if (this.listViewData_Service.Groups.Count > 0)
  1023. {
  1024. if (!string.IsNullOrEmpty(dt.Rows[i]["Ordpg_Sights"].ToString().Trim()) && this.listViewData_Service.Groups[dt.Rows[i]["Ordpg_Sights"].ToString().Trim()] != null)
  1025. { this.listViewData_Service.Groups[dt.Rows[i]["Ordpg_Sights"].ToString().Trim()].Items.Add(lvItem); }
  1026. else
  1027. { this.listViewData_Service.Groups["未分组"].Items.Add(lvItem); }
  1028. }
  1029. this.listViewData_Service.Items.Add(lvItem);
  1030. }
  1031. GetShowAmount();
  1032. GetIsActivity(IsActivity);
  1033. }
  1034. /// <summary>
  1035. /// 设置订单服务资料
  1036. /// </summary>
  1037. /// <param name="mlist">要绑定的数据源</param>
  1038. /// <param name="dsSet">提供绑定查询的产品服务数据</param>
  1039. /// <param name="IsActivity">是否为活动套系</param>
  1040. public string SetOrderServiceValue(DataRow[] dtRows, bool IsActivity, LYFZ.EnumPublic.EnumPackagesType PackagesType)
  1041. {
  1042. string StrDeleteProduct = "";
  1043. if (PackagesType == EnumPublic.EnumPackagesType.AAAAAAB)
  1044. {
  1045. if (this.bUpgrade)
  1046. {
  1047. DeleteSightByNotAction();
  1048. }
  1049. else
  1050. {
  1051. this.listViewData_Service.Items.Clear();
  1052. this.listViewData_Service.Groups.Clear();
  1053. }
  1054. //this.listViewData_Service.Items.Clear();
  1055. //this.listViewData_Service.Groups.Clear();
  1056. }
  1057. else
  1058. { this.RemovePackageItem(); }
  1059. if (this.OrdType == EnumPublic.OrderType.儿童订单)
  1060. { this.GroupChange(); }
  1061. this.IsClickToolbox = true;
  1062. for (int i = 0; i < dtRows.Length; i++)
  1063. {
  1064. if (!string.IsNullOrEmpty(dtRows[i]["Prod_Number"].ToString().Trim()))
  1065. {
  1066. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetProductImage(dtRows[i]["Prod_Thumbnail"].ToString().Trim());
  1067. this.mlistImage.Images.Add(dtRows[i]["Prod_Number"].ToString().Trim(), img);
  1068. ListViewItem lvItem = new ListViewItem();
  1069. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = new SetCustomControls_ServiceColumnHeaderModel();
  1070. ColumnModel.PgmID = dtRows[i]["PgmID"].ToString().Trim();
  1071. ColumnModel.ServiceNumber = dtRows[i]["Prod_Number"].ToString().Trim();
  1072. ColumnModel.ServiceCostPrice = dtRows[i]["Prod_CostPrice"].ToString().Trim();
  1073. ColumnModel.ServiceUnit = dtRows[i]["Prod_Unit"].ToString().Trim();
  1074. ColumnModel.ServiceOrderID = "";
  1075. lvItem.Tag = ColumnModel;
  1076. lvItem.ImageKey = dtRows[i]["Prod_Number"].ToString().Trim();
  1077. lvItem.Text = dtRows[i]["Prod_Name"].ToString().Trim();
  1078. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  1079. ListSubItem.Name = "服务价格";
  1080. ListSubItem.Text = dtRows[i]["Prod_SalesPrice"].ToString().Trim();
  1081. lvItem.SubItems.Add(ListSubItem);
  1082. ListSubItem = new ListViewItem.ListViewSubItem();
  1083. ListSubItem.Name = "来源";
  1084. ListSubItem.Text = dtRows[i]["TaoXiNameSource"].ToString().Trim();
  1085. lvItem.SubItems.Add(ListSubItem);
  1086. ListSubItem = new ListViewItem.ListViewSubItem();
  1087. ListSubItem.Name = "服务数量";
  1088. ListSubItem.Text = dtRows[i]["Pgm_Quantity"].ToString().Trim();
  1089. lvItem.SubItems.Add(ListSubItem);
  1090. ListSubItem = new ListViewItem.ListViewSubItem();
  1091. ListSubItem.Name = "备注";
  1092. ListSubItem.Text = "";
  1093. lvItem.SubItems.Add(ListSubItem);
  1094. if (this.listViewData_Service.Groups.Count > 0)
  1095. {
  1096. if (!string.IsNullOrEmpty(dtRows[i]["Pgm_ProductGroupName"].ToString().Trim()))
  1097. { this.listViewData_Service.Groups[dtRows[i]["Pgm_ProductGroupName"].ToString().Trim()].Items.Add(lvItem); }
  1098. else
  1099. { this.listViewData_Service.Groups["未分组"].Items.Add(lvItem); }
  1100. }
  1101. this.listViewData_Service.Items.Add(lvItem);
  1102. }
  1103. else
  1104. { StrDeleteProduct += dtRows[i]["Pgm_ProductNumber"].ToString().Trim() + ","; }
  1105. }
  1106. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Service);
  1107. if (StrDeleteProduct.Trim() != "")
  1108. { StrDeleteProduct = "有服务已删除,已删除服务编号为:" + StrDeleteProduct.TrimEnd(',') + ";"; }
  1109. if (PackagesType == EnumPublic.EnumPackagesType.AAAAAAB)
  1110. { this.GetIsActivity(IsActivity); }
  1111. this.GetShowAmount();
  1112. return StrDeleteProduct;
  1113. }
  1114. /// <summary>
  1115. /// 绑定服务列表的数据信息
  1116. /// </summary>
  1117. /// <param name="erpOrder"></param>
  1118. public void GetOrderServiceValueData(Api_ErpOrderModel erpOrder)
  1119. {
  1120. erpOrder.OrderServiceData=new List<Api_ServiceModel>();
  1121. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  1122. {
  1123. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.Items[i].Tag;
  1124. Api_ServiceModel model = new Api_ServiceModel()
  1125. {
  1126. PgmID = ColumnModel.PgmID,
  1127. ServiceCostPrice = ColumnModel.ServiceCostPrice,
  1128. ServiceNumber = ColumnModel.ServiceNumber,
  1129. ServiceOrderID = ColumnModel.ServiceOrderID,
  1130. ServiceUnit = ColumnModel.ServiceUnit,
  1131. ServiceName = this.listViewData_Service.Items[i].Text.Trim(),
  1132. SerNumber = this.listViewData_Service.Items[i].SubItems["服务数量"].Text,
  1133. Source = this.listViewData_Service.Items[i].SubItems["来源"].Text,
  1134. strRank = this.listViewData_Service.Items[i].SubItems["备注"].Text.Trim(),
  1135. GroupName = this.listViewData_Service.Items[i].Group==null?"": this.listViewData_Service.Items[i].Group.Header.ToString(),
  1136. ServicePrice = this.listViewData_Service.Items[i].SubItems["服务价格"].Text
  1137. };
  1138. erpOrder.OrderServiceData.Add(model);
  1139. }
  1140. }
  1141. /// <summary>
  1142. /// 获取订单商品资料
  1143. /// </summary>
  1144. /// <param name="SightsViceNumberList"></param>
  1145. /// <param name="IsContinue"></param>
  1146. /// <param name="IsMagess">是否检测无数据提示:true为提示(如用于保存订单);false为不提示(如用于保存意向订单)</param>
  1147. /// <returns></returns>
  1148. public List<Helper.CommandInfo> GetOrderServiceValue(DateTime strTime, ref bool IsContinue, string StrOrdNumber, string Marriage, Hashtable htGroupList, string MarriageLunar = "0")
  1149. {
  1150. string DateMarriage = "";
  1151. if (Marriage != "")
  1152. {
  1153. if (MarriageLunar.Trim() == "1")
  1154. {
  1155. if (string.IsNullOrEmpty(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetLunarCalendarToSolarCalendar(Marriage)))
  1156. {
  1157. MessageBoxCustom.Show("婚期日期:农历不存在" + Marriage + "此日期!");
  1158. IsContinue = true;
  1159. return null;
  1160. }
  1161. DateMarriage = Convert.ToDateTime(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetLunarCalendarToSolarCalendar(Marriage)).ToString("yyyy-MM-dd");
  1162. }
  1163. else
  1164. { DateMarriage = Convert.ToDateTime(Marriage).ToString("yyyy-MM-dd"); }
  1165. }
  1166. List<LYFZ.Model.Model_ErpWeddingService> mlist = new List<Model.Model_ErpWeddingService>();
  1167. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  1168. LYFZ.Model.Model_ErpWeddingService model = null;
  1169. DataTable Old_tbl = wsbll.GetList("Ws_Number='" + StrOrdNumber + "'").Tables[0];
  1170. Old_tbl.PrimaryKey = new DataColumn[] { Old_tbl.Columns["ID"] };
  1171. bool IsNotGroup = false;
  1172. DataTable dtMarriage = orbll.GetView_Custom("select Cus_DayForMarriage,Cus_DayForMarriageLunar from tb_ErpCustomerGroup Left Join tb_ErpCustomerGroupMembers on GP_CustomerGroupID = GM_CustomerGroupID Left Join tb_ErpCustomer on Cus_CustomerNumber = GM_CustomerID Where GM_Master =1 and GP_OrderNumber = 'QT16102400006'").Tables[0];
  1173. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  1174. {
  1175. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.Items[i].Tag;
  1176. if (!string.IsNullOrEmpty(ColumnModel.ServiceOrderID))
  1177. {
  1178. #region
  1179. DataRow dtRow = Old_tbl.Rows.Find(ColumnModel.ServiceOrderID.Trim());
  1180. if (dtRow != null)
  1181. {
  1182. model = wsbll.DataRowToModel(dtRow);
  1183. if (model.Ws_Status.Trim() != "1")
  1184. {
  1185. bool IsFind = false;
  1186. if (this.listViewData_Service.Groups.Count > 0)
  1187. {
  1188. if (this.listViewData_Service.Items[i].Group.Header.Trim() != "未分组")
  1189. {
  1190. if (htGroupList.Count > 0)
  1191. {
  1192. if (htGroupList.ContainsKey(this.listViewData_Service.Items[i].Group.Header.Trim()))
  1193. {
  1194. model.Ws_ViceNumber = htGroupList[this.listViewData_Service.Items[i].Group.Header.Trim()].ToString().Trim();
  1195. IsFind = true;
  1196. }
  1197. }
  1198. }
  1199. else
  1200. { IsNotGroup = true; }
  1201. }
  1202. if (!IsFind)
  1203. { model.Ws_ViceNumber = StrOrdNumber + "_001"; }
  1204. model.Ws_OpenOrderRemark = this.listViewData_Service.Items[i].SubItems["备注"].Text.Trim();
  1205. }
  1206. Old_tbl.Rows.Remove(dtRow);
  1207. }
  1208. if (model == null)
  1209. { MessageBoxCustom.Show("数据出错,重新点击保存试试!"); IsContinue = true; return null; }
  1210. #endregion
  1211. }
  1212. else
  1213. {
  1214. #region
  1215. model = new Model.Model_ErpWeddingService();
  1216. bool IsFind = false;
  1217. if (this.listViewData_Service.Groups.Count > 0)
  1218. {
  1219. if (this.listViewData_Service.Items[i].Group.Header.Trim() != "未分组")
  1220. {
  1221. if (htGroupList.Count > 0)
  1222. {
  1223. if (htGroupList.ContainsKey(this.listViewData_Service.Items[i].Group.Header.Trim()))
  1224. {
  1225. IsFind = true;
  1226. model.Ws_ViceNumber = htGroupList[this.listViewData_Service.Items[i].Group.Header.Trim()].ToString().Trim();
  1227. }
  1228. }
  1229. }
  1230. else
  1231. { IsNotGroup = true; }
  1232. }
  1233. if (!IsFind)
  1234. { model.Ws_ViceNumber = StrOrdNumber + "_001"; }
  1235. model.Ws_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  1236. model.Ws_ProdName = this.listViewData_Service.Items[i].Text.Trim();
  1237. model.Ws_ProdNumber = ColumnModel.ServiceNumber;
  1238. model.Ws_ProdCostPrice = Convert.ToDecimal(ColumnModel.ServiceCostPrice);
  1239. model.Ws_OpenOrderSource = this.listViewData_Service.Items[i].SubItems["来源"].Text.Trim();
  1240. model.Ws_Remark = "";
  1241. model.Ws_Serviceman1 = "";
  1242. model.Ws_Serviceman2 = "";
  1243. model.Ws_Status = "0";
  1244. model.Ws_Type = "1";
  1245. model.Ws_UpdateName = "";
  1246. model.Ws_WeddingDispatcher = "";
  1247. model.Ws_OpenOrderRemark = this.listViewData_Service.Items[i].SubItems["备注"].Text.Trim();
  1248. model.Ws_ReservationServiceDividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  1249. #endregion
  1250. }
  1251. if (!string.IsNullOrEmpty(DateMarriage))
  1252. {
  1253. if (Convert.ToDateTime(DateMarriage) > LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime())
  1254. {
  1255. if (model.Ws_Status == "0")
  1256. {
  1257. if (dtMarriage.Rows.Count > 0 && model.Ws_WeddingDate != null && dtMarriage.Rows[0]["Cus_DayForMarriage"].ToString().Trim().Length > 0)
  1258. {
  1259. if (Convert.ToDateTime(dtMarriage.Rows[0]["Cus_DayForMarriage"]).ToString("yyyy-MM-dd") != Convert.ToDateTime(model.Ws_WeddingDate).ToString("yyyy-MM-dd"))
  1260. {
  1261. model.Ws_WeddingDate = Convert.ToDateTime(DateMarriage);
  1262. model.Ws_WeddingDateLunar = "0";
  1263. }
  1264. }
  1265. else
  1266. {
  1267. model.Ws_WeddingDate = Convert.ToDateTime(DateMarriage);
  1268. model.Ws_WeddingDateLunar = "0";
  1269. }
  1270. }
  1271. }
  1272. }
  1273. model.Ws_OrderByNumber = (i + 1);
  1274. model.Ws_UpdateDateTime = strTime;
  1275. model.Ws_Number = StrOrdNumber;
  1276. model.Ws_ProdQuantity = Convert.ToInt32(this.listViewData_Service.Items[i].SubItems["服务数量"].Text);
  1277. model.Ws_Unit = ColumnModel.ServiceUnit;
  1278. model.Ws_ProdSoldPrice = Convert.ToDecimal(this.listViewData_Service.Items[i].SubItems["服务价格"].Text);
  1279. if (model.ID > 0)
  1280. { clist.Add(wsbll.GetUpdateCommandInfo(model)); }
  1281. else
  1282. { clist.Add(wsbll.GetAddCommandInfo(model)); }
  1283. mlist.Add(model);
  1284. }
  1285. for (int i = 0; i < Old_tbl.Rows.Count; i++)
  1286. { clist.Add(wsbll.GetDeleteCommandInfo("ID", "=", Old_tbl.Rows[i]["ID"].ToString().Trim())); }
  1287. if (IsNotGroup)
  1288. {
  1289. if (MessageBoxCustom.Show("订单服务有未分组所属拍摄次数,若继续保存则会默认识别为第一次拍摄,是否要继续保存?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  1290. {
  1291. IsContinue = true;
  1292. return null;
  1293. }
  1294. }
  1295. return clist;
  1296. }
  1297. /// <summary>
  1298. /// 移除礼包的项目
  1299. /// </summary>
  1300. public void RemovePackageItem()
  1301. {
  1302. if (this.listViewData_Service.Items.Count > 0)
  1303. {
  1304. List<ListViewItem> listItem = new List<ListViewItem>();
  1305. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  1306. {
  1307. if (!string.IsNullOrEmpty(this.listViewData_Service.Items[i].SubItems["来源"].Text.Trim()))
  1308. { listItem.Add(this.listViewData_Service.Items[i]); }
  1309. }
  1310. for (int i = 0; i < listItem.Count; i++)
  1311. { this.listViewData_Service.Items.Remove(listItem[i]); }
  1312. }
  1313. }
  1314. /// <summary>
  1315. /// 是否能操作
  1316. /// </summary>
  1317. /// <param name="IsActivity"></param>
  1318. void GetIsActivity(bool IsActivity)
  1319. {
  1320. this.btnServiceAllDelete.Enabled = !IsActivity;
  1321. this.btnServiceDelete.Enabled = !IsActivity;
  1322. this.btnServiceToolbox.Enabled = !IsActivity;
  1323. if (IsActivity && LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ChangeActiveContent)
  1324. {
  1325. this.btnServiceAllDelete.Enabled = IsActivity;
  1326. this.btnServiceDelete.Enabled = IsActivity;
  1327. this.btnServiceToolbox.Enabled = IsActivity;
  1328. }
  1329. }
  1330. /// <summary>
  1331. /// 获取商品总价
  1332. /// </summary>
  1333. public void GetShowAmount()
  1334. {
  1335. //总价相加
  1336. decimal decTotalPrice = 0;
  1337. decimal decTotalCostPrice = 0;
  1338. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  1339. {
  1340. int IntCount = Convert.ToInt32(this.listViewData_Service.Items[i].SubItems["服务数量"].Text);
  1341. if (!string.IsNullOrEmpty(this.listViewData_Service.Items[i].SubItems["服务价格"].Text.Trim()))
  1342. { decTotalPrice += Convert.ToDecimal(this.listViewData_Service.Items[i].SubItems["服务价格"].Text) * IntCount; }
  1343. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_ServiceColumnHeaderModel ColumnModel = (SetCustomControls_ServiceColumnHeaderModel)this.listViewData_Service.Items[i].Tag;
  1344. if (ColumnModel.ServiceCostPrice.Length > 0)
  1345. { decTotalCostPrice += Convert.ToDecimal(ColumnModel.ServiceCostPrice) * IntCount; }
  1346. }
  1347. this.txt_H.Text = "服务总价(" + decTotalPrice + ")";
  1348. this.txt_H.Tag = decTotalCostPrice;
  1349. }
  1350. }
  1351. }