public bool Post([FromBody] BOM_DetailsEntity BOM_DetailsEntity) { try { return(_BOM_DetailsServices.CreateBOM_Details(BOM_DetailsEntity)); } catch (Exception ex) { throw new ApiDataException(1000, "Category Not Found", HttpStatusCode.NotFound); } }
public bool Put([FromBody] BOM_DetailsEntity BOM_DetailsEntity) { try { if (BOM_DetailsEntity.BOMD_ID > 0) { return(_BOM_DetailsServices.UpdateBOM_Details(BOM_DetailsEntity.BOMD_ID, BOM_DetailsEntity)); } } catch (Exception ex) { throw new ApiDataException(1000, "Category not found", HttpStatusCode.NotFound); } return(false); }
public bool CreateBOM_Details(BOM_DetailsEntity obj) { bool res = false; SqlCommand cmd = new SqlCommand("BOM_spSaveBOM_Details"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@p_BOMD_ID", obj.BOMD_ID); cmd.Parameters.AddWithValue("@p_BOMID", obj.BOMID); cmd.Parameters.AddWithValue("@p_RMID", obj.RMID); cmd.Parameters.AddWithValue("@p_quantity", obj.quantity); cmd.Parameters.AddWithValue("@p_UOMID", obj.UOMID); cmd.Parameters.AddWithValue("@p_ActionBy", obj.ActionBy); var locMax = _unitOfWork.DbLayer.ExecuteNonQuery(cmd); if (locMax != Int32.MaxValue) { res = true; } return(res); }