Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MedicalAppointments medicalAppointments = db.MedicalAppointments.Find(id);

            db.MedicalAppointments.Remove(medicalAppointments);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
        // 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));
        }
Example #3
0
        // 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));
        }
Example #4
0
 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));
 }
Example #5
0
        // 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));
        }