public ActionResult DeleteConfirmed(int id) { AppointmentVenue appointmentvenue = db.AppointmentVenues.Find(id); db.AppointmentVenues.Remove(appointmentvenue); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(AppointmentVenue appointmentvenue) { if (ModelState.IsValid) { db.Entry(appointmentvenue).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(appointmentvenue)); }
// // GET: /AppointmentVenue/Edit/5 public ActionResult Edit(int id = 0) { AppointmentVenue appointmentvenue = db.AppointmentVenues.Find(id); if (appointmentvenue == null) { Session["FlashMessage"] = "Appointment Venue not found."; return(RedirectToAction("Index")); } return(View(appointmentvenue)); }
public ActionResult Create(AppointmentVenue appointmentvenue) { if (ModelState.IsValid) { db.AppointmentVenues.Add(appointmentvenue); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(appointmentvenue)); }
// // GET: /AppointmentVenue/Delete/5 public ActionResult Delete(int id = 0) { AppointmentVenue appointmentvenue = db.AppointmentVenues.Find(id); if (appointmentvenue == null) { Session["FlashMessage"] = "Appointment Venue not found."; return(RedirectToAction("Index")); } if (appointmentvenue.Appointments != null) { Session["FlashMessage"] = "Appointment Venue is attached to existing Appointment(s)."; return(RedirectToAction("Index")); } return(View(appointmentvenue)); }