Exemplo n.º 1
0
        private void Window1_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            Random rand = new Random(System.DateTime.Now.Second);

            for (int i = 1; i <= 20; i++)
            {
                Appointment apt = new Appointment();
                apt.AppointmentID = i;
                apt.StartTime = new System.DateTime(System.DateTime.Now.Year, 5, i);
                apt.EndTime = apt.StartTime;
                apt.Subject = "Random apt, blah blah";
                _myAppointmentsList.Add(apt);
            }

            SetAppointments();
        }
Exemplo n.º 2
0
        private void loadCalendar()
        {
            loadReservations();
            _myAppointmentsList.Clear();

            for (int i = 0; i < Global.reservations.Count; i++)
            {
                Appointment apt = new Appointment();
                apt.AppointmentID = Global.reservations[i].Id;
                apt.StartTime = Global.reservations[i].StartDate;
                apt.EndTime = Global.reservations[i].EndDate;

                apt.Subject = Global.companies.Find(c => c.Id == Global.reservations[i].CompanyId).Name;
                _myAppointmentsList.Add(apt);
            }

            SetAppointments();
        }