public SearchExaminations()
        {
            InitializeComponent();

            searchPatients.Text     = "";
            cmbSearchDoctors.Text   = "";
            datePicker.SelectedDate = null;
            tpTime.SelectedTime     = null;
            cmbTypeExm.SelectedItem = null;
            cmbRoom.SelectedItem    = null;

            datePicker.DisplayDateStart = DateTime.Today;
            datePicker.DisplayDateEnd   = (new DateTime(2020, 12, 31));

            examinations = examinationController.ViewScheduledExaminations();

            List <Room> allRooms = roomController.ViewRooms();

            foreach (Room r in allRooms)
            {
                if (r.Usage != TypeOfUsage.Soba_za_lezanje)
                {
                    rooms.Add(r);
                }
            }

            cmbRoom.DataContext = rooms;

            string type = "Operacija";

            foreach (Examination e in examinations)
            {
                if (e.Type == TypeOfExamination.Opsti)
                {
                    type = "Opšti pregled";
                }
                else if (e.Type == TypeOfExamination.Specijalisticki)
                {
                    type = "Specijalistički pregled";
                }
                scheduledExaminations.Add(new ExaminationDTO(e.IdExamination, e.doctor.Name + " " + e.doctor.Surname + " " + e.doctor.Jmbg,
                                                             e.patientCard.patient.Name + " " + e.patientCard.patient.Surname + " " + e.patientCard.patient.Jmbg, e.room.Number.ToString(),

                                                             type, e.DateAndTime.ToShortDateString(), e.DateAndTime.ToShortTimeString()));
            }

            dgSearchExaminations.ItemsSource = scheduledExaminations;
        }
        public Home()
        {
            InitializeComponent();

            regPatients.Text = userController.ViewAllUsers().Count.ToString();
            allExm.Text      = examinationController.ViewScheduledExaminations().Count.ToString();
            cancExm.Text     = examinationController.ViewCanceledExaminations().Count.ToString();
            todayExm.Text    = examinationController.ViewScheduledExaminationsByDate(DateTime.Today).Count.ToString();

            DispatcherTimer timer = new DispatcherTimer(new TimeSpan(0, 0, 1),
                                                        DispatcherPriority.Normal, delegate
            {
                this.txtTime.Text = DateTime.Now.ToString("HH:mm:ss");
            }, this.Dispatcher);

            txtDate.Text = DateTime.Now.ToShortDateString();

            ChartViewModel mw = new ChartViewModel()
            {
                Title = "Nedeljni broj zakazanih pregleda", Points = new List <DataPoint> {
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-7)), 15),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-6)), 36),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-5)), 18),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-4)), 26),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-3)), 27),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-2)), 45),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-1)), 37),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now), 40),
                }
            };
            ChartViewModel mw1 = new ChartViewModel()
            {
                Title  = "Nedeljni broj registrovanih pacijenata",
                Points = new List <DataPoint> {
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-7)), 12),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-6)), 9),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-5)), 17),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-4)), 5),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-3)), 10),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-2)), 4),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now.AddDays(-1)), 6),
                    new DataPoint(DateTimeAxis.ToDouble(DateTime.Now), 8),
                }
            };

            chart.DataContext  = mw;
            chart1.DataContext = mw1;
        }