public IEnumerable <WareHousingItem> GetWareHousingItems(int wareHousingId) { WareHousingList wareHousingList = wareHousingListRespository.WareHousingList.FirstOrDefault(p => p.Id == wareHousingId); if (wareHousingList == null) { return(new List <WareHousingItem>()); } return(wareHousingList.WareHousingItems); }
public JsonResult StoreIntoWareHouse(List <WareHousingItem> wareHousingItems) { decimal totalPrice = 0.00M; totalPrice = wareHousingItems.Sum(item => item.PurchasePrice * item.Quantity); int employeeId = 1; WareHousingList wareHousingList = new WareHousingList { EmployeeId = employeeId, TotalPrice = totalPrice, WareHousingItems = wareHousingItems, WareHousingTime = DateTime.Now }; bool result = wareHousingListService.SaveWareHousingList(wareHousingList); new Thread(delegate() { WSController.SendWarnings(warningService); }).Start(); return(Json(result, JsonRequestBehavior.AllowGet)); }
public bool SaveWareHousingList(WareHousingList wareHouseList) { context.WareHousingList.Add(wareHouseList); context.SaveChanges(); return(true); }
public bool SaveWareHousingList(WareHousingList wareHousingList) { return(wareHousingListRespository.SaveWareHousingList(wareHousingList)); }