コード例 #1
0
        public CanceledExaminationsView()
        {
            InitializeComponent();

            txtSearchExaminations.Focus();

            examinations = examinationController.ViewCanceledExaminations();
            string type;

            foreach (Examination e in examinations)
            {
                if (e.Type == TypeOfExamination.Opsti)
                {
                    type = "Opšti pregled";
                }
                else if (e.Type == TypeOfExamination.Specijalisticki)
                {
                    type = "Specijalistički pregled";
                }
                else
                {
                    type = "Operacija";
                }
                canceledExaminations.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()));
            }

            dgCanceledExaminations.ItemsSource = canceledExaminations;
        }
コード例 #2
0
        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;
        }