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("未选中数据行!"); } }
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); } } }