/// <summary> /// 数据保存/提交 方法 /// </summary> /// <param name="HandleTypeName">保存/提交</param> private void SaveOrSubmitMethod(string HandleTypeName) { try { gvPartsMsgList.EndEdit(); string opName = "调价单操作"; lblorder_num.Text = CommonUtility.GetNewNo(DataSources.EnumProjectType.ReceiptBill);//获取其它收货单编号 if (HandleTypeName == submit) { txtorder_status_name.Caption = DataSources.GetDescription(DataSources.EnumAuditStatus.SUBMIT, true); } else if (HandleTypeName == save) { txtorder_status_name.Caption = DataSources.GetDescription(DataSources.EnumAuditStatus.DRAFT, true); } List <SysSQLString> listSql = new List <SysSQLString>(); if (status == WindowStatus.Add || status == WindowStatus.Copy) { ModifyPriceId = Guid.NewGuid().ToString(); AddReceiptBillSql(listSql, ModifyPriceBillEntity, ModifyPriceId, HandleTypeName); opName = "新增调价单"; AddOrEditPartsListMsg(listSql, ModifyPriceId, WindowStatus.Add); } else if (status == WindowStatus.Edit) { EditReceiptBillSql(listSql, ModifyPriceBillEntity, ModifyPriceId, HandleTypeName); opName = "修改调价单"; AddOrEditPartsListMsg(listSql, ModifyPriceId, WindowStatus.Edit); } if (DBHelper.BatchExeSQLStringMultiByTrans(opName, listSql)) { MessageBoxEx.Show("保存成功!"); string QueryWhere = "enable_flag=1 "; //获取查询条件 UCModifyPriceBM.GetModifyPriceBillList(QueryWhere); //更新单据列表 deleteMenuByTag(this.Tag.ToString(), UCModifyPriceBM.Name); } else { MessageBoxEx.Show("保存失败!"); } } catch (Exception ex) { MessageBoxEx.Show("操作失败!" + ex.Message); } }
/// <summary> /// 数据保存/提交 方法 /// </summary> /// <param name="HandleTypeName">保存/提交</param> private void SaveOrSubmitMethod(string HandleTypeName) { try { if (CheckListInfo()) { string opName = "调价单操作"; lblorder_num.Text = CommonUtility.GetNewNo(DataSources.EnumProjectType.ModifyBill);//获取其它收货单编号 if (HandleTypeName == submit) { txtorder_status_name.Caption = DataSources.GetDescription(DataSources.EnumAuditStatus.SUBMIT, true); } else if (HandleTypeName == save) { txtorder_status_name.Caption = DataSources.GetDescription(DataSources.EnumAuditStatus.DRAFT, true); } List <SysSQLString> listSql = new List <SysSQLString>(); if (status == WindowStatus.Add || status == WindowStatus.Copy) { ModifyPriceId = Guid.NewGuid().ToString(); AddModifyBillSql(listSql, ModifyPriceBillEntity, ModifyPriceId, HandleTypeName); opName = "新增调价单"; AddOrEditPartsListMsg(listSql, ModifyPriceId, WindowStatus.Add); } else if (status == WindowStatus.Edit) { EditModifyBillSql(listSql, ModifyPriceBillEntity, ModifyPriceId, HandleTypeName); opName = "修改调价单"; AddOrEditPartsListMsg(listSql, ModifyPriceId, WindowStatus.Edit); } if (DBHelper.BatchExeSQLStringMultiByTrans(opName, listSql)) { if (HandleTypeName == submit) { MessageBoxEx.Show("提交成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (HandleTypeName == save) { MessageBoxEx.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } long StartDate = Common.LocalDateTimeToUtcLong(Convert.ToDateTime(DateTime.Now.AddMonths(-6).ToShortDateString())); //获取当前日期的半年前的日期 long EndDate = Common.LocalDateTimeToUtcLong(Convert.ToDateTime(DateTime.Now.ToShortDateString())); //获取当前日期 string DefaultWhere = " enable_flag=1 and MdyBillTb.order_date between " + StartDate + " and " + EndDate; //默认查询条件 UCModifyPriceBM.GetModifyPriceBillList(DefaultWhere); //更新单据列表 deleteMenuByTag(this.Tag.ToString(), UCModifyPriceBM.Name); } else { if (HandleTypeName == submit) { MessageBoxEx.Show("提交失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (HandleTypeName == save) { MessageBoxEx.Show("保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return; } } } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question); } }