//新增主单 // POST: /StockOutBill/Create/ public ActionResult Create(OutBillMaster outBillMaster) { string errorInfo = string.Empty; bool bResult = OutBillMasterService.Add(outBillMaster, this.User.Identity.Name.ToString(), out errorInfo); string msg = bResult ? "新增成功" : "新增失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet); }
public OutBillMaster CreateOutBillMaster(string warehouseCode, string billTypeCode, string operatePersonID) { //添加移库单主单 string billNo = CreateOutBillNo(); OutBillMaster outBillMaster = new OutBillMaster(); outBillMaster.BillNo = billNo; outBillMaster.BillDate = DateTime.Now; outBillMaster.BillTypeCode = billTypeCode; outBillMaster.Origin = "1"; outBillMaster.WarehouseCode = warehouseCode; outBillMaster.OperatePersonID = Guid.Parse(operatePersonID); outBillMaster.Status = "1"; ; outBillMaster.IsActive = "1"; outBillMaster.UpdateTime = DateTime.Now; OutBillMasterRepository.Add(outBillMaster); return outBillMaster; }
public void AddToOutBillDetail(OutBillMaster outBillMaster, Product product,decimal price, decimal quantity) { if (quantity > 0) { Locker.LockKey = outBillMaster.BillNo; OutBillDetail detail = new OutBillDetail(); detail.BillNo = outBillMaster.BillNo; detail.ProductCode = product.ProductCode; detail.UnitCode = product.UnitCode; detail.Price = price; detail.BillQuantity = quantity; detail.AllotQuantity = 0; detail.RealQuantity = 0; outBillMaster.OutBillDetails.Add(detail); } }
//修改主单 // POST: /StockOutBill/Edit/ public ActionResult Edit(OutBillMaster outBillMaster) { string errorInfo = string.Empty; bool bResult = OutBillMasterService.Save(outBillMaster, out errorInfo); string msg = bResult ? "修改成功" : "修改失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet); }