public ActionResult OnGet(int?appointmentId)
 {
     Doctors   = new SelectList(appointmentData.GetDoctors().Select(d => d.DoctorName));
     Locations = new SelectList(appointmentData.GetLocations().Select(l => l.LocationName));
     if (appointmentId.HasValue)
     {
         Appointment = appointmentData.GetById(appointmentId.Value);
     }
     if (Appointment == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Exemple #2
0
 public ActionResult OnGet(int?appointmentId)
 {
     if (!this.User.HasClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/role", "Administator"))
     {
         TempData["Message"] = "You don't have required claims to view this page!";
         return(RedirectToPage("./List"));
     }
     Doctors   = new SelectList(appointmentData.GetDoctors().Select(d => d.DoctorName));
     Locations = new SelectList(appointmentData.GetLocations().Select(l => l.LocationName));
     if (appointmentId.HasValue)
     {
         Appointment = appointmentData.GetById(appointmentId.Value);
     }
     else
     {
         Appointment = new Appointment();
         Appointment.AppointmentDate = DateTime.Now;
         //default values
     }
     if (Appointment == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Exemple #3
0
 public IActionResult OnGet(int appointmentId)
 {
     Appointment = appointmentData.GetById(appointmentId);
     if (Appointment == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }