private void ButtonNo_Click(object sender, RoutedEventArgs e)
        {
            PageNotification pageNotification = new PageNotification(
                PageNotification.NotificationType.AlreadyChecked, returnBack: patients.Count > 1);

            if (patients.Count > 1)
            {
                GridVisitedAppointmentsQuestion.Visibility = Visibility.Hidden;
                GridMultiplePatients.Visibility            = Visibility.Visible;
            }

            NavigationService.Navigate(pageNotification);
        }
コード例 #2
0
        private void ButtonContinue_Click(object sender, RoutedEventArgs e)
        {
            if (EnteredNumber.Length < 10)
            {
                return;
            }

            Logging.ToLog("PageEnterNumber - введен номер: " + EnteredNumber);

            try {
                DataHandle.Instance.LoadPatients(EnteredNumber.Substring(0, 3), EnteredNumber.Substring(3, 7));
            } catch (Exception exc) {
                NavigationService.Navigate(new PageNotification(PageNotification.NotificationType.DbError, exception: exc));
                return;
            }

            Page page;

            if (DataHandle.PatientsCurrent.Count == 0)
            {
                string entered = "+7 (" + EnteredNumber.Substring(0, 3) +
                                 ") " + EnteredNumber.Substring(3, 3) + "-" +
                                 EnteredNumber.Substring(6, 2) + "-" +
                                 EnteredNumber.Substring(8, 2);

                page = new PageNotification(PageNotification.NotificationType.NumberNotFound, entered);
            }
            else if (DataHandle.PatientsCurrent.Count > 4)
            {
                page = new PageNotification(PageNotification.NotificationType.VisitRegistryToCheckIn);
            }
            else
            {
                page = new PagePatientConfirmation(DataHandle.PatientsCurrent);
            }

            NavigationService.Navigate(page);
        }
        private void CheckPatientStateAndShowAppointments(ItemPatient patient)
        {
            PageNotification.NotificationType?notificationType = null;
            selectedPatient = patient;

            if (patient.StopCodesCurrent.Contains(ItemPatient.StopCode.FirstTime))
            {
                notificationType = PageNotification.NotificationType.FirstVisit;
            }
            //else if (patient.StopCodesCurrent.Contains(ItemPatient.StopCodes.NotAvailableNow))
            //	notificationType = PageNotification.NotificationType.NoAppointmentsForNow;
            else if (patient.StopCodesCurrent.Contains(ItemPatient.StopCode.Cash))
            {
                notificationType = PageNotification.NotificationType.Cash;
            }
            else if (patient.StopCodesCurrent.Count > 0)
            {
                notificationType = PageNotification.NotificationType.VisitRegistryToCheckIn;
            }

            if (notificationType.HasValue)
            {
                NavigationService.Navigate(new PageNotification(notificationType.Value, returnBack: returnBack));
                SetImage(patient, false);
                return;
            }

            bool isOk = true;

            if (patient.AppointmentsNotAvailable.Count >= 0 &&
                patient.AppointmentsAvailable.Count == 0 &&
                patient.AppointmentsVisited.Count == 0)
            {
                PageNotification pageAppointmentsNotFound =
                    new PageNotification(PageNotification.NotificationType.NoAppointmentsForNow, returnBack: returnBack);
                NavigationService.Navigate(pageAppointmentsNotFound);
                isOk = false;
            }
            else if (
                patient.AppointmentsVisited.Count >= 0 &&
                patient.AppointmentsAvailable.Count == 0)
            {
                //do you want to see already checked appointments?
                BindingValues.Instance.SetUpMainWindow(patient.Name + ",", false, false);
                GridVisitedAppointmentsQuestion.Visibility = Visibility.Visible;

                if (patients.Count == 1)
                {
                    GridSinglePatient.Visibility = Visibility.Hidden;
                }
                else
                {
                    GridMultiplePatients.Visibility = Visibility.Hidden;
                }
            }
            else
            {
                PageShowAppointments pageAppointmentsShow = new PageShowAppointments(patient, returnBack);
                NavigationService.Navigate(pageAppointmentsShow);
            }

            SetImage(patient, isOk);
        }
        private void ButtonWrong_Click(object sender, RoutedEventArgs e)
        {
            PageNotification pageNotification = new PageNotification(PageNotification.NotificationType.NameNotCorrect);

            NavigationService.Navigate(pageNotification);
        }