public IHttpActionResult PutIN_UnitType(int id, IN_UnitType iN_UnitType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iN_UnitType.UnitTypeID) { return(BadRequest()); } db.Entry(iN_UnitType).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!IN_UnitTypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetIN_UnitType(int id) { IN_UnitType iN_UnitType = db.IN_UnitType.Find(id); if (iN_UnitType == null) { return(NotFound()); } return(Ok(iN_UnitType)); }
public IHttpActionResult PostIN_UnitType(IN_UnitType iN_UnitType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.IN_UnitType.Add(iN_UnitType); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = iN_UnitType.UnitTypeID }, iN_UnitType)); }
public IHttpActionResult DeleteIN_UnitType(int id) { IN_UnitType iN_UnitType = db.IN_UnitType.Find(id); if (iN_UnitType == null) { return(NotFound()); } db.IN_UnitType.Remove(iN_UnitType); db.SaveChanges(); return(Ok(iN_UnitType)); }