public bool Post([FromBody] rawMaterialStockEntity rawMaterialStockEntity) { try { return(_rawmaterialStockServices.CreateRmSk(rawMaterialStockEntity)); } catch (Exception ex) { throw new ApiDataException(1000, "Category Not Found", HttpStatusCode.NotFound); } }
public bool Put([FromBody] rawMaterialStockEntity rawMaterialStockEntity) { try { if (rawMaterialStockEntity.stkRMID > 0) { return(_rawmaterialStockServices.UpdateRmSk(rawMaterialStockEntity)); } } catch (Exception ex) { throw new ApiDataException(1000, "Category not found", HttpStatusCode.NotFound); } return(false); }
public bool CreateRmSk(rawMaterialStockEntity obj) { bool res = false; SqlCommand cmd = new SqlCommand("RMST_spSaveRawMaterialStock"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@p_RMID", obj.RMID); // cmd.Parameters.AddWithValue("@p_RMName", obj.RMName); cmd.Parameters.AddWithValue("@p_UOMID", obj.UOMID); cmd.Parameters.AddWithValue("@p_stock", obj.stock); cmd.Parameters.AddWithValue("@p_re_Orderlevel", obj.re_Orderlevel); cmd.Parameters.AddWithValue("@p_ActionBy", obj.ActionBy); var locMax = _unitOfWork.DbLayer.ExecuteNonQuery(cmd); if (locMax != Int32.MaxValue) { res = true; } return(res); }