public ActionResult DeleteConfirmed(int id) { Confirm_Appointment confirm_Appointment = db.ConfirmAppointments.Find(id); db.ConfirmAppointments.Remove(confirm_Appointment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AppId,name,surname,phone,Address,Date,time,AgentId")] Confirm_Appointment confirm_Appointment) { if (ModelState.IsValid) { db.Entry(confirm_Appointment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AgentId = new SelectList(db.agents, "AgentId", "AgentName", confirm_Appointment.AgentId); return(View(confirm_Appointment)); }
// GET: Confirm_Appointment/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Confirm_Appointment confirm_Appointment = db.ConfirmAppointments.Find(id); if (confirm_Appointment == null) { return(HttpNotFound()); } return(View(confirm_Appointment)); }
// GET: Confirm_Appointment/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Confirm_Appointment confirm_Appointment = db.ConfirmAppointments.Find(id); if (confirm_Appointment == null) { return(HttpNotFound()); } ViewBag.AgentId = new SelectList(db.agents, "AgentId", "AgentName", confirm_Appointment.AgentId); return(View(confirm_Appointment)); }
public ActionResult Confirm(int?id) { Appointment appointment = db.appointments.Find(id); Confirm_Appointment confirm = new Confirm_Appointment(); confirm.AppId = appointment.AppId; confirm.name = appointment.name; confirm.surname = appointment.surname; confirm.phone = appointment.phone; confirm.Address = appointment.Address; confirm.Date = appointment.Date; confirm.time = appointment.time; confirm.AgentId = appointment.AgentId; appointment.status = "Appointment Approved"; db.ConfirmAppointments.Add(confirm); db.appointments.Remove(appointment); db.SaveChanges(); return(RedirectToAction("Index", "Confirm_Appointment")); }