Exemple #1
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="ID"> child's id</param>
 /// <param name="FN">child's first name</param>
 /// <param name="MID">child's mother id</param>
 /// <param name="birth">child's birthday</param>
 /// <param name="SN">child's special needs (yes/no)</param>
 /// <param name="ISN">child's information about the special needs</param>
 public Child(string ID, string FN, string MID, DateTime birth, bool SN, string ISN)
 {
     if (!MyFunctions.CheckID(ID))
     {
         throw new Exception("Invalid ID");
     }
     if (!MyFunctions.CheckName(FN))
     {
         throw new Exception("Invalid name");
     }
     if (!MyFunctions.CheckID(MID))
     {
         throw new Exception("Invalid ID");
     }
     if (!MyFunctions.CheckDatePast(birth))
     {
         throw new Exception("Invalid date");
     }
     id               = ID;
     firstName        = FN;
     motherId         = MID;
     birthday         = birth;
     specialNeeds     = SN;
     infoSpecialNeeds = ISN;
 }
Exemple #2
0
 /// <summary>
 /// constractor
 /// </summary>
 /// <param name="ID">nanny's id</param>
 /// <param name="LN">nanny's first name</param>
 /// <param name="FN">nanny's last name</param>
 /// <param name="PN">nanny's phone number</param>
 /// <param name="addr">nanny's address</param>
 /// <param name="birth">nanny's birthday</param>
 /// <param name="elev">is there elevator?</param>
 /// <param name="FB">nanny's floor building</param>
 /// <param name="EY">nanny's experience years</param>
 /// <param name="MK">nanny's maximun of kids</param>
 /// <param name="MinA">nanny's minimum age of child</param>
 /// <param name="MaxA">nanny's maximum age of child</param>
 /// <param name="HR">is nanny gets per hour?</param>
 /// <param name="HS">nanny's salary per hour</param>
 /// <param name="MS">nanny's salary per month</param>
 /// <param name="WD">nanny's work days</param>
 /// <param name="WH">nanny's work hours</param>
 /// <param name="VD">nanny's vecation days</param>
 /// <param name="recomm">nanny's recommendations</param>
 public Nanny(string ID, string LN, string FN, string PN, string addr, DateTime birth, bool elev, int FB, int EY, int MK,
              int MinA, int MaxA, bool HR, float HS, float MS, bool[] WD, TimeSpan[,] WH, bool VD, string recomm)
 {
     if (!MyFunctions.CheckID(ID))
     {
         throw new Exception("Invalid ID");
     }
     if (!MyFunctions.CheckName(LN))
     {
         throw new Exception("Invalid name");
     }
     if (!MyFunctions.CheckName(FN))
     {
         throw new Exception("Invalid name");
     }
     if (!MyFunctions.CheckPhoneNumber(PN))
     {
         throw new Exception("Invalid phone number");
     }
     if (!MyFunctions.CheckAddress(addr))
     {
         throw new Exception("Invalid address");
     }
     if (!MyFunctions.CheckDatePast(birth))
     {
         throw new Exception("Invalid date");
     }
     if (!MyFunctions.CheckArraySize1(WD))
     {
         throw new Exception("Invalid arrays sizes");
     }
     if (!MyFunctions.CheckArraySize2(WH))
     {
         throw new Exception("Invalid arrays sizes");
     }
     if (!MyFunctions.CheckMaxKids(MK))
     {
         throw new Exception("Invalid max kids");
     }
     if (!MyFunctions.CheckMinAge(MinA))
     {
         throw new Exception("Invalid min age");
     }
     if (!MyFunctions.CheckHourSalary(HS))
     {
         throw new Exception("Invalid hour salary");
     }
     if (!MyFunctions.CheckMonthSalary(MS))
     {
         throw new Exception("Invalid month salary");
     }
     id              = ID;
     lastName        = LN;
     firstName       = FN;
     phoneNumber     = PN;
     address         = addr;
     birthday        = birth;
     elevator        = elev;
     floorBuilding   = FB;
     experienceYears = EY;
     maxKids         = MK;
     minAge          = MinA;
     maxAge          = MaxA;
     hourlyRate      = HR;
     hourSalary      = HS;
     monthSalary     = MS;
     workDays        = new bool[6];
     workDays        = WD;
     workHours       = new TimeSpan[6, 2];
     workHours       = WH;
     vacationDaysITE = VD;
     recommendations = recomm;
     numOfKids       = 0;
 }