public JsonResult Shipment(List <ShipmentItem> shipmentItemList, int dealerId) { decimal TotalPrice = shipmentItemList.Sum(p => p.Quantity * p.SellPrice); ShipmentList shipmentList = new ShipmentList { DealersId = dealerId, ShipmentTime = DateTime.Now, ShipmentItems = shipmentItemList, TotalPrice = TotalPrice }; bool result = shipmentService.SaveShipmentList(shipmentList); new Thread(delegate() { WSController.SendWarnings(warningService); }).Start(); return(Json(result)); }
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)); }