Example #1
0
 private void addTesterDetails(DO.Test doTestSorce, Test boTestToUpdate)
 {
     try
     {
         DO.Tester      tester        = dlObject.getTester(doTestSorce.TesterID);
         ExternalTester testerDetails = new ExternalTester(tester.ToBOTester());
         boTestToUpdate.Tester = testerDetails;
     }
     catch (Exception exception)
     {
         throw exception.ToBOException();
     }
 }
Example #2
0
 public static BO.Tester CreateBOTester(DO.Tester other)
 {
     BO.Tester temp = new Tester(other.Id);
     temp.LastName        = other.LastName;
     temp.FirstName       = other.FirstName;
     temp.PhoneNumber     = other.PhoneNumber;
     temp.Gender          = (GenderEnum)other.Gender;
     temp.Address         = new Address(other.Address.City, other.Address.Street, other.Address.BuildingNumber);
     temp.DateOfBirth     = other.DateOfBirth;
     temp.Seniority       = other.Seniority;
     temp.MaxDistance     = other.MaxDistance;
     temp.MaxTestsPerWeek = other.MaxTestsPerWeek;
     temp.TypeCarToTest   = (CarTypeEnum)other.TypeCarToTest;
     return(temp);
 }
 public static DO.Tester ToDOTester(this Tester BOTester)
 {
     DO.Tester converted = new DO.Tester(
         BOTester.ID,
         BOTester.LastName,
         BOTester.FirstName,
         BOTester.DateOfBirth,
         (DO.Gender)BOTester.Gender,
         BOTester.Phone,
         BOTester.Address.ToDOAddress(),
         BOTester.MaxTestsPerWeek,
         BOTester.Seniority,
         (DO.VehicleType)BOTester.CarType,
         BOTester.MaxDistanceFromAddress);
     return(converted);
 }
        public static Tester ToBOTester(this DO.Tester DOTester)
        {
            Tester converted = new Tester(
                DOTester.ID,
                DOTester.LastName,
                DOTester.FirstName,
                DOTester.DateOfBirth,
                (Gender)DOTester.Gender,
                DOTester.Phone,
                DOTester.Address.ToBOAddress(),
                DOTester.MaxTestsPerWeek,
                DOTester.Seniority,
                (VehicleType)DOTester.CarType,
                DOTester.MaxDistanceFromAddress,
                new List <TesterTest>());

            return(converted);
        }
Example #5
0
 private Tester(DO.Tester other) : base(other.Id)
 {
     LastName          = other.LastName;
     FirstName         = other.FirstName;
     PhoneNumber       = other.PhoneNumber;
     Gender            = (GenderEnum)other.Gender;
     Address           = new Address(other.Address.City, other.Address.Street, other.Address.BuildingNumber);
     DateOfBirth       = other.DateOfBirth;
     Seniority         = other.Seniority;
     MaxDistance       = other.MaxDistance;
     MaxTestsPerWeek   = other.MaxTestsPerWeek;
     TypeCarToTest     = (CarTypeEnum)other.TypeCarToTest;
     AvailableWorkTime = other.AvailableWorkTime;
     foreach (var item in other.TestList)
     {
         TestList.Add(new Test(item));
     }
 }
Example #6
0
 public static DO.Tester CreateDOTester(BO.Tester other)
 {
     DO.Tester tester = new DO.Tester(other.Id);
     tester.LastName          = other.LastName;
     tester.FirstName         = other.FirstName;
     tester.SchoolName        = other.SchoolName;
     tester.TeacherName       = other.TeacherName;
     tester.PhoneNumber       = other.PhoneNumber;
     tester.Gender            = (DO.GenderEnum)other.Gender;
     tester.Address           = new DO.Address(other.Address.City, other.Address.Street, other.Address.BuildingNumber);
     tester.DateOfBirth       = other.DateOfBirth;
     tester.Seniority         = other.Seniority;
     tester.MaxDistance       = other.MaxDistance;
     tester.MaxTestsPerWeek   = other.MaxTestsPerWeek;
     tester.TypeCarToTest     = (DO.CarTypeEnum)other.TypeCarToTest;
     tester.AvailableWorkTime = other.AvailableWorkTime;
     foreach (var item in other.TestList)
     {
         tester.TestList.Add(CreateDOTest(item));
     }
     return(tester);
 }
Example #7
0
        void IBL.addTester(Tester tester)
        {
            try
            {
                //is he too young?
                if (tester.CalculateAge() < Configuration.MinimumTesterAge)
                {
                    throw new TooYoungeTesterException("tester too younge to add him.\n");
                }
                //is he too old?
                if (tester.CalculateAge() > Configuration.MaximumTestersAge)
                {
                    throw new TooOldTesterException("tester is too old to add him.\n");
                }


                DO.Tester testerToAdd = tester.ToDOTester();
                dlObject.addTester(testerToAdd, tester.TableSchedule);
            }
            catch (Exception exception)
            {
                throw exception.ToBOException();
            }
        }