public StockInSkuAndPurchase(WarehouseInItem oInItem, PurchaseItem oPurchaseItem) { this.oInItem = oInItem; this.oPurchaseItem = oPurchaseItem; }
public ActionResult InItemEditDB(WarehouseInItem model) { if (!base.CheckPrivilege("EnablePrepare"))//制表权限验证 return RedirectToAction("ErrorPage", "Home", new { message = "Sorry you have no privilege to visit the Page" }); if (model.Quantity == 0m) { return Error("数量必须大于零", Url.Action("InItemEdit", new { itemID = model.Gid })); } WarehouseInItem inItem = dbEntity.WarehouseInItems.Find(model.Gid); if (inItem == null || inItem.Deleted) { return Error("记录不存在", Url.Action("StockIn")); } else { inItem.SkuID = model.SkuID; inItem.ShelfID = model.ShelfID; inItem.TrackLot = model.TrackLot; inItem.Quantity = model.Quantity; inItem.Guarantee = model.Guarantee; inItem.GenBarcode = model.GenBarcode; dbEntity.SaveChanges(); WarehouseStockIn stockIn = (from s in dbEntity.WarehouseStockIns.Include("StockInItems") where s.Gid == inItem.InID && !s.Deleted select s).Single(); stockIn.Total = stockIn.StockInItems.Select(item => item.Quantity).Sum(); dbEntity.SaveChanges(); whBll = new WarehouseBLL(dbEntity); whBll.InventoryByWarehouseSku(stockIn.WhID, model.SkuID); return RedirectToAction("StockInEdit", new { inID = inItem.InID }); } }
public StockInSku(WarehouseInItem oInItem, OrderItem oOderItem) { this.oInItem = oInItem; this.oOderItem = oOderItem; }
/// <summary> /// 入库单明细添加 /// </summary> /// <param name="inID">对应的入库单ID</param> /// <returns>返回添加入库单条目的部分页</returns> public ActionResult InItemAdd(Guid inID) { if (!base.CheckPrivilege("EnablePrepare"))//制表权限验证 return RedirectToAction("ErrorPage", "Home", new { message = "Sorry you have no privilege to visit the Page" }); WarehouseStockIn stockIn = dbEntity.WarehouseStockIns.Find(inID); if (stockIn == null || stockIn.Deleted) { return Error("记录不存在", Url.Action("StockInEdit", new { inID = inID })); } else { WarehouseInItem inItem = new WarehouseInItem { InID = inID, StockIn = stockIn, Quantity = 1m }; #region 货架下拉框数据 var shelves = (from shelf in dbEntity.WarehouseShelves where shelf.WhID == stockIn.WhID && shelf.Deleted == false select new { Code = shelf.Code, Gid = shelf.Gid }).ToList(); List<SelectListItem> list = (from shelf in shelves select new SelectListItem { Text = shelf.Code, Value = shelf.Gid.ToString() }).ToList(); ViewBag.Shelf = list; #endregion 货架下拉框数据 return View(inItem); } }