public IHttpActionResult PostIC_ISM_Classifications(IC_ISM_Classifications iC_ISM_Classifications) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.IC_ISM_Classifications.Add(iC_ISM_Classifications); try { db.SaveChanges(); } catch (DbUpdateException) { if (IC_ISM_ClassificationsExists(iC_ISM_Classifications.ClassificationMarkingValue)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApiPost", new { id = iC_ISM_Classifications.ClassificationMarkingValue }, iC_ISM_Classifications)); }
public IHttpActionResult PutIC_ISM_Classifications(string id, IC_ISM_Classifications iC_ISM_Classifications) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iC_ISM_Classifications.ClassificationMarkingValue) { return(BadRequest()); } db.Entry(iC_ISM_Classifications).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!IC_ISM_ClassificationsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetIC_ISM_Classifications(string id) { IC_ISM_Classifications iC_ISM_Classifications = db.IC_ISM_Classifications.Find(id); if (iC_ISM_Classifications == null) { return(NotFound()); } return(Ok(new DropDownDTO { id = iC_ISM_Classifications.ClassificationMarkingValue, description = iC_ISM_Classifications.Description })); }
public IHttpActionResult DeleteIC_ISM_Classifications(string id) { IC_ISM_Classifications iC_ISM_Classifications = db.IC_ISM_Classifications.Find(id); if (iC_ISM_Classifications == null) { return(NotFound()); } db.IC_ISM_Classifications.Remove(iC_ISM_Classifications); db.SaveChanges(); return(Ok(iC_ISM_Classifications)); }