public ActionResult DeleteConfirmed(int id) { MedicalAppointments medicalAppointments = db.MedicalAppointments.Find(id); db.MedicalAppointments.Remove(medicalAppointments); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: MedicalAppointments/Details/5 public ActionResult Details(int?id) { if (id == null) { return(View()); } MedicalAppointments medicalAppointments = db.MedicalAppointments.Find(id); if (medicalAppointments == null) { return(HttpNotFound()); } return(View(medicalAppointments)); }
// GET: MedicalAppointments/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MedicalAppointments medicalAppointments = db.MedicalAppointments.Find(id); if (medicalAppointments == null) { return(HttpNotFound()); } return(View(medicalAppointments)); }
public ActionResult Edit([Bind(Include = "IdMedicalAppointments,Date,IdDoctor,IdConsultory,IdPatient,IdTreatment,IdProcess")] MedicalAppointments medicalAppointments) { if (ModelState.IsValid) { db.Entry(medicalAppointments).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdConsultory = new SelectList(db.Consultories, "IdConsultory", "ConsultoryName", medicalAppointments.IdConsultory); ViewBag.IdDoctor = new SelectList(db.Doctors, "IdDoctor", "NameDoctor", medicalAppointments.IdDoctor); ViewBag.IdPatient = new SelectList(db.Patients, "IdPatient", "CURP", medicalAppointments.IdPatient); ViewBag.IdProcess = new SelectList(db.Processes, "IdProcess", "ProcessName", medicalAppointments.IdProcess); ViewBag.IdTreatment = new SelectList(db.Treatments, "IdTreatment", "TreatmentName", medicalAppointments.IdTreatment); return(View(medicalAppointments)); }
// GET: MedicalAppointments/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MedicalAppointments medicalAppointments = db.MedicalAppointments.Find(id); if (medicalAppointments == null) { return(HttpNotFound()); } ViewBag.IdConsultory = new SelectList(db.Consultories, "IdConsultory", "ConsultoryName", medicalAppointments.IdConsultory); ViewBag.IdDoctor = new SelectList(db.Doctors, "IdDoctor", "NameDoctor", medicalAppointments.IdDoctor); ViewBag.IdPatient = new SelectList(db.Patients, "IdPatient", "CURP", medicalAppointments.IdPatient); ViewBag.IdProcess = new SelectList(db.Processes, "IdProcess", "ProcessName", medicalAppointments.IdProcess); ViewBag.IdTreatment = new SelectList(db.Treatments, "IdTreatment", "TreatmentName", medicalAppointments.IdTreatment); return(View(medicalAppointments)); }