Exemplo n.º 1
0
 public Trainee(int id, string firstname, string lastname, string email, Gender traineegender, int phonenumber, Address studentaddress, DateTime birthdate, TypeOfVehicle vehicle, TypeOfGearControl gear, string drivingschoolname, string teachername, int numberofclasses, bool isrealicitzian, RegionInfo regionCountry, int password = 0)//constractor
 {
     if (id < 1000000000 && id > 99999999)
     {
         Id = id;
     }
     else
     {
         throw new Exception("ת.ז שגויה של הנבחן\n");
     }
     FirstName         = firstname;
     LastName          = lastname;
     Email             = email;
     TraineeGender     = traineegender;
     PhoneNumber       = phonenumber;
     StudentAddress    = studentaddress;
     BirthDate         = birthdate;
     Vehicle           = vehicle;
     Gear              = gear;
     DrivingSchoolName = drivingschoolname;
     TeacherName       = teachername;
     NumberOfClasses   = numberofclasses;
     Isrealicitzian    = isrealicitzian;
     // RegionCountry = regionCountry;
     if (password != 0)
     {
         Password = password;
     }
     else
     {
         Password = Id;
     }
     Age = setAge(BirthDate);
 }
Exemplo n.º 2
0
        public Test(int traineeid, DateTime testdateandtime, string startingpoint, TypeOfGearControl gear, TypeOfVehicle vehicle)
        {
            if (traineeid > 1000000)
            {
                TraineeId = traineeid;
            }
            else
            {
                throw new Exception("Wrong trainee id\n");
            }

            TestTime      = testdateandtime;
            StartingPoint = startingpoint;
            PassedTheTest = false;
            Gear          = gear;
            Vehicle       = vehicle;
        }
Exemplo n.º 3
0
        public bool IsEligibleToGetLicenseBL(Trainee trainee, TypeOfVehicle vehicle, TypeOfGearControl gear)
        {
            IEnumerable <Test> testsList = dal.getTestsDAL();

            if (testsList.Count() == 0)
            {
                return(false);
            }
            var t  = testsList.Where(x => x.TraineeId == trainee.Id && x.PassedTheTest == true);
            var t1 = t.Where(x => x.Gear == gear);
            var t2 = t1.Where(x => x.Vehicle == vehicle);

            if (t2.Any())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
 public Tester(int id, string lastName, string firstName, string email, DateTime birthday, Gender gender, int phonenumber, Address address, int yearsofexperiance, int maxtestsperweek, TypeOfVehicle vehicle, TypeOfGearControl gear, int maxdistance, bool isrealicitzian, RegionInfo regioncountry, int password = 0)
 {
     Id = id;
     LastName = lastName;
     FirstName = firstName;
     Email = email;
     BirthDate = birthday;
     TestersGender = gender;
     PhoneNumber = phonenumber;
     TesterAddress = address;
     YearsOfExperience = yearsofexperiance;
     MaxTestsPerWeek = maxtestsperweek;
     Vehicle = vehicle;
     Gear = gear;
     WorkingHours = new bool[5, 6];
     MaxDistance = maxdistance;
     if (password != 0)
         Password = password;
     else
         Password = Id;
     Isrealicitzian = isrealicitzian;
     RegionCountry = regioncountry;
     Age = setAge(BirthDate);
 }