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;
 }
 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;
 }
示例#3
0
 public Contract(string BID, string ChID, bool FM, bool T, DateTime St, DateTime E)
 {
     if (!MyFunctions.CheckContract(E, St))
     {
         throw new Exception("Invalid hours");
     }
     if (!MyFunctions.CheckID(BID))
     {
         throw new Exception("Invalid ID");
     }
     if (!MyFunctions.CheckID(ChID))
     {
         throw new Exception("Invalid ID");
     }
     babySitterID = BID;
     childID      = ChID;
     firsMeating  = FM;
     start        = St;
     end          = E;
     salaryType   = T;
     payment      = 0;
     discount     = 0;
 }
 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;
 }