public bool UpdateRawmaterial(int RMID, RawMaterialMasterEntity obj) { bool res = false; SqlCommand cmd = new SqlCommand("RM_spSaveRawMaterial"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@p_RMID", obj.RMID); cmd.Parameters.AddWithValue("@p_RMCode", obj.RMCode); cmd.Parameters.AddWithValue("@p_RMName", obj.RMName); cmd.Parameters.AddWithValue("@p_UOMID", obj.UOMID); cmd.Parameters.AddWithValue("@p_splitable", obj.splitable); cmd.Parameters.AddWithValue("@p_stock", obj.stock); cmd.Parameters.AddWithValue("@p_re_Orderlevel", obj.re_Orderlevel); //cmd.Parameters.AddWithValue("@p_HSNCode", obj.HSNCode); cmd.Parameters.AddWithValue("@p_sell_price", obj.sell_price); cmd.Parameters.AddWithValue("@p_cost_price", obj.cost_price); cmd.Parameters.AddWithValue("@p_ActionBy", obj.ActionBy); // cmd.Parameters.AddWithValue("@createdOn", obj.createdOn); //cmd.Parameters.AddWithValue("@modifiedOn", obj.modifiedOn); cmd.Parameters.AddWithValue("@p_IsActive", obj.IsActive); var locMax = _unitOfWork.DbLayer.ExecuteNonQuery(cmd); if (locMax != Int32.MaxValue) { res = true; } return(res); }
public bool Post([FromBody] RawMaterialMasterEntity RawMaterialMasterEntity) { try { return(_RawMaterialService.CreateRawmaterial(RawMaterialMasterEntity)); } catch (Exception ex) { throw new ApiDataException(1000, "Category Not Found", HttpStatusCode.NotFound); } }
public bool Put([FromBody] RawMaterialMasterEntity RawMaterialMasterEntity) { try { if (RawMaterialMasterEntity.RMID > 0) { return(_RawMaterialService.UpdateRawmaterial(RawMaterialMasterEntity.RMID, RawMaterialMasterEntity)); } } catch (Exception ex) { throw new ApiDataException(1000, "Category not found", HttpStatusCode.NotFound); } return(false); }