public async Task <IHttpActionResult> PuttUserEncounterReason(int id, tUserEncounterReason tUserEncounterReason) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tUserEncounterReason.ID) { return(BadRequest()); } db.Entry(tUserEncounterReason).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tUserEncounterReasonExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GettUserEncounterReason(int id) { tUserEncounterReason tUserEncounterReason = await db.tUserEncounterReasons.FindAsync(id); if (tUserEncounterReason == null) { return(NotFound()); } return(Ok(tUserEncounterReason)); }
public async Task <IHttpActionResult> PosttUserEncounterReason(tUserEncounterReason tUserEncounterReason) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tUserEncounterReasons.Add(tUserEncounterReason); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = tUserEncounterReason.ID }, tUserEncounterReason)); }
public async Task <IHttpActionResult> DeletetUserEncounterReason(int id) { tUserEncounterReason tUserEncounterReason = await db.tUserEncounterReasons.FindAsync(id); if (tUserEncounterReason == null) { return(NotFound()); } db.tUserEncounterReasons.Remove(tUserEncounterReason); await db.SaveChangesAsync(); return(Ok(tUserEncounterReason)); }