public ActionResult DeleteConfirmed(int id) { appointmentDetail appointmentDetail = db.appointmentDetails.Find(id); db.appointmentDetails.Remove(appointmentDetail); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "appointmentDetailId,dateTime,petId,vetId")] appointmentDetail appointmentDetail) { if (ModelState.IsValid) { db.Entry(appointmentDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.petId = new SelectList(db.Pets, "petId", "name", appointmentDetail.petId); ViewBag.vetId = new SelectList(db.Vets, "vetId", "firstName", appointmentDetail.vetId); return(View(appointmentDetail)); }
// GET: appointmentDetails/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } appointmentDetail appointmentDetail = db.appointmentDetails.Find(id); if (appointmentDetail == null) { return(HttpNotFound()); } return(View(appointmentDetail)); }
// GET: appointmentDetails/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } appointmentDetail appointmentDetail = db.appointmentDetails.Find(id); if (appointmentDetail == null) { return(HttpNotFound()); } ViewBag.petId = new SelectList(db.Pets, "petId", "name", appointmentDetail.petId); ViewBag.vetId = new SelectList(db.Vets, "vetId", "firstName", appointmentDetail.vetId); return(View(appointmentDetail)); }