123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.Dresses.SetSmallForm
- {
- public class DressOpenOrderSendWashFormMain_ColumnHeaderModel
- {
- private int _id;
- /// <summary>
- /// ID
- /// </summary>
- public int ID
- {
- get { return _id; }
- set { _id = value; }
- }
- private string _strDressNumber;
- /// <summary>
- /// 礼服编号
- /// </summary>
- public string StrDressNumber
- {
- get { return _strDressNumber; }
- set { _strDressNumber = value; }
- }
- private string _strCostPrice;
- /// <summary>
- /// 礼服成本价格
- /// </summary>
- public string StrCostPrice
- {
- get { return _strCostPrice; }
- set { _strCostPrice = value; }
- }
- private string _strDressPhotoNames;
- /// <summary>
- /// 礼服相片集合
- /// </summary>
- public string StrDressPhotoNames
- {
- get { return _strDressPhotoNames; }
- set { _strDressPhotoNames = value; }
- }
- }
- public partial class DressOpenOrderSendWashSmallForm : LYFZ.Software.UI.Dresses.SetSmallForm.DressOpenOrderSendWashSmallForm
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpDressSendWashOrder sworbll = new BLL.BLL_ErpDressSendWashOrder();
- LYFZ.BLL.BLL_ErpDressSendWashDetail swdbll = new BLL.BLL_ErpDressSendWashDetail();
- public DressOpenOrderSendWashSmallForm()
- {
- this.Load += DressOpenOrderSendWashFormMain_Load;
- this.Shown += DressOpenOrderSendWashFormMain_Shown;
- this.btnDressDelete.Click += btnDressDelete_Click;
- this.btnDressToolbox.Click += btnDressToolbox_Click;
- this.btnNewOrder.Click += btnNewOrder_Click;
- this.btnSaveed.Click += btnSaveed_Click;
- this.btnCloseed.Click += btnCloseed_Click;
- this.FormClosed += DressOpenOrderSendWashFormMain_FormClosed;
- this.FormClosing += DressOpenOrderSendWashFormMain_FormClosing;
- }
- /// <summary>
- /// 订单号
- /// </summary>
- public string StrOrderNumber = "";
- /// <summary>
- /// 是否保存
- /// </summary>
- public bool IsSaveed = false;
- /// <summary>
- /// 相片集合
- /// </summary>
- ImageList mlistImage = new ImageList();
- /// <summary>
- /// 登录都编号
- /// </summary>
- string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 登录都姓名
- /// </summary>
- string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
- /// <summary>
- /// 用于排序的类
- /// </summary>
- LYFZ.ComponentLibrary.ListViewColumnSorter lvwColumnSorter;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void DressOpenOrderSendWashFormMain_Load(object sender, EventArgs e)
- {
- this.listViewData.View = View.Details;
- this.listViewData.GridLines = true;
- string[] StrColumns = ("礼服编号,礼服名称,礼服尺寸,礼服数量,成本价格,出售价格").Split(',');
- for (int i = 0; i < StrColumns.Length; i++)
- {
- ColumnHeader ch = new ColumnHeader();
- ch.Text = StrColumns[i].Trim();
- ch.Width = (this.listViewData.Width - 23) / 6;
- if (StrColumns[i].Trim() == "成本价格" || StrColumns[i].Trim() == "出售价格")
- { ch.TextAlign = HorizontalAlignment.Right; }
- else if (StrColumns[i].Trim() == "礼服数量")
- { ch.TextAlign = HorizontalAlignment.Center; }
- else
- { ch.TextAlign = HorizontalAlignment.Left; }
- this.listViewData.Columns.Add(ch);
- }
- this.mlistImage.ImageSize = new Size(25, 25);
- this.mlistImage.ColorDepth = ColorDepth.Depth32Bit;
- this.listViewData.SmallImageList = mlistImage;
- lvwColumnSorter = new ComponentLibrary.ListViewColumnSorter();
- this.listViewData.ListViewItemSorter = lvwColumnSorter;
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void DressOpenOrderSendWashFormMain_Shown(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrOrderNumber))
- {
- this.txtOrderNumber.Text = this.StrOrderNumber;
- this.OpenOrderData();
- }
- else
- {
- this.txtOrderNumber.Text = LYFZ.BLL.BLL_ErpOrder.GenerateNewDressNumber(LYFZ.EnumPublic.EnumDressOrderType.送洗);
- this.txtEnterName.Text = this.StrUserName;
- this.btnSaveed.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressManagement, CustomAttributes.OperatingAuthority.Dress_Rental);
- }
- this.TopMost = false;
- }
- /// <summary>
- /// 打开订单数据
- /// </summary>
- void OpenOrderData()
- {
- 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];
- if (dtOrder.Rows.Count > 0)
- {
- this.dtpSendWashTime.DateValue = dtOrder.Rows[0]["Dswo_SendWashTime"].ToString().Trim();
- this.dtpReservationBackTime.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(dtOrder.Rows[0]["Dswo_ReservationBackTime"]);
- this.txtEnterName.Text = dtOrder.Rows[0]["User_Name"].ToString().Trim();
- this.txtRemark.Text = dtOrder.Rows[0]["Dswo_Remark"].ToString().Trim();
- 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];
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- string[] StrArrayList = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
- if (!this.mlistImage.Images.Keys.Contains(dt.Rows[i]["Dswd_DressNumber"].ToString().Trim()))
- {
- Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDressImage_Small(StrArrayList[0].Trim());
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- { this.mlistImage.Images.Add(dt.Rows[i]["Dswd_DressNumber"].ToString().Trim(), img); }));
- }
- catch
- { }
- }
- ListViewItem lvItem = new ListViewItem();
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumn = new DressOpenOrderSendWashFormMain_ColumnHeaderModel();
- modelColumn.StrDressNumber = dt.Rows[i]["Dswd_DressNumber"].ToString().Trim();
- modelColumn.StrCostPrice = dt.Rows[i]["Dswd_CostPrice"].ToString().Trim();
- modelColumn.StrDressPhotoNames = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim();
- modelColumn.ID = 0;
- lvItem.Tag = modelColumn;
- lvItem.ImageKey = dt.Rows[i]["Dswd_DressNumber"].ToString().Trim();
- lvItem.Text = dt.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服名称";
- ListSubItem.Text = dt.Rows[i]["Dswd_DressName"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服尺寸";
- ListSubItem.Text = dt.Rows[i]["Dsfm_DressSize"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服数量";
- ListSubItem.Text = "1";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "成本价格";
- ListSubItem.Text = ListSubItem.Text = dt.Rows[i]["Dswd_CostPrice"].ToString().Trim(); ;
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "出售价格";
- ListSubItem.Text = ListSubItem.Text = dt.Rows[i]["Dswd_SalePrice"].ToString().Trim(); ;
- lvItem.SubItems.Add(ListSubItem);
- this.listViewData.Items.Add(lvItem);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData);
- }
- }
- }
- Hashtable htData_del = new Hashtable();
- /// <summary>
- /// 礼服移除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDressDelete_Click(object sender, EventArgs e)
- {
- if (this.listViewData.Items.Count > 0)
- {
- if (MessageBoxCustom.Show("删除后无法找回,您确定要删除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- List<ListViewItem> delItem = new List<ListViewItem>();
- for (int i = 0; i < this.listViewData.SelectedItems.Count; i++)
- {
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumn = (DressOpenOrderSendWashFormMain_ColumnHeaderModel)this.listViewData.SelectedItems[i].Tag;
- if (modelColumn.ID > 0)
- { this.htData_del[modelColumn.ID] = this.listViewData.SelectedItems[i].ImageKey.ToString().Trim(); }
- delItem.Add(this.listViewData.SelectedItems[i]);
- }
- for (int i = 0; i < delItem.Count; i++)
- { this.listViewData.Items.Remove(delItem[i]); }
- }
- if (this.listViewData.Items.Count > 0)
- { this.dtpSendWashTime.Enabled = false; }
- else
- { this.dtpSendWashTime.Enabled = true; }
- }
- /// <summary>
- /// 礼服工具箱
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDressToolbox_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.dtpSendWashTime.DateValue.Trim()))
- { MessageBoxCustom.Show("请选择取衣时间!"); return; }
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.ToolboxDressSamllForm frm = new ToolboxDressSamllForm();
- frm.StrTakeDressTime = this.dtpSendWashTime.DateValue.Trim();
- frm.strReturnDressTime = this.dtpReservationBackTime.DateValue.Trim();
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- List<string> frmList = frm.listSelect;
- for (int i = 0; i < this.listViewData.Items.Count; i++)
- {
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumn = (DressOpenOrderSendWashFormMain_ColumnHeaderModel)this.listViewData.Items[i].Tag;
- if (frmList.Contains(modelColumn.StrDressNumber.Trim()))
- { frmList.Remove(modelColumn.StrDressNumber.Trim()); }
- }
- if (frmList.Count > 0)
- {
- string StrWhere = "";
- for (int i = 0; i < frmList.Count; i++)
- { StrWhere += "'" + frmList[i].Trim() + "',"; }
- StrWhere = "Dsfm_DressNumber in (" + StrWhere.TrimEnd(',') + ")";
- 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];
- if (dt.Rows.Count > 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- string[] StrArrayList = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
- if (!this.mlistImage.Images.Keys.Contains(dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim()))
- {
- Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDressImage_Small(StrArrayList[0].Trim());
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- { this.mlistImage.Images.Add(dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim(), img); }));
- }
- catch
- { }
- }
- ListViewItem lvItem = new ListViewItem();
- lvItem.ForeColor = Color.Red;
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumn = new DressOpenOrderSendWashFormMain_ColumnHeaderModel();
- modelColumn.StrDressNumber = dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim();
- modelColumn.StrCostPrice = dt.Rows[i]["Dsfm_CostPrice"].ToString().Trim();
- modelColumn.StrDressPhotoNames = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim();
- modelColumn.ID = 0;
- lvItem.Tag = modelColumn;
- lvItem.ImageKey = dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim();
- lvItem.Text = dt.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服名称";
- ListSubItem.Text = dt.Rows[i]["Dsfm_DressName"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服尺寸";
- ListSubItem.Text = dt.Rows[i]["Dsfm_DressSize"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服数量";
- ListSubItem.Text = "1";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "成本价格";
- ListSubItem.Text = dt.Rows[i]["Dsfm_CostPrice"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "出售价格";
- ListSubItem.Text = dt.Rows[i]["Dsfm_SalePrice"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- this.listViewData.Items.Add(lvItem);
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData);
- }
- }
- if (this.listViewData.Items.Count > 0)
- { this.dtpSendWashTime.Enabled = false; }
- else
- { this.dtpSendWashTime.Enabled = true; }
- }
- }
- /// <summary>
- /// 新订单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnNewOrder_Click(object sender, EventArgs e)
- {
- if (MessageBoxCustom.Show("重置后将清空所有数据,您确定要重置新订单吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- {
- this.IsGoForm = true;
- this.Close();
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSaveed_Click(object sender, EventArgs e)
- {
- LYFZ.Model.Model_ErpDressSendWashOrder SendWashOrderModel = null;
- LYFZ.Model.Model_ErpDressSendWashDetail SendWashDetailModel = null;
- #region 判断输入框不能为空
- if (string.IsNullOrEmpty(this.txtOrderNumber.Text.Trim()))
- { MessageBoxCustom.Show("单号不能为空!"); return; }
- if (this.listViewData.Items.Count == 0)
- { MessageBoxCustom.Show("礼服资料不能为空!请选择礼服!"); return; }
- if (string.IsNullOrEmpty(this.dtpSendWashTime.DateValue.Trim()))
- { MessageBoxCustom.Show("送洗时间不能为空!"); return; }
- if (string.IsNullOrEmpty(this.dtpReservationBackTime.DateValue.Trim()))
- { MessageBoxCustom.Show("还回时间不能为空!"); return; }
- if (!string.IsNullOrEmpty(this.dtpReservationBackTime.DateValue.Trim()) && !string.IsNullOrEmpty(this.dtpReservationBackTime.DateValue.Trim()))
- {
- if (Convert.ToDateTime(this.dtpReservationBackTime.DateValue.Trim()) > Convert.ToDateTime(this.dtpReservationBackTime.DateValue.Trim()))
- { MessageBoxCustom.Show("送洗时间必须小于还回时间!"); return; }
- }
- #endregion
- #region 检测订单号是否有存在
- if (string.IsNullOrEmpty(StrOrderNumber))
- {
- bool IsFind = true;
- while (IsFind)
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpDressSendWashOrder", StrWhere: "Dswo_Number = '" + this.txtOrderNumber.Text.Trim() + "'", ShowColumnName: "ID").Tables[0];
- if (tbl.Rows.Count <= 0)
- { IsFind = false; }
- else
- { this.txtOrderNumber.Text = LYFZ.BLL.BLL_ErpOrder.GenerateNewDressNumber(LYFZ.EnumPublic.EnumDressOrderType.送洗); }
- }
- }
- #endregion
- #region 增加礼服送洗订单表
- DateTime StrTime = SDateTime.Now;
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- if (!string.IsNullOrEmpty(this.StrOrderNumber))
- {
- SendWashOrderModel = sworbll.GetModel("Dswo_Number", this.StrOrderNumber);
- SendWashOrderModel.Dswo_UpdateDateTime = StrTime;
- SendWashOrderModel.Dswo_UpdateName = StrUserID;
- }
- else
- {
- SendWashOrderModel = new Model.Model_ErpDressSendWashOrder();
- SendWashOrderModel.Dswo_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- SendWashOrderModel.Dswo_Number = this.txtOrderNumber.Text.Trim();
- SendWashOrderModel.Dswo_CreateDateTime = StrTime;
- SendWashOrderModel.Dswo_CreateName = StrUserID;
- }
- SendWashOrderModel.Dswo_SendWashTime = Convert.ToDateTime(this.dtpSendWashTime.DateValue.Trim());
- SendWashOrderModel.Dswo_ReservationBackTime = Convert.ToDateTime(this.dtpReservationBackTime.DateValue.Trim());
- SendWashOrderModel.Dswo_Remark = this.txtRemark.Text.Trim();
- if (!string.IsNullOrEmpty(this.StrOrderNumber))
- { clist.Add(sworbll.GetUpdateCommandInfo(SendWashOrderModel)); }
- else
- { clist.Add(sworbll.GetAddCommandInfo(SendWashOrderModel)); }
- #endregion
- #region 租售礼服详情表
- foreach (DictionaryEntry item in htData_del)
- {
- clist.Add(swdbll.GetDeleteCommandInfo("ID", "=", item.Key.ToString().Trim()));
- }
- for (int i = 0; i < this.listViewData.Items.Count; i++)
- {
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressOpenOrderSendWashFormMain_ColumnHeaderModel modelColumns = (DressOpenOrderSendWashFormMain_ColumnHeaderModel)this.listViewData.Items[i].Tag;
- if (modelColumns.ID <= 0)
- {
- SendWashDetailModel = new Model.Model_ErpDressSendWashDetail();
- SendWashDetailModel.Dswd_Number = SendWashOrderModel.Dswo_Number;
- SendWashDetailModel.Dswd_DressNumber = this.listViewData.Items[i].ImageKey.ToString().Trim();
- SendWashDetailModel.Dswd_DressName = this.listViewData.Items[i].SubItems["礼服名称"].Text.Trim();
- SendWashDetailModel.Dswd_SendWashQuantity = Convert.ToInt32(this.listViewData.Items[i].SubItems["礼服数量"].Text.Trim());
- SendWashDetailModel.Dswd_CostPrice = Convert.ToDecimal(modelColumns.StrCostPrice);
- SendWashDetailModel.Dswd_SalePrice = Convert.ToDecimal(this.listViewData.Items[i].SubItems["出售价格"].Text.Trim());
- SendWashDetailModel.Dswd_CreateDatetime = StrTime;
- SendWashDetailModel.Dswd_CreateName = StrUserID;
- SendWashDetailModel.Dswd_BackTime = Convert.ToDateTime(null);
- SendWashDetailModel.Dswd_BackStatus = "3";
- SendWashDetailModel.Dswd_BackRemark = "";
- clist.Add(swdbll.GetAddCommandInfo(SendWashDetailModel));
- }
- }
- #endregion
- if (clist.Count > 0)
- {
- if (MessageBoxCustom.Show("您确定要保存吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- {
- this.IsSaveed = true;
- this.StrOrderNumber = this.txtOrderNumber.Text.Trim();
- MessageBoxCustom.Show("保存成功!");
- }
- else
- { MessageBoxCustom.Show("保存失败!"); }
- }
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnCloseed_Click(object sender, EventArgs e)
- {
- isClose = false;
- if (!isClose)
- {
- if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- }
- this.Close();
- }
- /// <summary>
- /// 关闭窗体前判断是否提示
- /// </summary>
- private bool isClose = true;
- /// <summary>
- /// 关闭是否要跳转
- /// </summary>
- bool IsGoForm = false;
- /// <summary>
- /// 窗体关闭后发生
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void DressOpenOrderSendWashFormMain_FormClosed(object sender, FormClosedEventArgs e)
- {
- if (this.IsGoForm)
- {
- this.Hide();
- LYFZ.Software.MainBusiness.Dresses.DressOpenOrderFirstFormMain frm = new DressOpenOrderFirstFormMain();
- frm.StartPosition = FormStartPosition.CenterScreen;
- frm.TopMost = true;
- frm.Show();
- }
- }
- /// <summary>
- /// 窗体关闭前发生
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void DressOpenOrderSendWashFormMain_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (!this.IsGoForm)
- {
- if (this.isClose)
- {
- if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { e.Cancel = true; }
- }
- }
- }
- }
- }
|