예제 #1
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            var appointmentLogic = new AppointmentLogic();
            await appointmentLogic.Init();

            var patient = await PatientLogic.GetPatientAsync(General.UserId);

            if (appointmentLogic.AllAppointments.Any(a => a.PatientName == PatientLogic.GetFullName(patient.FirstName, patient.Surname) &&
                                                     !a.Complete && a.PatientID == patient.UserID))
            {
                current = appointmentLogic.GetCurrentAppointment(patient, appointmentLogic.AllAppointments);

                titleLabel.IsVisible   = false;
                loadingLabel.IsVisible = false;
                detailsFrame.IsVisible = true;
                dateSpan.Text          = current.AppointmentTime.ToLongDateString() + ", ";
                timeSpan.Text          = current.AppointmentTime.ToShortTimeString();
                symptomsSpan.Text      = current.symtoms;

                if (current.Confirmed)
                {
                    statusSpan.TextColor = Color.Green;
                    statusSpan.Text      = "confirmed";
                }
                else
                {
                    statusSpan.TextColor = Color.Red;
                    statusSpan.Text      = "Pending";
                }
            }
            else
            {
                titleLabel.IsVisible = true;
                titleLabel.Text      = "You don't have an appointment booked.";
                titleLabel.HorizontalTextAlignment = TextAlignment.Center;
                loadingLabel.IsVisible             = false;
                detailsFrame.IsVisible             = false;
            }
        }
예제 #2
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            try
            {
                var appointmentLogic = new AppointmentLogic();
                await appointmentLogic.Init();

                allAppointments       = appointmentLogic.AllAppointments;
                availableAppointments = appointmentLogic.AvailableAppointments;
            }
            catch (Exception e)
            {
                throw e;
            }

            General.AllAppointments       = allAppointments;
            General.AvailableAppointments = availableAppointments;

            appointmentsListView.ItemsSource = availableAppointments;
            appointmentsListView.Refreshing += AppointmentsListView_Refreshing;
            //appointmentsListView.ItemSelected += AppointmentsListView_ItemSelected;
        }