/// <summary> /// constractor /// </summary> /// <param name="BID">nanny's id</param> /// <param name="ChID">child's id</param> /// <param name="FM">was a first meeting? (yes/no)</param> /// <param name="T">type of salary (true - per hour, false - per month)</param> /// <param name="St">start date of working</param> /// <param name="E">end date of working</param> 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; }
/// <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; }