public IHttpActionResult PutMedicalOnly(int id, MedicalOnly medicalOnly) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != medicalOnly.MedicalOnlyId) { return(BadRequest()); } db.Entry(medicalOnly).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MedicalOnlyExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutMedicalOnly(int id, MedicalOnly medicalOnly) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != medicalOnly.MedicalOnlyId) { return BadRequest(); } db.Entry(medicalOnly).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MedicalOnlyExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public ActionResult DeleteConfirmed(int id) { MedicalOnly medicalOnly = db.MedicalOnly.Find(id); db.MedicalOnly.Remove(medicalOnly); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,value")] MedicalOnly medicalOnly) { if (ModelState.IsValid) { db.Entry(medicalOnly).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(medicalOnly)); }
public ActionResult Create([Bind(Include = "id,value")] MedicalOnly medicalOnly) { if (ModelState.IsValid) { db.MedicalOnly.Add(medicalOnly); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(medicalOnly)); }
public IHttpActionResult GetMedicalOnly(int id) { MedicalOnly medicalOnly = db.MedicalOnlies.Find(id); if (medicalOnly == null) { return(NotFound()); } return(Ok(medicalOnly)); }
public IHttpActionResult PostMedicalOnly(MedicalOnly medicalOnly) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MedicalOnlies.Add(medicalOnly); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = medicalOnly.MedicalOnlyId }, medicalOnly)); }
public IHttpActionResult PostMedicalOnly(MedicalOnly medicalOnly) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.MedicalOnlies.Add(medicalOnly); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = medicalOnly.MedicalOnlyId }, medicalOnly); }
// GET: MedicalOnlies/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MedicalOnly medicalOnly = db.MedicalOnly.Find(id); if (medicalOnly == null) { return(HttpNotFound()); } return(View(medicalOnly)); }
public IHttpActionResult DeleteMedicalOnly(int id) { MedicalOnly medicalOnly = db.MedicalOnlies.Find(id); if (medicalOnly == null) { return(NotFound()); } db.MedicalOnlies.Remove(medicalOnly); db.SaveChanges(); return(Ok(medicalOnly)); }