示例#1
0
        public CalendarDay(DateTime day, int targetMonth)
        {
            InitializeComponent();
            this.date        = day;
            this.targetMonth = targetMonth;

            // Set the day of the month (number)
            number.Content = day.Day.ToString();

            // Make the day appear less focused (darker) when it is the previous / next month
            if (day.Month != targetMonth)
            {
                filter.Opacity = FILTER_DARKEN;
            }

            maxAppointments = SchedulingSupport.MaxAppointmentsForDay(day);

            AddAppointmentsFromList(SchedulingSupport.GetAppointmentsForDay(date));
        }
示例#2
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn public CheckedInList(DateTime date)
        ///
        /// \brief  Loads all appointments and their check-in status on construction of the window
        ///
        /// \author Bailey
        /// \date   2019-04-16
        ///-------------------------------------------------------------------------------------------------
        public CheckedInList(DateTime date)
        {
            InitializeComponent();

            // Update the database to reflect any mobile changes
            Database.UpdateMobileFlagsForDate(date);

            // Load interface with appointments for day
            appointments = SchedulingSupport.GetAppointmentsForDay(date);
            foreach (Appointment appointment in appointments)
            {
                string content = "---";
                var    people  = Database.GetPatientsByAppointmentID(appointment.AppointmentID);

                if (people.Count > 0)
                {
                    content = people[0].FirstName + " " + people[0].LastName;
                    if (people.Count == 2)
                    {
                        content += ", " + people[1].FirstName + " " + people[1].LastName;
                    }
                }

                bool cleared = false;
                if (!cleared)
                {
                    Label l = new Label();
                    l.Width   = 240;
                    l.Content = content;

                    if (appointment.MobileFlag == APPT_CHECKED_IN)
                    {
                        l.Background = COLOUR_CHECKED_IN;
                    }
                    else if (appointment.MobileFlag == APPT_CLEARED)
                    {
                        l.Background = COLOUR_CLEARED;
                    }

                    lstAppointments.Items.Add(l);
                }
            }
        }