Example #1
0
 public void OnGet()
 {
     Message = config["Message"];
     if (this.User.HasClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/role", "Administator"))
     {
         Appointments = appointmentData.GetAppointmentByName(SearchTerm);
     }
     else
     {
         Appointments = appointmentData.GetOnlyOpenAppointments(this.User.Identity.Name);
     }
 }
        public List <AppointmentReport> Get()
        {
            var allAppointments = appointmentData.GetAppointmentByName(string.Empty);

            var onlyMarkedAppointments = allAppointments.
                                         Where(a => a.IsAvaiable == false && !string.IsNullOrEmpty(a.UserName)).ToList();

            var ReportData = new List <AppointmentReport>();

            foreach (var appointment in onlyMarkedAppointments)
            {
                ReportData.Add(new AppointmentReport
                {
                    AppointmentName = appointment.AppointmentName,
                    AppointmentDate = appointment.AppointmentDate,
                    AppointedPerson = appointment.UserName
                });
            }

            return(ReportData);
        }