public bool Create(PurchaseOrderCommonEntity obj) { bool res = false; SqlCommand cmd = new SqlCommand("sp_PODInsert"); //SqlCommand cmd = new SqlCommand("PO_spSavePurchaseOrder"); cmd.CommandType = CommandType.StoredProcedure; ////cmd.Parameters.AddWithValue("@p_PurchaseID", obj.PurchaseID); cmd.Parameters.AddWithValue("@p_Code", obj.Code); cmd.Parameters.AddWithValue("@p_SupplierID", obj.SupplierID); cmd.Parameters.AddWithValue("@p_PurchaseDate", obj.PurchaseDate); cmd.Parameters.AddWithValue("@p_ExpectDeliveryDate", obj.ExpectDeliveryDate); cmd.Parameters.AddWithValue("@p_InvoiceNo", obj.InvoiceNo); cmd.Parameters.AddWithValue("@p_InvoiceDate", obj.InvoiceDate); cmd.Parameters.AddWithValue("@p_TransportMode", obj.TransportMode); cmd.Parameters.AddWithValue("@p_VechicleNumber", obj.VechicleNumber); cmd.Parameters.AddWithValue("@p_DateOfSupply", obj.DateOfSupply); cmd.Parameters.AddWithValue("@p_PlaceOfSupply", obj.PlaceOfSupply); cmd.Parameters.AddWithValue("@p_ActionBy", obj.ActionBy); cmd.Parameters.AddWithValue("@p_IsActive", obj.IsActive); cmd.Parameters.AddWithValue("@p_OrderDetails", obj.OrderDetails); var locMax = _unitOfWork.DbLayer.ExecuteNonQuery(cmd); if (locMax != Int32.MaxValue) { res = true; } return(res); }
public bool Post([FromBody] PurchaseOrderCommonEntity PurchaseOrderCommonEntity) { try { return(_POMasterService.Create(PurchaseOrderCommonEntity)); } catch (Exception ex) { throw new ApiDataException(1000, "Category Not Found", HttpStatusCode.NotFound); } }
public bool Put([FromBody] PurchaseOrderCommonEntity purchaseMDEntity) { try { if (purchaseMDEntity.PurchaseID > 0) { return(_POMasterService.Update(purchaseMDEntity.PurchaseID, purchaseMDEntity)); } } catch (Exception ex) { throw new ApiDataException(1000, "Product not found", HttpStatusCode.NotFound); } return(false); }
public bool Update(int PurchaseID, PurchaseOrderCommonEntity obj) { bool res = false; SqlCommand cmd = new SqlCommand("sp_PODUPDATE"); //SqlCommand cmd = new SqlCommand("PO_spSavePurchaseOrder"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@p_PurchaseID", obj.PurchaseID); cmd.Parameters.AddWithValue("@p_Code", obj.Code); cmd.Parameters.AddWithValue("@p_SupplierID", obj.SupplierID); cmd.Parameters.AddWithValue("@p_PurchaseDate", obj.PurchaseDate); cmd.Parameters.AddWithValue("@p_ExpectDeliveryDate", obj.ExpectDeliveryDate); cmd.Parameters.AddWithValue("@p_ActionBy", obj.ActionBy); cmd.Parameters.AddWithValue("@p_IsActive", obj.IsActive); cmd.Parameters.AddWithValue("@p_OrderDetails", obj.OrderDetails); var locMas = _unitOfWork.DbLayer.ExecuteNonQuery(cmd); if (locMas != Int32.MaxValue) { res = true; } return(res); }