private void next_Click(object sender, RoutedEventArgs e)
        {
            int i = 0;
            MessageBoxResult succesMessage = MessageBox.Show("Molim Vas potvrdite zakazivanje pregleda!", "Potvrdite zakazivanje!", MessageBoxButton.YesNo);

            switch (succesMessage)
            {
            case MessageBoxResult.Yes:
            {
                i = 1;
                break;
            }

            case MessageBoxResult.No: {
                i = 0;
                break;
            }
            }

            if (i == 1)
            {
                ScheduledExam scheduledExam = new ScheduledExam(dateTime, "1214124", doctor, userChosenTime, "222");
                MainWindow.exams.Add(scheduledExam);
                MessageBoxResult successMsg = MessageBox.Show("Uspesno ste zakazali pregled!", "Uspesno zakazivanje!", MessageBoxButton.OK);

                switch (successMsg)
                {
                case MessageBoxResult.OK:
                {
                    NavigationService.Navigate(new Uri("/PatientPages/PatientMainPage.xaml", UriKind.Relative));
                    break;
                }
                }
            }
        }
Ejemplo n.º 2
0
        private void suggestExam_Click(object sender, RoutedEventArgs e)
        {
            //TODO za pocetak samo da kaze da nema termina

            if (startDate.SelectedDate != null && endDate.SelectedDate != null && doctorCB.SelectedItem != null)
            {
                //ovde se prikazuje kako izgleda kada nema nicega
                if (startDate.SelectedDate.Value > endDate.SelectedDate.Value)
                {
                    errorDateWrong.Text = "Datum pocekta ne moze biti posle datuma kraja! Izmenite datume i pokusajte opet!";
                }
                else
                {
                    int a = 0;

                    if (a == 0)
                    {
                        string[] parts  = startDate.SelectedDate.Value.ToString().Split(' ');
                        string[] parts1 = endDate.SelectedDate.Value.ToString().Split(' ');
                        string   doctor = doctorCB.SelectedValue.ToString();

                        string poruka = "Za lekara: " + doctor + " nema slobodnih termina u periodu od " + parts[0] + " do " + parts1[0];
                        unsuccessfullNum1.Text = poruka;


                        unsuccssfullPopup1.IsOpen = true;
                    }
                    else
                    {
                        exam = new ScheduledExam(DateTime.Today.Date, "id5", doctorCB.SelectedItem.ToString(), "17:30", "200");
                        exams.Add(exam);

                        itemControl.DataContext = null;
                        itemControl.DataContext = exams;


                        Binding b = new Binding("exams")
                        {
                            Source = this
                        };
                        itemControl.SetBinding(ItemsControl.ItemsSourceProperty, b);
                        itemControl.Items.Refresh();


                        successPopup.IsOpen = true;
                    }


                    errorDateWrong.Text = "";
                }
            }
            else
            {
                if (startDate.SelectedDate == null)
                {
                    //TREBA DA SE POSTAVI ZA GRESKU NES
                    errorNoInputStart.Text = "Odaberite datum za pocetak perioda!";
                }
                else
                {
                    errorNoInputStart.Text = "";
                }

                if (endDate.SelectedDate == null)
                {
                    //TREBA DA SE POSTAVI ZA GRESKU NES
                    errorNoInputEnd.Text = "Odaberite datum za kraj perioda!";
                }
                else
                {
                    errorNoInputEnd.Text = "";
                }

                if (doctorCB.SelectedItem == null)
                {
                    //TREBA GRESKU ISPOISATI
                    errorNoInputDoctor.Text = "Odaberite lekara!";
                }
                else
                {
                    errorNoInputDoctor.Text = "";
                }

                errorDateWrong.Text = "";
            }
        }
Ejemplo n.º 3
0
        /*
         * private void closePopup_Click(object sender, RoutedEventArgs e)
         * {
         *  if (sender.ToString().Equals("unsuccssfullPopup1"))
         *  {
         *      unsuccssfullPopup1.IsOpen = false;
         *
         *  }
         *  else if(sender.ToString().Equals("unsuccssfullPopup2"))
         *  {
         *      unsuccssfullPopup2.IsOpen = false;
         *
         *  }else if (sender.ToString().Equals("successPopup"))
         *  {
         *      successPopup.IsOpen = false;
         *  }
         * }
         */
        private void suggestExamPriority_Click(object sender, RoutedEventArgs e)
        {
            if (radioDoctor.IsChecked == true || radioTimePeriod.IsChecked == true)
            {
                errorNoRadioButton.Text   = "";
                unsuccssfullPopup1.IsOpen = false;

                if (radioDoctor.IsChecked == true)
                {
                    //ovde cemo prikazati sta se desava kad se pokrene i recimo pronadje

                    int a = 1;

                    if (a == 0)
                    {
                        string doctor = doctorCB.SelectedValue.ToString();

                        string poruka = "Nazalost kod lekara: " + doctor + " nema slobodnih termina u narednom periodu! Mozete pokusati da zakazete pregled kod drugog lekara.";
                        unsuccessfullNum2.Text = poruka;



                        unsuccssfullPopup2.IsOpen = true;
                    }
                    else
                    {
                        exams.Clear();

                        exam = new ScheduledExam(DateTime.Today.Date, "id5", doctorCB.SelectedItem.ToString(), "17:30", "200");
                        exams.Add(exam);

                        itemControl.DataContext = null;
                        itemControl.DataContext = exams;


                        Binding b = new Binding("exams")
                        {
                            Source = this
                        };
                        itemControl.SetBinding(ItemsControl.ItemsSourceProperty, b);
                        itemControl.Items.Refresh();


                        successPopup.IsOpen = true;
                    }
                }

                if (radioTimePeriod.IsChecked == true)
                {
                    //ovde cemo prikazati sta se desava kad se pokrene i recimo pronadje

                    int a = 1;

                    if (a == 0)
                    {
                        string[] parts  = startDate.SelectedDate.Value.ToString().Split(' ');
                        string[] parts1 = endDate.SelectedDate.Value.ToString().Split(' ');
                        string   poruka = "Nazalost u periodu izmedju: " + parts[0] + " i " + parts1[0] + " nema slobodnih termina! Mozete pokusati da zakazete pregled u drugom periodu.";
                        unsuccessfullNum3.Text = poruka;



                        unsuccssfullPopup3.IsOpen = true;
                    }
                    else
                    {
                        exams.Clear();

                        exam = new ScheduledExam(DateTime.Today.Date, "id5", "dr Miodrag Djukic", "17:30", "200");
                        exams.Add(exam);

                        itemControl.DataContext = null;
                        itemControl.DataContext = exams;


                        Binding b = new Binding("exams")
                        {
                            Source = this
                        };

                        itemControl.SetBinding(ItemsControl.ItemsSourceProperty, b);
                        itemControl.Items.Refresh();


                        successPopup.IsOpen = true;
                    }
                }
            }
            else
            {
                errorNoRadioButton.Text = "Niste selektovali prioritet!";
            }
        }
Ejemplo n.º 4
0
        public PatientScheduledExamsPage()
        {
            InitializeComponent();


            this.DataContext = this;

            examsForToday    = new ObservableCollection <ScheduledExam>();
            examsForTomorrow = new ObservableCollection <ScheduledExam>();
            examsForTmrw2    = new ObservableCollection <ScheduledExam>();
            examsForTmrw3    = new ObservableCollection <ScheduledExam>();
            doctors          = new ObservableCollection <string>();
            doctors.Add("dr Goran Stevanovic");
            doctors.Add("dr Jovan Prodanov");
            doctors.Add("dr Jelena Klasnjar");
            doctors.Add("dr Miodrag Đukic");
            doctors.Add("dr Petar Petrovic");
            doctors.Add("dr Legenda Nestorovic");

            vremena = new ObservableCollection <string>();

            DateTime startShift = new DateTime(2020, 5, 11, 7, 00, 0);
            DateTime endShift   = new DateTime(2020, 5, 11, 18, 00, 0);

            IEnumerable <DateTime> listOfHours = Enumerable.Range(0, 24).Select(h => startShift.AddHours(h));

            foreach (DateTime hour in listOfHours)
            {
                if (hour.Hour >= 7 && hour.Hour <= 18)
                {
                    vremena.Add(hour.TimeOfDay.ToString().Substring(0, hour.TimeOfDay.ToString().Length - 3));
                    vremena.Add(hour.AddMinutes(30).TimeOfDay.ToString().Substring(0, hour.TimeOfDay.ToString().Length - 3));
                }
            }

            scheduledExamsNames           = new Dictionary <DateTime, string>();
            calendarStackPanel.Visibility = Visibility.Hidden;
            dns = DateTime.Today;

            tmrw          = dns.AddDays(1);
            dayaftertmrw  = dns.AddDays(2);
            dayaftertmrw2 = dns.AddDays(3);
            Notifications notifi = new Notifications();

            notifications = notifi.notifications;

            ScheduledExam exam1 = new ScheduledExam(dns, "id1", "dr Jovan Prodanov", "12:30", "217");
            ScheduledExam exam2 = new ScheduledExam(dns, "id2", "dr Legenda Nestorovic", "13:30", "237");

            ScheduledExam exam3 = new ScheduledExam(tmrw, "id3", "dr Jelena Klasnjar", "11:30", "211");
            ScheduledExam exam4 = new ScheduledExam(tmrw, "id4", "dr Goran Stevanovic", "13:30", "420");

            ScheduledExam exam5 = new ScheduledExam(dayaftertmrw, "id5", "dr Legenda Nestorovic", "17:30", "200");
            ScheduledExam exam6 = new ScheduledExam(dayaftertmrw, "id6", "dr Legenda Nestorovic", "9:30", "12");

            ScheduledExam exam7 = new ScheduledExam(dayaftertmrw2, "id7", "dr Legenda Nestorovic", "16:30", "666");

            exams = MainWindow.exams;

            selectedExam = null;

            examsForToday.Add(exam1);
            examsForToday.Add(exam2);

            examsForTomorrow.Add(exam3);
            examsForTomorrow.Add(exam4);

            examsForTmrw3.Add(exam5);
            examsForTmrw3.Add(exam6);

            examsForTmrw2.Add(exam7);


            scheduledExamsNames[dns.Date]           = nameof(examsForToday);
            scheduledExamsNames[tmrw.Date]          = nameof(examsForTomorrow);
            scheduledExamsNames[dayaftertmrw2.Date] = nameof(examsForTmrw3);
            scheduledExamsNames[dayaftertmrw.Date]  = nameof(examsForTmrw2);

            calendar.DisplayDateStart = DateTime.Today;
        }