Example #1
0
        static TeamData()
        {
            Random = new Random();
            Start  = GetStart();

            if (ViewModelBase.IsInDesignMode)
            {
                Employees                   = new List <Employee>();
                Calendars                   = CreateCalendars().ToList();
                VacationAppointments        = new TeamAppointment[] { };
                CompanyBirthdayAppointments = new TeamAppointment[] { };
                BirthdayAppointments        = new TeamAppointment[] { };
                ConferenceAppointments      = new TeamAppointment[] { };
                MeetingAppointments         = new TeamAppointment[] { };
                PhoneCallsAppointments      = new TeamAppointment[] { };
                CarWashAppointments         = new TeamAppointment[] { };
                PayBillsAppointments        = new TeamAppointment[] { };
                DentistAppointments         = new TeamAppointment[] { };
                RestaurantAppointments      = new TeamAppointment[] { };
                AllAppointments             = new TeamAppointment[] { };
                return;
            }

            //Employees = NWindContext.Create().Employees.ToList();
            Employees[0].BirthDate = Start.AddDays(4).AddYears(-30);

            Calendars                   = CreateCalendars().ToList();
            VacationAppointments        = CreateVacationsAppts(Start).ToList();
            CompanyBirthdayAppointments = CreateCompanyBirthdayAppts(Start).ToList();
            BirthdayAppointments        = CreateBirthdayAppts(Start).ToList();
            ConferenceAppointments      = CreateConferenceAppts(Start).ToList();
            MeetingAppointments         = CreateMeetingAppts(Start).ToList();
            PhoneCallsAppointments      = CreatePhoneCallsAppts(Start).ToList();
            CarWashAppointments         = CreateCarWashAppts(Start).ToList();
            TrainingAppointments        = CreateTrainingAppts(Start).ToList();
            PayBillsAppointments        = CreatePayBillsAppts(Start).ToList();
            DentistAppointments         = CreateDentistAppts(Start).ToList();
            RestaurantAppointments      = CreateRestaurantAppts(Start).ToList();
            AllAppointments             = VacationAppointments
                                          .Concat(BirthdayAppointments)
                                          .Concat(CompanyBirthdayAppointments)
                                          .Concat(ConferenceAppointments)
                                          .Concat(MeetingAppointments)
                                          .Concat(PhoneCallsAppointments)
                                          .Concat(CarWashAppointments)
                                          .Concat(TrainingAppointments)
                                          .Concat(PayBillsAppointments)
                                          .Concat(DentistAppointments)
                                          .Concat(RestaurantAppointments)
                                          .ToList();
            int id = 0;

            foreach (TeamAppointment appt in AllAppointments)
            {
                appt.Id = id++;
            }
        }
Example #2
0
        static TeamData()
        {
            Random = new Random();
            Start  = GetStart();

            if (ViewModelBase.IsInDesignMode)
            {
                Employees                   = new List <Employee>();
                Calendars                   = CreateCalendars().ToList();
                VacationAppointments        = new TeamAppointment[] { };
                CompanyBirthdayAppointments = new TeamAppointment[] { };
                BirthdayAppointments        = new TeamAppointment[] { };
                ConferenceAppointments      = new TeamAppointment[] { };
                MeetingAppointments         = new TeamAppointment[] { };
                PhoneCallsAppointments      = new TeamAppointment[] { };
                CarWashAppointments         = new TeamAppointment[] { };
                PayBillsAppointments        = new TeamAppointment[] { };
                DentistAppointments         = new TeamAppointment[] { };
                RestaurantAppointments      = new TeamAppointment[] { };
                AllAppointments             = new TeamAppointment[] { };
                return;
            }

            Employees = new List <Employee>();
            Employees.Add(new Employee()
            {
                FirstName = "Andrew", LastName = "Glover"
            });
            Employees.Add(new Employee()
            {
                FirstName = "Mark", LastName = "Oliver"
            });
            Employees.Add(new Employee()
            {
                FirstName = "John", LastName = "Heart"
            });
            Employees.Add(new Employee()
            {
                FirstName = "Olivia", LastName = "Peyton"
            });
            Employees.Add(new Employee()
            {
                FirstName = "Sandra", LastName = "Johnson"
            });
            Employees.Add(new Employee()
            {
                FirstName = "Amelia", LastName = "Harper"
            });
            Employees[0].BirthDate = Start.AddDays(4).AddYears(-30);
            Employees[1].BirthDate = Start.AddDays(1).AddYears(-27);
            Employees[2].BirthDate = Start.AddDays(14).AddYears(-32);
            Employees[3].BirthDate = Start.AddDays(-8).AddYears(-41);
            Employees[4].BirthDate = Start.AddDays(-18).AddYears(-41);
            Employees[5].BirthDate = Start.AddDays(48).AddYears(-25);

            Calendars                   = CreateCalendars().ToList();
            VacationAppointments        = CreateVacationsAppts(Start).ToList();
            CompanyBirthdayAppointments = CreateCompanyBirthdayAppts(Start).ToList();
            BirthdayAppointments        = CreateBirthdayAppts(Start).ToList();
            ConferenceAppointments      = CreateConferenceAppts(Start).ToList();
            MeetingAppointments         = CreateMeetingAppts(Start).ToList();
            PhoneCallsAppointments      = CreatePhoneCallsAppts(Start).ToList();
            CarWashAppointments         = CreateCarWashAppts(Start).ToList();
            TrainingAppointments        = CreateTrainingAppts(Start).ToList();
            PayBillsAppointments        = CreatePayBillsAppts(Start).ToList();
            DentistAppointments         = CreateDentistAppts(Start).ToList();
            RestaurantAppointments      = CreateRestaurantAppts(Start).ToList();
            AllAppointments             = VacationAppointments
                                          .Concat(BirthdayAppointments)
                                          .Concat(CompanyBirthdayAppointments)
                                          .Concat(ConferenceAppointments)
                                          .Concat(MeetingAppointments)
                                          .Concat(PhoneCallsAppointments)
                                          .Concat(CarWashAppointments)
                                          .Concat(TrainingAppointments)
                                          .Concat(PayBillsAppointments)
                                          .Concat(DentistAppointments)
                                          .Concat(RestaurantAppointments)
                                          .ToList();
            int id = 0;

            foreach (TeamAppointment appt in AllAppointments)
            {
                appt.Id = id++;
            }
        }
        static TeamData()
        {
            Random = new Random();
            Start  = GetStart();

            if (ViewModelBase.IsInDesignMode)
            {
                Employees                   = new List <Employee>();
                Calendars                   = CreateCalendars().ToList();
                VacationAppointments        = new TeamAppointment[] { };
                CompanyBirthdayAppointments = new TeamAppointment[] { };
                BirthdayAppointments        = new TeamAppointment[] { };
                ConferenceAppointments      = new TeamAppointment[] { };
                MeetingAppointments         = new TeamAppointment[] { };
                PhoneCallsAppointments      = new TeamAppointment[] { };
                CarWashAppointments         = new TeamAppointment[] { };
                PayBillsAppointments        = new TeamAppointment[] { };
                DentistAppointments         = new TeamAppointment[] { };
                RestaurantAppointments      = new TeamAppointment[] { };
                AllAppointments             = new TeamAppointment[] { };
                return;
            }

            Employees = new List <Employee>();
            Employees.Add(new Employee()
            {
                FirstName = "John1", LastName = "Smith1"
            });
            Employees.Add(new Employee()
            {
                FirstName = "John2", LastName = "Smith2"
            });
            Employees.Add(new Employee()
            {
                FirstName = "John3", LastName = "Smith3"
            });
            Employees.Add(new Employee()
            {
                FirstName = "John4", LastName = "Smith4"
            });
            Employees.Add(new Employee()
            {
                FirstName = "John5", LastName = "Smith5"
            });
            Employees.Add(new Employee()
            {
                FirstName = "John6", LastName = "Smith6"
            });
            Employees[0].BirthDate = Start.AddDays(4).AddYears(-30);
            Employees[1].BirthDate = Start.AddDays(1).AddYears(-27);
            Employees[2].BirthDate = Start.AddDays(14).AddYears(-32);
            Employees[3].BirthDate = Start.AddDays(-8).AddYears(-41);
            Employees[4].BirthDate = Start.AddDays(-18).AddYears(-41);
            Employees[5].BirthDate = Start.AddDays(48).AddYears(-25);

            Calendars                   = CreateCalendars().ToList();
            VacationAppointments        = CreateVacationsAppts(Start).ToList();
            CompanyBirthdayAppointments = CreateCompanyBirthdayAppts(Start).ToList();
            BirthdayAppointments        = CreateBirthdayAppts(Start).ToList();
            ConferenceAppointments      = CreateConferenceAppts(Start).ToList();
            MeetingAppointments         = CreateMeetingAppts(Start).ToList();
            PhoneCallsAppointments      = CreatePhoneCallsAppts(Start).ToList();
            CarWashAppointments         = CreateCarWashAppts(Start).ToList();
            TrainingAppointments        = CreateTrainingAppts(Start).ToList();
            PayBillsAppointments        = CreatePayBillsAppts(Start).ToList();
            DentistAppointments         = CreateDentistAppts(Start).ToList();
            RestaurantAppointments      = CreateRestaurantAppts(Start).ToList();
            AllAppointments             = VacationAppointments
                                          .Concat(BirthdayAppointments)
                                          .Concat(CompanyBirthdayAppointments)
                                          .Concat(ConferenceAppointments)
                                          .Concat(MeetingAppointments)
                                          .Concat(PhoneCallsAppointments)
                                          .Concat(CarWashAppointments)
                                          .Concat(TrainingAppointments)
                                          .Concat(PayBillsAppointments)
                                          .Concat(DentistAppointments)
                                          .Concat(RestaurantAppointments)
                                          .ToList();
            int id = 0;

            foreach (TeamAppointment appt in AllAppointments)
            {
                appt.Id = id++;
            }

            List <TimeRegion> regions = new List <TimeRegion>();

            regions.Add(new TimeRegion()
            {
                Id    = 0,
                Start = DateTime.Today.AddHours(13).AddMinutes(20),
                End   = DateTime.Today.AddHours(14).AddMinutes(45),
                Brush = new SolidColorBrush(Colors.Blue)
                {
                    Opacity = 0.4
                },
                CalendarId     = 0,
                Type           = (int)TimeRegionType.Pattern,
                RecurrenceInfo = ((RecurrenceInfo)RecurrenceBuilder.Daily(new DateTime(DateTime.Today.Year, 1, 1).AddHours(13).AddMinutes(20)).Build()).ToXml()
            });

            regions.Add(new TimeRegion()
            {
                Id    = 2,
                Start = DateTime.Today.AddHours(20),
                End   = DateTime.Today.AddHours(22),
                Brush = new SolidColorBrush(Colors.DarkBlue)
                {
                    Opacity = 0.4
                },
                CalendarId     = 0,
                Type           = (int)TimeRegionType.Pattern,
                RecurrenceInfo = ((RecurrenceInfo)RecurrenceBuilder.Daily(new DateTime(DateTime.Today.Year, 1, 1).AddHours(20)).Build()).ToXml()
            });
            regions.Add(new TimeRegion()
            {
                Id    = 1,
                Start = DateTime.Today.AddHours(13),
                End   = DateTime.Today.AddHours(14),
                Brush = new SolidColorBrush(Colors.Blue)
                {
                    Opacity = 0.4
                },
                CalendarId     = 1,
                Type           = (int)TimeRegionType.Pattern,
                RecurrenceInfo = ((RecurrenceInfo)RecurrenceBuilder.Daily(new DateTime(DateTime.Today.Year, 1, 1).AddHours(13)).Build()).ToXml()
            });
            TimeRegions = regions;
        }
Example #4
0
        static TeamData()
        {
            Random = new Random();
            Start  = GetStart();

            Employees = new List <Employee>()
            {
                new Employee()
                {
                    BirthDate = new DateTime(1978, 12, 08), FirstName = "Nancy", LastName = "Davolio"
                },
                new Employee()
                {
                    BirthDate = new DateTime(1965, 02, 19), FirstName = "Andrew", LastName = "Fuller"
                },
                new Employee()
                {
                    BirthDate = new DateTime(1968, 06, 26), FirstName = "Janet", LastName = "Leverling"
                },
                new Employee()
                {
                    BirthDate = new DateTime(1993, 05, 03), FirstName = "Margaret", LastName = "Peacock"
                },
                new Employee()
                {
                    BirthDate = new DateTime(1993, 10, 17), FirstName = "Steven", LastName = "Buchanan"
                },
                new Employee()
                {
                    BirthDate = new DateTime(1999, 10, 17), FirstName = "Michael", LastName = "Suyama"
                },
            };
            Employees[0].BirthDate = Start.AddDays(4).AddYears(-30);

            Calendars                   = CreateCalendars().ToList();
            VacationAppointments        = CreateVacationsAppointments(Start).ToList();
            CompanyBirthdayAppointments = CreateCompanyBirthdayAppointments(Start).ToList();
            BirthdayAppointments        = CreateBirthdayAppointments(Start).ToList();
            ConferenceAppointments      = CreateConferenceAppointments(Start).ToList();
            MeetingAppointments         = CreateMeetingAppointments(Start).ToList();
            PhoneCallsAppointments      = CreatePhoneCallsAppointments(Start).ToList();
            CarWashAppointments         = CreateCarWashAppointments(Start).ToList();
            TrainingAppointments        = CreateTrainingAppointments(Start).ToList();
            PayBillsAppointments        = CreatePayBillsAppointments(Start).ToList();
            DentistAppointments         = CreateDentistAppointments(Start).ToList();
            RestaurantAppointments      = CreateRestaurantAppointments(Start).ToList();
            AllAppointments             = VacationAppointments
                                          .Concat(BirthdayAppointments)
                                          .Concat(CompanyBirthdayAppointments)
                                          .Concat(ConferenceAppointments)
                                          .Concat(MeetingAppointments)
                                          .Concat(PhoneCallsAppointments)
                                          .Concat(CarWashAppointments)
                                          .Concat(TrainingAppointments)
                                          .Concat(PayBillsAppointments)
                                          .Concat(DentistAppointments)
                                          .Concat(RestaurantAppointments)
                                          .ToList();
            int id = 0;

            foreach (TeamAppointment apt in AllAppointments)
            {
                apt.Id = id++;
            }
        }