Example #1
0
 private void SortByExperience(ListSortDirection?direction)
 {
     if (direction == ListSortDirection.Ascending)
     {
         TestersList = TestersList.OrderBy(tester => tester.YearsOfExperience).ToList();
     }
     else if (direction == ListSortDirection.Descending)
     {
         TestersList = TestersList.OrderByDescending(tester => tester.YearsOfExperience).ToList();
     }
     else
     {
         TestersList = TestersList.OrderBy(tester => tester.YearsOfExperience).ToList();
     }
 }
Example #2
0
 private void SortByMaxDistance(ListSortDirection?direction)
 {
     if (direction == ListSortDirection.Ascending)
     {
         TestersList = TestersList.OrderBy(tester => tester.MaximalDistance).ToList();
     }
     else if (direction == ListSortDirection.Descending)
     {
         TestersList = TestersList.OrderByDescending(tester => tester.MaximalDistance).ToList();
     }
     else
     {
         TestersList = TestersList.OrderBy(tester => tester.MaximalDistance).ToList();
     }
 }
Example #3
0
 private void SortByCarType(ListSortDirection?direction)
 {
     if (direction == ListSortDirection.Ascending)
     {
         TestersList = TestersList.OrderBy(tester => tester.CarType).ToList();
     }
     else if (direction == ListSortDirection.Descending)
     {
         TestersList = TestersList.OrderByDescending(tester => tester.CarType).ToList();
     }
     else
     {
         TestersList = TestersList.OrderBy(tester => tester.CarType).ToList();
     }
 }
Example #4
0
 private void SortByDateOfBirth(ListSortDirection?direction)
 {
     if (direction == ListSortDirection.Ascending)
     {
         TestersList = TestersList.OrderBy(tester => tester.DateOfBirth).ToList();
     }
     else if (direction == ListSortDirection.Descending)
     {
         TestersList = TestersList.OrderByDescending(tester => tester.DateOfBirth).ToList();
     }
     else
     {
         TestersList = TestersList.OrderBy(tester => tester.DateOfBirth).ToList();
     }
 }
Example #5
0
        private void FilterData()
        {
            TestersList = m_Ibl.GetAllTesters();

            Trainee trainee = GetTrainee();

            if (trainee != null)
            {
                findClosetTesterButton.IsEnabled = true;
                TestersList = GetTestersByCarType();
                UpdateCollection();
                UpdateGroup();
            }
            else
            {
                findClosetTesterButton.IsEnabled = false;
            }

            if (IsTestDateTimeValid() == true)
            {
                TestersList = GetAvailableTestersByDateTime();
                UpdateCollection();
                UpdateGroup();
            }
            else
            {
                TestersList.Clear();
                UpdateCollection();
                UpdateGroup();
                return;
            }

            if (m_distance != 0)
            {
                TestersList = TestersInRange;
                UpdateCollection();
                UpdateGroup();
            }
        }
Example #6
0
        public static void init()
        {
            TestersList.Add(new Tester
            {
                ID   = "1111",
                Name = new Name {
                    FirstName = "jojo", LastName = "chalass"
                },
                Address = new Address
                {
                    City       = "Jerusalem",
                    Number     = 21,
                    StreetName = "havvad haleumi",
                    //                  ZipCode = 91160
                },
                DayOfBirth      = DateTime.Now.AddYears(-45),
                Gender          = Gender.MALE,
                Experience      = 10,
                Expertise       = CarType.Truck_Heavy,
                MaxDistance     = 2,
                MaxTestsPerWeek = 1,
                Luz             = new Schedule
                {
                    Data = new bool[5][]
                    {
                        new bool[6] {
                            false, false, true, false, false, false
                        },
                        new bool[6] {
                            false, false, false, false, false, false
                        },
                        new bool[6] {
                            false, false, false, false, false, false
                        },
                        new bool[6] {
                            false, false, true, false, false, false
                        },
                        new bool[6] {
                            false, false, false, false, false, false
                        }
                    }
                }
            });

            TraineesList.Add(new Trainee
            {
                ID   = "9999",
                Name = new Name {
                    FirstName = "eran", LastName = "zehuze"
                },
                Address = new Address
                {
                    City       = "TLv",
                    Number     = 21,
                    StreetName = "Jerusalem Bld",
                    //                  ZipCode = 91160
                },
                DayOfBirth    = DateTime.Now.AddYears(-21),
                Gender        = Gender.MALE,
                CarTrained    = CarType.TwoWheels,
                DrivingSchool = "Machon Bli Lev",
                GearType      = GearType.Manual,
                Instructor    = new Name {
                    FirstName = "Martze", LastName = "bemivne netunim"
                },
                LessonsNb = 134
            }
                             );
            TraineesList.Add(new Trainee
            {
                ID   = "99910",
                Name = new Name {
                    FirstName = "Emanuel", LastName = "Macron"
                },
                Address = new Address
                {
                    City       = "Haifa",
                    Number     = 100,
                    StreetName = "Hell Av.",
                    //                  ZipCode = 91160
                },
                DayOfBirth    = DateTime.Now.AddYears(-24),
                Gender        = Gender.MALE,
                CarTrained    = CarType.Private,
                DrivingSchool = "Machon Bli Kishkes",
                GearType      = GearType.Manual,
                Instructor    = new Name {
                    FirstName = "Super", LastName = "lo Kayam"
                },
                LessonsNb = 12
            }
                             );
        }