//public bool RemovePerchaseReport(PurchaseReportDS purchaseReportDS) //{ // bool returnvalue = false; // DynamicParameters param = new DynamicParameters(); // param.Add("@Id", purchaseReportDS.Id); // _db.Open(); // var val = _db.Execute("USP_PurchaseReport", param, commandType: CommandType.StoredProcedure); // if (val > 0) // { // returnvalue = true; // } // _db.Close(); // return returnvalue; //} public bool Update(PurchaseFormPostDs purchaseFormPostDs) { bool returnvalue = false; DynamicParameters param = new DynamicParameters(); param.Add("@Id", purchaseFormPostDs.PurchaseId); param.Add("@ProductId", purchaseFormPostDs.Product.ProductId); param.Add("@Supplier_Id", purchaseFormPostDs.Supplier.Supplier_Id); //param.Add("@LocationId", purchaseFormPostDs.Location.LocationId); param.Add("@UomId", purchaseFormPostDs.UOM.UomId); param.Add("@StoreId", purchaseFormPostDs.Store.StoreId); param.Add("@Quantity", purchaseFormPostDs.Quantity); param.Add("@ModifiedBy", 1); param.Add("@ModifiedDate", DateTime.UtcNow); param.Add("@PurchaseDate", purchaseFormPostDs.PurchaseDate); _db.Open(); var val = _db.Execute("USP_PurchaseReportUpdate", param, commandType: CommandType.StoredProcedure); if (val > 0) { returnvalue = true; } _db.Close(); return(returnvalue); }
public IHttpActionResult PurchaseNewEntry(PurchaseFormPostDs purchaseSave) { var isSave = _purchaseFormRepository.SavePurchaseDetail(purchaseSave); if (isSave == true) return Ok(isSave); return BadRequest(); }
public bool SavePurchaseDetail(PurchaseFormPostDs purchaseSave) { bool returnvalue = false; purchaseSave.ModifiedDate = now; purchaseSave.CreatedDate = now; DynamicParameters param = new DynamicParameters(); param.Add("@ProductId", purchaseSave.Product.ProductId); param.Add("@Supplier_Id", purchaseSave.Supplier.Supplier_Id); param.Add("@PurchaseDate", purchaseSave.PurchaseDate); param.Add("@UomId", purchaseSave.UOM.UomId); param.Add("@StoreId", purchaseSave.Store.StoreId); param.Add("@Quantity", purchaseSave.Quantity); param.Add("@Status", purchaseSave.Status); param.Add("@CreatedBy", purchaseSave.CreatedBy); param.Add("@CreatedDate", purchaseSave.CreatedDate); param.Add("@ModifiedBy", purchaseSave.ModifiedBy); param.Add("@ModifiedDate", purchaseSave.ModifiedDate); // param.Add("@LocationId", purchaseSave.Location.LocationId); _db.Open(); var val = _db.Execute("USP_PurchaseFormSave", param, commandType: CommandType.StoredProcedure); if (val > 0) { returnvalue = true; } _db.Close(); return(returnvalue); }
public IHttpActionResult Update(PurchaseFormPostDs purchaseFormPostDs) { var isupdate = _PurchaseReportRepository.Update(purchaseFormPostDs); if (isupdate == true) { return(Ok(isupdate)); } return(BadRequest()); }