public ActionResult DeleteConfirmed(int id) { DoctorTb doctorTb = db.DoctorTbs.Find(id); db.DoctorTbs.Remove(doctorTb); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,DoctorName,Description")] DoctorTb doctorTb) { if (ModelState.IsValid) { db.Entry(doctorTb).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(doctorTb)); }
public ActionResult Create([Bind(Include = "id,DoctorName,Description")] DoctorTb doctorTb) { if (ModelState.IsValid) { db.DoctorTbs.Add(doctorTb); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(doctorTb)); }
// GET: DoctorTbs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DoctorTb doctorTb = db.DoctorTbs.Find(id); if (doctorTb == null) { return(HttpNotFound()); } return(View(doctorTb)); }