DressOpenOrderSendWashSmallForm.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. namespace LYFZ.Software.MainBusiness.Dresses.SetSmallForm
  11. {
  12. public class DressOpenOrderSendWashFormMain_ColumnHeaderModel
  13. {
  14. private int _id;
  15. /// <summary>
  16. /// ID
  17. /// </summary>
  18. public int ID
  19. {
  20. get { return _id; }
  21. set { _id = value; }
  22. }
  23. private string _strDressNumber;
  24. /// <summary>
  25. /// 礼服编号
  26. /// </summary>
  27. public string StrDressNumber
  28. {
  29. get { return _strDressNumber; }
  30. set { _strDressNumber = value; }
  31. }
  32. private string _strCostPrice;
  33. /// <summary>
  34. /// 礼服成本价格
  35. /// </summary>
  36. public string StrCostPrice
  37. {
  38. get { return _strCostPrice; }
  39. set { _strCostPrice = value; }
  40. }
  41. private string _strDressPhotoNames;
  42. /// <summary>
  43. /// 礼服相片集合
  44. /// </summary>
  45. public string StrDressPhotoNames
  46. {
  47. get { return _strDressPhotoNames; }
  48. set { _strDressPhotoNames = value; }
  49. }
  50. }
  51. public partial class DressOpenOrderSendWashSmallForm : LYFZ.Software.UI.Dresses.SetSmallForm.DressOpenOrderSendWashSmallForm
  52. {
  53. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  54. LYFZ.BLL.BLL_ErpDressSendWashOrder sworbll = new BLL.BLL_ErpDressSendWashOrder();
  55. LYFZ.BLL.BLL_ErpDressSendWashDetail swdbll = new BLL.BLL_ErpDressSendWashDetail();
  56. public DressOpenOrderSendWashSmallForm()
  57. {
  58. this.Load += DressOpenOrderSendWashFormMain_Load;
  59. this.Shown += DressOpenOrderSendWashFormMain_Shown;
  60. this.btnDressDelete.Click += btnDressDelete_Click;
  61. this.btnDressToolbox.Click += btnDressToolbox_Click;
  62. this.btnNewOrder.Click += btnNewOrder_Click;
  63. this.btnSaveed.Click += btnSaveed_Click;
  64. this.btnCloseed.Click += btnCloseed_Click;
  65. this.FormClosed += DressOpenOrderSendWashFormMain_FormClosed;
  66. this.FormClosing += DressOpenOrderSendWashFormMain_FormClosing;
  67. }
  68. /// <summary>
  69. /// 订单号
  70. /// </summary>
  71. public string StrOrderNumber = "";
  72. /// <summary>
  73. /// 是否保存
  74. /// </summary>
  75. public bool IsSaveed = false;
  76. /// <summary>
  77. /// 相片集合
  78. /// </summary>
  79. ImageList mlistImage = new ImageList();
  80. /// <summary>
  81. /// 登录都编号
  82. /// </summary>
  83. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  84. /// <summary>
  85. /// 登录都姓名
  86. /// </summary>
  87. string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  88. /// <summary>
  89. /// 用于排序的类
  90. /// </summary>
  91. LYFZ.ComponentLibrary.ListViewColumnSorter lvwColumnSorter;
  92. /// <summary>
  93. /// 窗体加载事件
  94. /// </summary>
  95. /// <param name="sender"></param>
  96. /// <param name="e"></param>
  97. void DressOpenOrderSendWashFormMain_Load(object sender, EventArgs e)
  98. {
  99. this.listViewData.View = View.Details;
  100. this.listViewData.GridLines = true;
  101. string[] StrColumns = ("礼服编号,礼服名称,礼服尺寸,礼服数量,成本价格,出售价格").Split(',');
  102. for (int i = 0; i < StrColumns.Length; i++)
  103. {
  104. ColumnHeader ch = new ColumnHeader();
  105. ch.Text = StrColumns[i].Trim();
  106. ch.Width = (this.listViewData.Width - 23) / 6;
  107. if (StrColumns[i].Trim() == "成本价格" || StrColumns[i].Trim() == "出售价格")
  108. { ch.TextAlign = HorizontalAlignment.Right; }
  109. else if (StrColumns[i].Trim() == "礼服数量")
  110. { ch.TextAlign = HorizontalAlignment.Center; }
  111. else
  112. { ch.TextAlign = HorizontalAlignment.Left; }
  113. this.listViewData.Columns.Add(ch);
  114. }
  115. this.mlistImage.ImageSize = new Size(25, 25);
  116. this.mlistImage.ColorDepth = ColorDepth.Depth32Bit;
  117. this.listViewData.SmallImageList = mlistImage;
  118. lvwColumnSorter = new ComponentLibrary.ListViewColumnSorter();
  119. this.listViewData.ListViewItemSorter = lvwColumnSorter;
  120. }
  121. /// <summary>
  122. /// 窗体加载事件
  123. /// </summary>
  124. /// <param name="sender"></param>
  125. /// <param name="e"></param>
  126. void DressOpenOrderSendWashFormMain_Shown(object sender, EventArgs e)
  127. {
  128. if (!string.IsNullOrEmpty(this.StrOrderNumber))
  129. {
  130. this.txtOrderNumber.Text = this.StrOrderNumber;
  131. this.OpenOrderData();
  132. }
  133. else
  134. {
  135. this.txtOrderNumber.Text = LYFZ.BLL.BLL_ErpOrder.GenerateNewDressNumber(LYFZ.EnumPublic.EnumDressOrderType.送洗);
  136. this.txtEnterName.Text = this.StrUserName;
  137. this.btnSaveed.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressManagement, CustomAttributes.OperatingAuthority.Dress_Rental);
  138. }
  139. this.TopMost = false;
  140. }
  141. /// <summary>
  142. /// 打开订单数据
  143. /// </summary>
  144. void OpenOrderData()
  145. {
  146. DataTable dtOrder = orbll.GetView_Custom("tb_ErpDressSendWashOrder Left Join tb_ErpUser on User_EmployeeID = Dswo_CreateName", StrWhere: "Dswo_Number = '" + this.StrOrderNumber + "'", ShowColumnName: "Dswo_SendWashTime,Dswo_ReservationBackTime,User_Name,Dswo_Remark").Tables[0];
  147. if (dtOrder.Rows.Count > 0)
  148. {
  149. this.dtpSendWashTime.DateValue = dtOrder.Rows[0]["Dswo_SendWashTime"].ToString().Trim();
  150. this.dtpReservationBackTime.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(dtOrder.Rows[0]["Dswo_ReservationBackTime"]);
  151. this.txtEnterName.Text = dtOrder.Rows[0]["User_Name"].ToString().Trim();
  152. this.txtRemark.Text = dtOrder.Rows[0]["Dswo_Remark"].ToString().Trim();
  153. DataTable dt = orbll.GetView_Custom("tb_ErpDressSendWashDetail Left Join tb_ErpDressFrom on Dsfm_DressNumber = Dswd_DressNumber", StrWhere: "Dswd_Number = '" + this.StrOrderNumber + "'", ShowColumnName: "Dswd_DressNumber,Dsfm_DressCustomNumber,Dswd_DressName,Dsfm_DressSize,Dswd_CostPrice,Dswd_SalePrice,Dsfm_DressPhotoNames").Tables[0];
  154. for (int i = 0; i < dt.Rows.Count; i++)
  155. {
  156. string[] StrArrayList = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
  157. if (!this.mlistImage.Images.Keys.Contains(dt.Rows[i]["Dswd_DressNumber"].ToString().Trim()))
  158. {
  159. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDressImage_Small(StrArrayList[0].Trim());
  160. try
  161. {
  162. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  163. { this.mlistImage.Images.Add(dt.Rows[i]["Dswd_DressNumber"].ToString().Trim(), img); }));
  164. }
  165. catch
  166. { }
  167. }
  168. ListViewItem lvItem = new ListViewItem();
  169. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumn = new DressOpenOrderSendWashFormMain_ColumnHeaderModel();
  170. modelColumn.StrDressNumber = dt.Rows[i]["Dswd_DressNumber"].ToString().Trim();
  171. modelColumn.StrCostPrice = dt.Rows[i]["Dswd_CostPrice"].ToString().Trim();
  172. modelColumn.StrDressPhotoNames = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim();
  173. modelColumn.ID = 0;
  174. lvItem.Tag = modelColumn;
  175. lvItem.ImageKey = dt.Rows[i]["Dswd_DressNumber"].ToString().Trim();
  176. lvItem.Text = dt.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim();
  177. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  178. ListSubItem.Name = "礼服名称";
  179. ListSubItem.Text = dt.Rows[i]["Dswd_DressName"].ToString().Trim();
  180. lvItem.SubItems.Add(ListSubItem);
  181. ListSubItem = new ListViewItem.ListViewSubItem();
  182. ListSubItem.Name = "礼服尺寸";
  183. ListSubItem.Text = dt.Rows[i]["Dsfm_DressSize"].ToString().Trim();
  184. lvItem.SubItems.Add(ListSubItem);
  185. ListSubItem = new ListViewItem.ListViewSubItem();
  186. ListSubItem.Name = "礼服数量";
  187. ListSubItem.Text = "1";
  188. lvItem.SubItems.Add(ListSubItem);
  189. ListSubItem = new ListViewItem.ListViewSubItem();
  190. ListSubItem.Name = "成本价格";
  191. ListSubItem.Text = ListSubItem.Text = dt.Rows[i]["Dswd_CostPrice"].ToString().Trim(); ;
  192. lvItem.SubItems.Add(ListSubItem);
  193. ListSubItem = new ListViewItem.ListViewSubItem();
  194. ListSubItem.Name = "出售价格";
  195. ListSubItem.Text = ListSubItem.Text = dt.Rows[i]["Dswd_SalePrice"].ToString().Trim(); ;
  196. lvItem.SubItems.Add(ListSubItem);
  197. this.listViewData.Items.Add(lvItem);
  198. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData);
  199. }
  200. }
  201. }
  202. Hashtable htData_del = new Hashtable();
  203. /// <summary>
  204. /// 礼服移除
  205. /// </summary>
  206. /// <param name="sender"></param>
  207. /// <param name="e"></param>
  208. void btnDressDelete_Click(object sender, EventArgs e)
  209. {
  210. if (this.listViewData.Items.Count > 0)
  211. {
  212. if (MessageBoxCustom.Show("删除后无法找回,您确定要删除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  213. { return; }
  214. List<ListViewItem> delItem = new List<ListViewItem>();
  215. for (int i = 0; i < this.listViewData.SelectedItems.Count; i++)
  216. {
  217. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumn = (DressOpenOrderSendWashFormMain_ColumnHeaderModel)this.listViewData.SelectedItems[i].Tag;
  218. if (modelColumn.ID > 0)
  219. { this.htData_del[modelColumn.ID] = this.listViewData.SelectedItems[i].ImageKey.ToString().Trim(); }
  220. delItem.Add(this.listViewData.SelectedItems[i]);
  221. }
  222. for (int i = 0; i < delItem.Count; i++)
  223. { this.listViewData.Items.Remove(delItem[i]); }
  224. }
  225. if (this.listViewData.Items.Count > 0)
  226. { this.dtpSendWashTime.Enabled = false; }
  227. else
  228. { this.dtpSendWashTime.Enabled = true; }
  229. }
  230. /// <summary>
  231. /// 礼服工具箱
  232. /// </summary>
  233. /// <param name="sender"></param>
  234. /// <param name="e"></param>
  235. void btnDressToolbox_Click(object sender, EventArgs e)
  236. {
  237. if (string.IsNullOrEmpty(this.dtpSendWashTime.DateValue.Trim()))
  238. { MessageBoxCustom.Show("请选择取衣时间!"); return; }
  239. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.ToolboxDressSamllForm frm = new ToolboxDressSamllForm();
  240. frm.StrTakeDressTime = this.dtpSendWashTime.DateValue.Trim();
  241. frm.strReturnDressTime = this.dtpReservationBackTime.DateValue.Trim();
  242. frm.WindowState = FormWindowState.Maximized;
  243. frm.ShowDialog();
  244. if (frm.IsSaveed)
  245. {
  246. List<string> frmList = frm.listSelect;
  247. for (int i = 0; i < this.listViewData.Items.Count; i++)
  248. {
  249. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumn = (DressOpenOrderSendWashFormMain_ColumnHeaderModel)this.listViewData.Items[i].Tag;
  250. if (frmList.Contains(modelColumn.StrDressNumber.Trim()))
  251. { frmList.Remove(modelColumn.StrDressNumber.Trim()); }
  252. }
  253. if (frmList.Count > 0)
  254. {
  255. string StrWhere = "";
  256. for (int i = 0; i < frmList.Count; i++)
  257. { StrWhere += "'" + frmList[i].Trim() + "',"; }
  258. StrWhere = "Dsfm_DressNumber in (" + StrWhere.TrimEnd(',') + ")";
  259. DataTable dt = orbll.GetView_Custom("tb_ErpDressFrom", StrWhere: StrWhere, ShowColumnName: "Dsfm_DressNumber,Dsfm_DressCustomNumber,Dsfm_DressName,Dsfm_DressSize,Dsfm_CostPrice,Dsfm_SalePrice,Dsfm_DressPhotoNames").Tables[0];
  260. if (dt.Rows.Count > 0)
  261. {
  262. for (int i = 0; i < dt.Rows.Count; i++)
  263. {
  264. string[] StrArrayList = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
  265. if (!this.mlistImage.Images.Keys.Contains(dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim()))
  266. {
  267. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDressImage_Small(StrArrayList[0].Trim());
  268. try
  269. {
  270. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  271. { this.mlistImage.Images.Add(dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim(), img); }));
  272. }
  273. catch
  274. { }
  275. }
  276. ListViewItem lvItem = new ListViewItem();
  277. lvItem.ForeColor = Color.Red;
  278. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumn = new DressOpenOrderSendWashFormMain_ColumnHeaderModel();
  279. modelColumn.StrDressNumber = dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim();
  280. modelColumn.StrCostPrice = dt.Rows[i]["Dsfm_CostPrice"].ToString().Trim();
  281. modelColumn.StrDressPhotoNames = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim();
  282. modelColumn.ID = 0;
  283. lvItem.Tag = modelColumn;
  284. lvItem.ImageKey = dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim();
  285. lvItem.Text = dt.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim();
  286. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  287. ListSubItem.Name = "礼服名称";
  288. ListSubItem.Text = dt.Rows[i]["Dsfm_DressName"].ToString().Trim();
  289. lvItem.SubItems.Add(ListSubItem);
  290. ListSubItem = new ListViewItem.ListViewSubItem();
  291. ListSubItem.Name = "礼服尺寸";
  292. ListSubItem.Text = dt.Rows[i]["Dsfm_DressSize"].ToString().Trim();
  293. lvItem.SubItems.Add(ListSubItem);
  294. ListSubItem = new ListViewItem.ListViewSubItem();
  295. ListSubItem.Name = "礼服数量";
  296. ListSubItem.Text = "1";
  297. lvItem.SubItems.Add(ListSubItem);
  298. ListSubItem = new ListViewItem.ListViewSubItem();
  299. ListSubItem.Name = "成本价格";
  300. ListSubItem.Text = dt.Rows[i]["Dsfm_CostPrice"].ToString().Trim();
  301. lvItem.SubItems.Add(ListSubItem);
  302. ListSubItem = new ListViewItem.ListViewSubItem();
  303. ListSubItem.Name = "出售价格";
  304. ListSubItem.Text = dt.Rows[i]["Dsfm_SalePrice"].ToString().Trim();
  305. lvItem.SubItems.Add(ListSubItem);
  306. this.listViewData.Items.Add(lvItem);
  307. }
  308. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData);
  309. }
  310. }
  311. if (this.listViewData.Items.Count > 0)
  312. { this.dtpSendWashTime.Enabled = false; }
  313. else
  314. { this.dtpSendWashTime.Enabled = true; }
  315. }
  316. }
  317. /// <summary>
  318. /// 新订单
  319. /// </summary>
  320. /// <param name="sender"></param>
  321. /// <param name="e"></param>
  322. void btnNewOrder_Click(object sender, EventArgs e)
  323. {
  324. if (MessageBoxCustom.Show("重置后将清空所有数据,您确定要重置新订单吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  325. {
  326. this.IsGoForm = true;
  327. this.Close();
  328. }
  329. }
  330. /// <summary>
  331. /// 保存
  332. /// </summary>
  333. /// <param name="sender"></param>
  334. /// <param name="e"></param>
  335. void btnSaveed_Click(object sender, EventArgs e)
  336. {
  337. LYFZ.Model.Model_ErpDressSendWashOrder SendWashOrderModel = null;
  338. LYFZ.Model.Model_ErpDressSendWashDetail SendWashDetailModel = null;
  339. #region 判断输入框不能为空
  340. if (string.IsNullOrEmpty(this.txtOrderNumber.Text.Trim()))
  341. { MessageBoxCustom.Show("单号不能为空!"); return; }
  342. if (this.listViewData.Items.Count == 0)
  343. { MessageBoxCustom.Show("礼服资料不能为空!请选择礼服!"); return; }
  344. if (string.IsNullOrEmpty(this.dtpSendWashTime.DateValue.Trim()))
  345. { MessageBoxCustom.Show("送洗时间不能为空!"); return; }
  346. if (string.IsNullOrEmpty(this.dtpReservationBackTime.DateValue.Trim()))
  347. { MessageBoxCustom.Show("还回时间不能为空!"); return; }
  348. if (!string.IsNullOrEmpty(this.dtpReservationBackTime.DateValue.Trim()) && !string.IsNullOrEmpty(this.dtpReservationBackTime.DateValue.Trim()))
  349. {
  350. if (Convert.ToDateTime(this.dtpReservationBackTime.DateValue.Trim()) > Convert.ToDateTime(this.dtpReservationBackTime.DateValue.Trim()))
  351. { MessageBoxCustom.Show("送洗时间必须小于还回时间!"); return; }
  352. }
  353. #endregion
  354. #region 检测订单号是否有存在
  355. if (string.IsNullOrEmpty(StrOrderNumber))
  356. {
  357. bool IsFind = true;
  358. while (IsFind)
  359. {
  360. DataTable tbl = orbll.GetView_Custom("tb_ErpDressSendWashOrder", StrWhere: "Dswo_Number = '" + this.txtOrderNumber.Text.Trim() + "'", ShowColumnName: "ID").Tables[0];
  361. if (tbl.Rows.Count <= 0)
  362. { IsFind = false; }
  363. else
  364. { this.txtOrderNumber.Text = LYFZ.BLL.BLL_ErpOrder.GenerateNewDressNumber(LYFZ.EnumPublic.EnumDressOrderType.送洗); }
  365. }
  366. }
  367. #endregion
  368. #region 增加礼服送洗订单表
  369. DateTime StrTime = SDateTime.Now;
  370. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  371. if (!string.IsNullOrEmpty(this.StrOrderNumber))
  372. {
  373. SendWashOrderModel = sworbll.GetModel("Dswo_Number", this.StrOrderNumber);
  374. SendWashOrderModel.Dswo_UpdateDateTime = StrTime;
  375. SendWashOrderModel.Dswo_UpdateName = StrUserID;
  376. }
  377. else
  378. {
  379. SendWashOrderModel = new Model.Model_ErpDressSendWashOrder();
  380. SendWashOrderModel.Dswo_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  381. SendWashOrderModel.Dswo_Number = this.txtOrderNumber.Text.Trim();
  382. SendWashOrderModel.Dswo_CreateDateTime = StrTime;
  383. SendWashOrderModel.Dswo_CreateName = StrUserID;
  384. }
  385. SendWashOrderModel.Dswo_SendWashTime = Convert.ToDateTime(this.dtpSendWashTime.DateValue.Trim());
  386. SendWashOrderModel.Dswo_ReservationBackTime = Convert.ToDateTime(this.dtpReservationBackTime.DateValue.Trim());
  387. SendWashOrderModel.Dswo_Remark = this.txtRemark.Text.Trim();
  388. if (!string.IsNullOrEmpty(this.StrOrderNumber))
  389. { clist.Add(sworbll.GetUpdateCommandInfo(SendWashOrderModel)); }
  390. else
  391. { clist.Add(sworbll.GetAddCommandInfo(SendWashOrderModel)); }
  392. #endregion
  393. #region 租售礼服详情表
  394. foreach (DictionaryEntry item in htData_del)
  395. {
  396. clist.Add(swdbll.GetDeleteCommandInfo("ID", "=", item.Key.ToString().Trim()));
  397. }
  398. for (int i = 0; i < this.listViewData.Items.Count; i++)
  399. {
  400. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumns = (DressOpenOrderSendWashFormMain_ColumnHeaderModel)this.listViewData.Items[i].Tag;
  401. if (modelColumns.ID <= 0)
  402. {
  403. SendWashDetailModel = new Model.Model_ErpDressSendWashDetail();
  404. SendWashDetailModel.Dswd_Number = SendWashOrderModel.Dswo_Number;
  405. SendWashDetailModel.Dswd_DressNumber = this.listViewData.Items[i].ImageKey.ToString().Trim();
  406. SendWashDetailModel.Dswd_DressName = this.listViewData.Items[i].SubItems["礼服名称"].Text.Trim();
  407. SendWashDetailModel.Dswd_SendWashQuantity = Convert.ToInt32(this.listViewData.Items[i].SubItems["礼服数量"].Text.Trim());
  408. SendWashDetailModel.Dswd_CostPrice = Convert.ToDecimal(modelColumns.StrCostPrice);
  409. SendWashDetailModel.Dswd_SalePrice = Convert.ToDecimal(this.listViewData.Items[i].SubItems["出售价格"].Text.Trim());
  410. SendWashDetailModel.Dswd_CreateDatetime = StrTime;
  411. SendWashDetailModel.Dswd_CreateName = StrUserID;
  412. SendWashDetailModel.Dswd_BackTime = Convert.ToDateTime(null);
  413. SendWashDetailModel.Dswd_BackStatus = "3";
  414. SendWashDetailModel.Dswd_BackRemark = "";
  415. clist.Add(swdbll.GetAddCommandInfo(SendWashDetailModel));
  416. }
  417. }
  418. #endregion
  419. if (clist.Count > 0)
  420. {
  421. if (MessageBoxCustom.Show("您确定要保存吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  422. { return; }
  423. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  424. {
  425. this.IsSaveed = true;
  426. this.StrOrderNumber = this.txtOrderNumber.Text.Trim();
  427. MessageBoxCustom.Show("保存成功!");
  428. }
  429. else
  430. { MessageBoxCustom.Show("保存失败!"); }
  431. }
  432. }
  433. /// <summary>
  434. /// 关闭
  435. /// </summary>
  436. /// <param name="sender"></param>
  437. /// <param name="e"></param>
  438. void btnCloseed_Click(object sender, EventArgs e)
  439. {
  440. isClose = false;
  441. if (!isClose)
  442. {
  443. if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  444. { return; }
  445. }
  446. this.Close();
  447. }
  448. /// <summary>
  449. /// 关闭窗体前判断是否提示
  450. /// </summary>
  451. private bool isClose = true;
  452. /// <summary>
  453. /// 关闭是否要跳转
  454. /// </summary>
  455. bool IsGoForm = false;
  456. /// <summary>
  457. /// 窗体关闭后发生
  458. /// </summary>
  459. /// <param name="sender"></param>
  460. /// <param name="e"></param>
  461. void DressOpenOrderSendWashFormMain_FormClosed(object sender, FormClosedEventArgs e)
  462. {
  463. if (this.IsGoForm)
  464. {
  465. this.Hide();
  466. LYFZ.Software.MainBusiness.Dresses.DressOpenOrderFirstFormMain frm = new DressOpenOrderFirstFormMain();
  467. frm.StartPosition = FormStartPosition.CenterScreen;
  468. frm.TopMost = true;
  469. frm.Show();
  470. }
  471. }
  472. /// <summary>
  473. /// 窗体关闭前发生
  474. /// </summary>
  475. /// <param name="sender"></param>
  476. /// <param name="e"></param>
  477. void DressOpenOrderSendWashFormMain_FormClosing(object sender, FormClosingEventArgs e)
  478. {
  479. if (!this.IsGoForm)
  480. {
  481. if (this.isClose)
  482. {
  483. if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  484. { e.Cancel = true; }
  485. }
  486. }
  487. }
  488. }
  489. }