Ejemplo n.º 1
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;
        }