/// <summary> /// 删除实体 /// </summary> /// <param name="param">删除条件实体</param> /// <returns></returns> public WCFAddUpdateResult DelInfo(ORD_SalesReturnParam param) { this.CheckSession(); WCFAddUpdateResult ret = new WCFAddUpdateResult(); int affect = 0; try { #region 判断 if (param.SRGuid == null) { throw new WarnException("请指定要删除的退货单ID!"); } #endregion WhereClip whereClip = GetWhereClip(param); ORD_SalesReturnResult info = new ORD_SalesReturnResult(); info.IsDeleted = true; affect = this.Update <ORD_SalesReturnResult>(info, whereClip); #region 设置返回值 ret.Key = affect; #endregion } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(ret); }
public ORD_SalesReturnResult GetInfo(ORD_SalesReturnParam param) { ORD_SalesReturnResult ret = new ORD_SalesReturnResult(); ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.SPM.ORD_SalesReturnBLL", "GetInfo", param); ret = rst == null ? new ORD_SalesReturnResult() : rst.Result as ORD_SalesReturnResult; return(ret); }
public WCFAddUpdateResult AddOrUpdate(ORD_SalesReturnResult param) { WCFAddUpdateResult ret = new WCFAddUpdateResult(); ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.SPM.ORD_SalesReturnBLL", "AddOrUpdate", param); ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult); return(ret); }
object Form_GetEditEntity() { ORD_SalesReturnResult info = new ORD_SalesReturnResult(); info.SRGuid = SRGuid; info = this.ConvertControlToEntity <ORD_SalesReturnResult>(this.stcpBase.Controls, info, null); this.SetDataIsChanged <ORD_SalesReturnResult>(info); return(info); }
void biStkIn_Click(object sender, EventArgs e) { DataGridViewRow row = dgvSalesReturn.CurrentRow; if (row != null) { Guid? srguid = row.Cells["colSRGuid"].Value.ToGuid(); string billno = row.Cells["colBillNo"].Value.ToStringHasNull(); ORD_SalesReturnResult orderResult = returnLogic.GetInfo(new ORD_SalesReturnParam() { SRGuid = srguid }); if (orderResult != null && orderResult.Status == "Complete" && orderResult.StkInOccStatus != "全部占有") { List <ORD_SalesReturnLineResult> lineList = orderResult.ReturnLineList; if (lineList != null && lineList.Count > 0) { //有效的可作为入库明细的采购记录 List <ORD_SalesReturnLineResult> effLineList = lineList.Where(a => a.Qty > a.StkInOccQty.ToInt32()).ToList(); if (effLineList != null && effLineList.Count > 0) { List <STK_InResult> inResultList = stkInLogic.GetList(new STK_InParam() { SourceBillGuid = srguid, Status = "New" }); frmStkIn frmStkIn = new frmStkIn(); frmStkIn.BringToFront(); frmStkIn.StartPosition = FormStartPosition.CenterParent; if (inResultList != null && inResultList.Count > 0) { //存在关联的未提交的入库单 frmStkIn.StkInGuid = inResultList[0].StkInGuid; } else { frmStkIn.SourceBillGuid = srguid; frmStkIn.SourceBillNo = billno; frmStkIn.BillType = "SOR_IN"; } frmStkIn.ShowDialog(); } else { this.ShowMessage("当前销售退货单没有再需要入库的销售退货明细!若存在有关联的已提交未审核的入库单,请及时联系相关人员审核!"); } } } else { this.ShowMessage("未审核或者全部占有的销售退货单据不允许入库!"); } } else { this.ShowMessage("未选中数据行!"); } }
/// <summary> /// 获取集合 /// </summary> /// <param name="param"></param> /// <returns></returns> public List <ORD_SalesReturnLineResult> GetList(ORD_SalesReturnLineParam param) { this.CheckSession(); List <ORD_SalesReturnLineResult> ret = new List <ORD_SalesReturnLineResult>(); try { WhereClip whereClip = GetWhereClip(param); ret = this.SelectList <ORD_SalesReturnLineResult>(whereClip, ORD_SalesReturnLine._.CreatedTime.Asc); if (ret != null) { STK_InLineBLL stkInLineBLL = new STK_InLineBLL(); stkInLineBLL.SessionInfo = this.SessionInfo; Guid?[] stkInLineGuids = ret.Select(a => a.StkInLineGuid).Distinct().ToArray(); List <STK_InLineResult> linkInLineResultList = stkInLineBLL.GetList(new STK_InLineParam() { StkInLineGuids = stkInLineGuids }); ORD_SalesReturnBLL returnBLL = new ORD_SalesReturnBLL(); returnBLL.SessionInfo = this.SessionInfo; Guid?[] SRGuids = ret.Select(a => a.SRGuid).Distinct().ToArray(); List <ORD_SalesReturnResult> returnResultList = returnBLL.GetList(new ORD_SalesReturnParam() { SRGuids = SRGuids }); foreach (ORD_SalesReturnLineResult returnLineResult in ret) { ORD_SalesReturnResult returnResult = returnResultList.FirstOrDefault(a => a.SRGuid == returnLineResult.SRGuid); if (returnResult != null) { returnLineResult.SRBillNo = returnResult.BillNo; } STK_InLineResult linkStkInLineResult = linkInLineResultList.FirstOrDefault(a => a.StkInLineGuid == returnLineResult.StkInLineGuid); if (linkStkInLineResult != null) { returnLineResult.LinkStkInCurrency = linkStkInLineResult.Currency; returnLineResult.LinkStkInTaxRate = linkStkInLineResult.TaxRate; returnLineResult.LinkStkInUnitPrice = linkStkInLineResult.UnitPrice; returnLineResult.LinkStkInFreight = linkStkInLineResult.Freight; returnLineResult.LinkStkInCostPrice = linkStkInLineResult.CostPrice; } } } } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(ret); }
private void tsbSave_Click(object sender, EventArgs e) { ORD_SalesReturnResult info = Form_GetEditEntity() as ORD_SalesReturnResult; if (!this.DataIsChanged) { this.ShowNoChangedMsg(); return; } bsSalesReturnLine.EndEdit(); tempList.Clear(); foreach (ORD_SalesReturnLineResult rst in addOrModifyList) { if (rst.HasChanged()) { tempList.Add(rst); } } //tempList.AddRange(addOrModifyList); tempList.AddRange(delList); info.ReturnLineList = tempList; WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, ORD_SalesReturnResult>(info, returnLogic.AddOrUpdate, (a) => { if (a.KeyGuid.ToGuid() != Guid.Empty) { SRGuid = a.KeyGuid.ToGuid(); CRM_CompanyResult companyResult = companyLogic.GetCustInfo(new CRM_CompanyParam() { CompanyID = txtCustomerID.Text.ToInt32() }); if (companyResult != null) { companyResult.LastBusinessDate = txtReturnDate.Text.ToDateTime(); companyLogic.AddOrUpdateSup(companyResult); } if (SaveAttach != null) { SaveAttach("ORD_SalesReturn", SRGuid.ToGuid(), a.BillNo); } InitData(); delList.Clear(); } }); }
public bool UpdateStatus(ORD_SalesReturnParam param) { bool flag = true; try { ORD_SalesReturnResult orderResult = this.GetInfo(param); if (orderResult != null) { if (orderResult.ReturnLineList != null && orderResult.ReturnLineList.Count > 0) { List <ORD_SalesReturnLineResult> lineList = orderResult.ReturnLineList; if (lineList != null && lineList.Count > 0) { int?qty = lineList.Where(a => a.Qty != null).Select(a => a.Qty).Sum(); int?stkInQty = lineList.Where(a => a.StkInQty != null).Select(a => a.StkInQty).Sum(); if (stkInQty == 0) { orderResult.StkInStatus = "待入库"; } else if (stkInQty >= qty) { orderResult.StkInStatus = "全部入库"; } else { orderResult.StkInStatus = "部分入库"; } this.AddOrUpdate(orderResult); } } } } catch (WarnException exp) { flag = false; throw exp; } catch (System.Exception exp) { flag = false; LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(flag); }
public void InitSourceData(string billType, Guid?sourceBillGuid) { if (cboBillType.SelectedValue.ToStringHasNull() == "") { SYS_DictItemLineLogic.SetCombolSelectedIndex(cboBillType, billType, true); } switch (billType) { case "PO_IN": //采购入库 #region 采购入库 ORD_PurchaseOrderResult rst = purOrderLogic.GetInfo(new ORD_PurchaseOrderParam() { POGuid = sourceBillGuid }); if (rst != null) { bsStkInLine.Clear(); tempList.Clear(); delList.Clear(); addOrModifyList.Clear(); SetStkLineObjectValue(rst); CalcExchangeRate(); } #endregion break; case "SOR_IN": //销售退货入库 #region 销售退货入库 ORD_SalesReturnResult returnResult = returnLogic.GetInfo(new ORD_SalesReturnParam() { SRGuid = sourceBillGuid }); if (returnResult != null) { bsStkInLine.Clear(); tempList.Clear(); delList.Clear(); addOrModifyList.Clear(); SetStkLineObjectValue(returnResult); CalcExchangeRate(); } #endregion break; } }
private void InitData() { if (SRGuid != null) { ORD_SalesReturnResult info = returnLogic.GetInfo(new ORD_SalesReturnParam { SRGuid = SRGuid }); this.ConvertEntityToControl <ORD_SalesReturnResult>(this.stcpBase.Controls, info, null); if (info != null) { txtOperDeptName.Text = info.OperDeptName; decimal totalAmount = Math.Round(info.Amount.ToDecimal(), 3, MidpointRounding.AwayFromZero); txtAmount.Text = totalAmount.ToStringHasNull(); if (info.ReturnLineList != null) { addOrModifyList = info.ReturnLineList; } } } else { txtReturnDate.Text = DateTime.Now.Date.ToStringHasNull(); txtOperDeptID.Text = MySession.DeptID.ToStringHasNull(); txtOperDeptName.Text = MySession.DeptName; txtOperEmpID.Text = MySession.UserID.ToStringHasNull(); txtOperEmpName.Text = MySession.UserName.ToStringHasNull(); SYS_DictItemLineLogic.SetCombolSelectedIndex(this.cboOperOrgID, MySession.OrgID, true); } bsSalesReturnLine.DataSource = addOrModifyList; dgvSalesReturnLine.DataSource = bsSalesReturnLine; //CheckAuditButton("ORD_SalesOrder", SRGuid, this.tsbSubmit, null, this.tsbAudit, this.tsbUnDo); if (SRGuid == null && _SOGuid != null) { ORD_SalesOrderResult orderResult = orderLogic.GetInfo(new ORD_SalesOrderParam() { SOGuid = _SOGuid }); if (orderResult != null) { InitSourceData(orderResult); } } }
private void tsbDel_Click(object sender, EventArgs e) { ORD_SalesReturnParam param = new ORD_SalesReturnParam(); param.SRGuid = srguid; ORD_SalesReturnResult rst = returnLogic.GetInfo(param); if (rst != null) { if (MessageBox.Show("请确认是否要删除销售退货单:【" + rst.BillNo + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, ORD_SalesReturnParam>(param, returnLogic.DelInfo, a => { BindDataGridView(pgSalesReturn.PageIndex); }); } } else { this.ShowMessage("请选择需要删除的采购明细!"); } }
/// <summary> /// 获取一条信息记录 /// </summary> /// <param name="param"></param> /// <returns></returns> public ORD_SalesReturnResult GetInfo(ORD_SalesReturnParam param) { this.CheckSession(); ORD_SalesReturnResult rst = new ORD_SalesReturnResult(); #region 判断 if (param.SRGuid == null) { throw new WarnException("请指定销售退货单GUID!"); } #endregion #region 获取实体 rst = this.Select <ORD_SalesReturnResult>(GetWhereClip(param)); if (rst != null) { string[] statusArr = new string[] { rst.StkInStatus }; rst.AllStatus = string.Join(",", statusArr); ORD_SalesReturnLineBLL lineBLL = new ORD_SalesReturnLineBLL(); lineBLL.SessionInfo = this.SessionInfo; rst.ReturnLineList = lineBLL.GetList(new ORD_SalesReturnLineParam() { SRGuid = rst.SRGuid }); //this.SelectList<ORD_SalesOrderLineResult>(ORD_SalesOrderLine._.SOGuid == rst.SOGuid); HR_DepartmentBLL deptBLL = new HR_DepartmentBLL(); deptBLL.SessionInfo = this.SessionInfo; HR_DepartmentResult deptResult = deptBLL.GetInfo(new HR_DepartmentParam() { DeptID = rst.OperDeptID }); rst.OperDeptName = deptResult.DeptName; } #endregion return(rst); }
public void SetStkLineObjectValue(ORD_SalesReturnResult salesReturnRst) { decimal? totalAmount = 0.0m; decimal? scAmount = 0.0m; STK_InLineResult inLineRst; txtSourceBillGuid.Text = salesReturnRst.SRGuid.ToStringHasNull(); txtSourceBillNo.Text = salesReturnRst.BillNo; cboTaxRate.SelectedValue = ""; if (salesReturnRst.ReturnLineList != null && salesReturnRst.ReturnLineList.Count > 0) { cboCurrency.SelectedValue = salesReturnRst.ReturnLineList[0].Currency; } else { cboCurrency.SelectedValue = ""; } foreach (ORD_SalesReturnLineResult returnLineResult in salesReturnRst.ReturnLineList) { inLineRst = new STK_InLineResult(); SetStkLineObjectValue(inLineRst, returnLineResult); totalAmount += inLineRst.Amount.ToDecimal(); scAmount += inLineRst.SCAmount.ToDecimal(); bsStkInLine.Add(inLineRst); } totalAmount = Math.Round(totalAmount.ToDecimal(), 3, MidpointRounding.AwayFromZero); scAmount = Math.Round(scAmount.ToDecimal(), 3, MidpointRounding.AwayFromZero); txtAmount.Text = totalAmount.ToStringHasNull(); txtSCAmount.Text = scAmount.ToStringHasNull(); txtTaxAmount.Text = ""; this.cboOperOrgID.SelectedValue = salesReturnRst.OperOrgID; this.txtOperDeptID.Text = salesReturnRst.OperDeptName; this.txtOperDeptID.Text = salesReturnRst.OperDeptID.ToStringHasNull(); this.txtOperEmpID.Text = salesReturnRst.OperEmpID.ToStringHasNull(); this.txtOperEmpName.Text = salesReturnRst.OperEmpName.ToStringHasNull(); }
/// <summary> /// 添加和新增修改 /// </summary> /// <param name="param">新增或修改的实体</param> /// <returns></returns> public WCFAddUpdateResult AddOrUpdate(ORD_SalesReturnResult param) { this.CheckSession(); WCFAddUpdateResult ret = new WCFAddUpdateResult(); try { int affect = 0; #region 判断 if (string.IsNullOrEmpty(param.CustomerName.Trim())) { throw new WarnException("请选择客户!"); } if (string.IsNullOrEmpty(param.SOBillNo)) { throw new WarnException("请选择销售单号!"); } if (string.IsNullOrEmpty(param.OperEmpName)) { throw new WarnException("请选择归属人!"); } if (string.IsNullOrEmpty(param.Currency)) { throw new WarnException("请选择币种!"); } if (param.ReturnLineList == null) { throw new WarnException("请导入退货明细!"); } string msg = string.Empty; foreach (ORD_SalesReturnLineResult rst in param.ReturnLineList) { if (rst.StkOutLineGuid.ToGuid() == Guid.Empty) { msg = "请选择关联的出库明细!"; break; } if (rst.Qty <= 0) { msg = "请填写销售退货明细的数量!"; break; } } if (!string.IsNullOrEmpty(msg)) { throw new WarnException(msg); } #endregion List <ORD_SalesReturnLineResult> orderLineList = param.ReturnLineList; #region 系统默认值 if (param.SRGuid != null) { WhereClip where = ORD_SalesReturn._.SRGuid == param.SRGuid; param.UpdatedEmpID = this.SessionInfo.UserID; param.UpdatedEmpName = this.SessionInfo.UserName; param.UpdatedTime = DateTime.Now; affect = this.Update <ORD_SalesReturnResult>(param, where); } else { param.SRGuid = Guid.NewGuid(); Sys_CodeRulerBLL codeRulerBll = new Sys_CodeRulerBLL(); codeRulerBll.SessionInfo = this.SessionInfo; param.BillNo = param.BillNo = codeRulerBll.GetBillNo(new Entity.UserModel.Sys.SYS_CredentialCodeRuleParam() { BillDate = DateTime.Today, TableName = "ORD_SalesReturn" }); param.GCompanyID = this.SessionInfo.CompanyID; param.StkInOccStatus = "待占有"; param.StkInStatus = "待入库"; param.Status = "New"; param.ApproveStatus = "待提交"; param.IsDeleted = false; param.CreatedEmpID = this.SessionInfo.UserID; param.CreatedEmpName = this.SessionInfo.UserName; param.CreatedTime = DateTime.Now; affect = this.Insert <ORD_SalesReturnResult>(param); param = this.Select <ORD_SalesReturnResult>(new List <Field>() { ORD_SalesReturn._.All }, ORD_SalesReturn._.SRGuid == param.SRGuid); } foreach (ORD_SalesReturnLineResult rst in orderLineList) { if (rst.SRLineGuid.ToGuid() == Guid.Empty) { rst.SRLineGuid = Guid.NewGuid(); rst.SRGuid = param.SRGuid; rst.GCompanyID = this.SessionInfo.CompanyID; rst.CreatedEmpID = this.SessionInfo.UserID; rst.CreatedEmpName = this.SessionInfo.UserName; rst.CreatedTime = DateTime.Now; rst.IsDeleted = false; } else { rst.UpdatedEmpID = this.SessionInfo.UserID; rst.UpdatedEmpName = this.SessionInfo.UserName; rst.UpdatedTime = DateTime.Now; } } this.BatchInsertOrUpdate <ORD_SalesReturnLineResult>(orderLineList); this.BatchExecute(); #region 设置返回值 ret.Key = param.SRID.ToInt32(); ret.KeyGuid = param.SRGuid; ret.CreatedTime = param.CreatedTime; ret.CreatedEmpID = param.CreatedEmpID; ret.CreatedEmpName = param.CreatedEmpName; ret.UpdatedEmpID = param.UpdatedEmpID; ret.UpdatedEmpName = param.UpdatedEmpName; ret.UpdatedTime = param.UpdatedTime; #endregion #endregion } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(ret); }
public bool SubmitSalesReturnBill(ORD_SalesReturnParam param) { this.CheckSession(); bool submitFlag = true; try { ORD_SalesReturnResult returnResult = this.GetInfo(param); if (returnResult != null) { #region 判断是否可以提交 bool isAllowSubmit = true; if (returnResult.ApproveStatus == "待审核") { isAllowSubmit = false; throw new WarnException("销售退货单当前状态为:【已提交,待审核】,禁止重复提交!"); } else if (returnResult.ApproveStatus == "审核完成") { isAllowSubmit = false; throw new WarnException("销售退货单当前状态为:【审核完成】,撤单后才可以再次提交!"); } if (isAllowSubmit) { returnResult.Status = "Approve"; returnResult.ApproveStatus = "待审核"; WCFAddUpdateResult ret = this.AddOrUpdate(returnResult); if (ret.KeyGuid.ToGuid() == Guid.Empty) { submitFlag = false; } else { #region 定义相关变量 ORD_SalesOrderBLL saleOrderBLL = new ORD_SalesOrderBLL(); saleOrderBLL.SessionInfo = this.SessionInfo; ORD_SalesOrderLineBLL saleOrderLineBLL = new ORD_SalesOrderLineBLL(); saleOrderLineBLL.SessionInfo = this.SessionInfo; STK_OutBLL outBLL = new STK_OutBLL(); outBLL.SessionInfo = this.SessionInfo; STK_OutLineBLL outLineBLL = new STK_OutLineBLL(); outLineBLL.SessionInfo = this.SessionInfo; ORD_SalesReturnLineBLL returnLineBLL = new ORD_SalesReturnLineBLL(); returnLineBLL.SessionInfo = this.SessionInfo; Guid?[] SOLineGuids = null; Guid?[] StkOutLineGuids = null; Guid?[] SRGuids = null; Guid?[] effSRGuids = null; Guid?[] SOGuids = null; List <STK_OutLineResult> linkOutLineList = new List <STK_OutLineResult>(); List <ORD_SalesOrderLineResult> linkSaleOrderLineList = new List <ORD_SalesOrderLineResult>(); List <ORD_SalesReturnResult> linkReturnList = new List <ORD_SalesReturnResult>(); List <ORD_SalesReturnLineResult> linkReturnLineList = new List <ORD_SalesReturnLineResult>(); List <ORD_SalesReturnLineResult> effReturnLineList = new List <ORD_SalesReturnLineResult>(); #endregion List <ORD_SalesReturnLineResult> salesReturnLineList = returnLineBLL.GetList(new ORD_SalesReturnLineParam() { SRGuid = returnResult.SRGuid }); #region 更新出库明细的数量 //获取退货明细关联的出库明细ID集合 StkOutLineGuids = salesReturnLineList.Select(a => a.StkOutLineGuid).Distinct().ToArray(); if (StkOutLineGuids != null && StkOutLineGuids.Length > 0) { //退货明细关联的出库明细 linkOutLineList = outLineBLL.GetList(new STK_OutLineParam() { StkOutLineGuids = StkOutLineGuids }); //关联的出库明细所关联的退货明细 linkReturnLineList = returnLineBLL.GetList(new ORD_SalesReturnLineParam() { StkOutLineGuids = StkOutLineGuids }); SRGuids = linkReturnLineList.Select(a => a.SRGuid).Distinct().ToArray(); if (SRGuids != null && SRGuids.Length > 0) { //关联的出库明细所关联的退货明细对应的退货主单 linkReturnList = this.GetList(new ORD_SalesReturnParam() { SRGuids = SRGuids, StatusArr = new string[] { "Complete", "Approve" } }); if (linkReturnList != null && linkReturnList.Count > 0) { effSRGuids = linkReturnList.Select(a => (Guid?)a.SRGuid).Distinct().ToArray(); effReturnLineList = linkReturnLineList.Where(a => effSRGuids.Contains(a.SRGuid)).ToList(); foreach (STK_OutLineResult outLineResult in linkOutLineList) { int?qty = effReturnLineList.Where(a => a.StkOutLineGuid == outLineResult.StkOutLineGuid).Sum(a => a.Qty.ToInt32()); outLineResult.ReturnOccQty = qty; } } } //更新退货明细关联的出库明细的退货数量 outLineBLL.UpdateOrInsertList(linkOutLineList); } #endregion #region 更新销售明细的退货占有数量和销售主单的退货占有状态 //获取关联的销售明细ID集合 SOLineGuids = salesReturnLineList.Select(a => a.SOLineGuid).Distinct().ToArray(); linkSaleOrderLineList = saleOrderLineBLL.GetList(new ORD_SalesOrderLineParam() { SOLineGuids = SOLineGuids, IsCancel = false }); //获取关联的销售明细所关联的退货明细 linkReturnLineList = returnLineBLL.GetList(new ORD_SalesReturnLineParam() { SOLineGuids = SOLineGuids }); SRGuids = linkReturnLineList.Select(a => a.SRGuid).Distinct().ToArray(); if (SRGuids != null && SRGuids.Length > 0) { //销售明细所关联的退货明细对应的退货主单 linkReturnList = this.GetList(new ORD_SalesReturnParam() { SRGuids = SRGuids, StatusArr = new string[] { "Complete", "Approve" } }); if (linkReturnList != null && linkReturnList.Count > 0) { effSRGuids = linkReturnList.Select(a => (Guid?)a.SRGuid).Distinct().ToArray(); effReturnLineList = linkReturnLineList.Where(a => effSRGuids.Contains(a.SRGuid)).ToList(); foreach (ORD_SalesOrderLineResult saleLineResult in linkSaleOrderLineList) { int?qty = effReturnLineList.Where(a => a.SOLineGuid == saleLineResult.SOLineGuid).Sum(a => a.Qty.ToInt32()); saleLineResult.ReturnOccQty = qty; } } } saleOrderLineBLL.UpdateOrInsertList(linkSaleOrderLineList); SOGuids = linkSaleOrderLineList.Select(a => a.SOGuid).Distinct().ToArray(); foreach (Guid soguid in SOGuids) { saleOrderBLL.UpdateStatus(new ORD_SalesOrderParam() { SOGuid = soguid }); } #endregion } } #endregion } else { throw new WarnException("要提交的销售退货单在系统中不存在!"); } } catch (WarnException exp) { throw exp; } catch (Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(submitFlag); }