Beispiel #1
0
        public ActionResult Review(AppointmentReview model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            AppointmentRepository appRepo = new AppointmentRepository();
            Appointment           app     = appRepo.GetByID(model.ID);

            if (Request.Form["Approve"] != null)
            {
                model = Approve(model);
            }
            else if (Request.Form["Decline"] != null)
            {
                model = Decline(model);
            }

            app.Status = model.Status;

            appRepo.Save(app);

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Review(int?id)
        {
            AppointmentRepository appRepo = new AppointmentRepository();
            Appointment           app     = appRepo.GetByID(id.Value);

            AppointmentReview model = new AppointmentReview()
            {
                ID        = app.ID,
                PatientID = app.PatientID,
                DoctorID  = app.DoctorID,
                Patient   = app.Patient,
                Date      = app.Date,
                Status    = app.Status
            };

            return(View(model));
        }
Beispiel #3
0
 // Approve
 private AppointmentReview Approve(AppointmentReview model)
 {
     model.Status = StatusEnum.Approved;
     return(model);
 }
Beispiel #4
0
 // Decline
 private AppointmentReview Decline(AppointmentReview model)
 {
     model.Status = StatusEnum.Unapproved;
     return(model);
 }