public bool Update(ApiBatch apiBatch) { IBatchManager batchManager = UnityResolver.Resolve <IBatchManager>(); Batch batch = new Batch { ID = apiBatch.ID, Date = apiBatch.Date, Qty = apiBatch.Qty, UnitPrice = apiBatch.UnitPrice, ItemID = apiBatch.ItemID, SupplierID = apiBatch.SupplierID, CustomerID = apiBatch.CustomerID }; return(batchManager.UpdateBatch(batch)); }
public bool Update(ApiBatch apiBatch) { //string id = User.Identity.Name; IBatchManager batchManager = UnityResolver.Resolve <IBatchManager>(); Batch batch = new Batch { ID = apiBatch.ID, Date = apiBatch.Date, Qty = apiBatch.Qty, UnitPrice = apiBatch.UnitPrice, ItemID = apiBatch.ItemID, SupplierID = apiBatch.SupplierID, CustomerID = Helper.getCustID() }; return(batchManager.UpdateBatch(batch)); }
public ApiBatch Get(int ID) { IBatchManager batchManager = UnityResolver.Resolve <IBatchManager>(); Batch batchModel = batchManager.FindBatchByID(ID); string id = User.Identity.Name; ApiBatch batch = new ApiBatch { ID = batchModel.ID, Date = batchModel.Date, Qty = batchModel.Qty, UnitPrice = batchModel.UnitPrice, ItemID = batchModel.ItemID, SupplierID = batchModel.SupplierID }; return(batch); }
public List <ApiBatch> GetList() { string id = User.Identity.Name; IBatchManager batchManager = UnityResolver.Resolve <IBatchManager>(); List <Batch> batchModelList = batchManager.GetAllBatches(); List <ApiBatch> batchList = new List <ApiBatch>(); foreach (Batch batchModel in batchModelList) { ApiBatch batch = new ApiBatch { ID = batchModel.ID, Date = batchModel.Date, Qty = batchModel.Qty, UnitPrice = batchModel.UnitPrice, ItemID = batchModel.ItemID, SupplierID = batchModel.SupplierID }; batchList.Add(batch); } return(batchList); }