/// <summary>
 /// constractor
 /// </summary>
 /// <param name="ID">mother's id</param>
 /// <param name="LN">mother's last name</param>
 /// <param name="FN">mother's first name</param>
 /// <param name="PN">mother's phone number</param>
 /// <param name="addr">mother's address</param>
 /// <param name="area">mother's area of nanny</param>
 /// <param name="need">what days mother needs the nanny?</param>
 /// <param name="hours">what hours in the days mother needs the nanny?</param>
 /// <param name="nt">mother's notes</param>
 public Mother(string ID, string LN, string FN, string PN, string addr, string area, bool[] need,
               TimeSpan[,] hours, string nt)
 {
     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.CheckAddress(area))
     {
         throw new Exception("Invalid address");
     }
     if (!MyFunctions.CheckArraySize1(need))
     {
         throw new Exception("Invalid arrays sizes");
     }
     if (!MyFunctions.CheckArraySize2(hours))
     {
         throw new Exception("Invalid arrays sizes");
     }
     id          = ID.Trim(); //DELETE spare space
     lastName    = LN.Trim(); //DELETE spare space
     firstName   = FN.Trim(); //DELETE spare space
     phoneNumber = PN.Trim();
     address     = addr;
     areaNanny   = area;
     needNanny   = new bool[6];
     needNanny   = need;
     workHours   = new TimeSpan[6, 2];
     workHours   = hours;
     notes       = nt;
 }
Ejemplo n.º 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;
 }