public ActionResult DeleteConfirmed(int id) { HealthClinic healthClinic = db.HealthClinics.Find(id); db.HealthClinics.Remove(healthClinic); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult RemoveAsset(int id) { HealthClinic healthClinic = db.HealthClinics.Find(id); db.HealthClinics.Remove(healthClinic); db.SaveChanges(); TempData["successMessage"] = $"Asset successfully deleted"; return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Physical_Address,ResAddress,Phone,Email,CampusId,ClinicTypeId")] HealthClinic healthClinic) { if (ModelState.IsValid) { db.Entry(healthClinic).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CampusId = new SelectList(db.Campus, "Id", "Name", healthClinic.CampusId); ViewBag.ClinicTypeId = new SelectList(db.ClinicTypes, "Id", "TypeName", healthClinic.ClinicTypeId); return(View(healthClinic)); }
public ActionResult Create([Bind(Include = "Id,Name,Physical_Address,ResAddress,Phone,Email,CampusId,ClinicTypeId")] HealthClinic healthClinic) { if (ModelState.IsValid) { db.HealthClinics.Add(healthClinic); db.SaveChanges(); TempData["successMessage"] = $"Item successfully added"; return(RedirectToAction("Index")); } ViewBag.CampusId = new SelectList(db.Campus, "Id", "Name", healthClinic.CampusId); ViewBag.ClinicTypeId = new SelectList(db.ClinicTypes, "Id", "TypeName", healthClinic.ClinicTypeId); return(View(healthClinic)); }
// GET: Clinic/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HealthClinic healthClinic = db.HealthClinics.Find(id); if (healthClinic == null) { return(HttpNotFound()); } return(View(healthClinic)); }
// GET: Clinic/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HealthClinic healthClinic = db.HealthClinics.Find(id); if (healthClinic == null) { return(HttpNotFound()); } ViewBag.CampusId = new SelectList(db.Campus, "Id", "Name", healthClinic.CampusId); ViewBag.ClinicTypeId = new SelectList(db.ClinicTypes, "Id", "TypeName", healthClinic.ClinicTypeId); return(View(healthClinic)); }