public void Add_Nanny(Nanny nanny1) { int age = (DateTime.Now.Subtract(nanny1.Birth_Date).Days);//we make minus between now and birth date and take all the days that she lives if (age / 365 < 18) { throw new Exception("cant add nanny less then 18 years"); } for (int i = 0; i < 7; i++)//check end isnt smaller then begining { if (nanny1.Work_Hours[1, i] < nanny1.Work_Hours[0, i]) { throw new Exception("wrong hours format"); } } my_dal.Add_Nanny(nanny1); }