/// <summary> /// checking matching between mother and nanny /// </summary> /// <param name="nanny">this specific nanny would be checked</param> /// <param name="mother">this specific mother would be checked</param> /// <returns></returns> static bool matching(Nanny nanny, Mother mother) { bool flag = false; for (int i = 0; i < 6; i++) { flag = false; if (mother.get_workdays(i) == true && nanny.get_workdays(i) == false) { flag = false; break; } else { if (mother.get_workhours_start(i) >= nanny.get_workhours_start(i) && mother.get_workhours_end(i) <= nanny.get_workhours_end(i)) { flag = true; } } } return(flag); }
/// <summary> /// a fanc that compares the times of a nanny with times of mother /// </summary> /// <param name="nanny">this specific nanny would be checked</param> /// <param name="mother">this specific mother would be checked</param> /// <returns></returns> static bool Working_times(Nanny nanny, Mother mother) { bool flag = true; for (int i = 0; i < 6; i++) { if (mother.get_workdays(i) == true && nanny.get_workdays(i) == false) { flag = false; break; } if (mother.get_workdays(i) == true && nanny.get_workdays(i) == true) { if (mother.get_workhours_start(i) < nanny.get_workhours_start(i) || nanny.get_workhours_end(i) < mother.get_workhours_end(i)) { flag = false; } } break; } return(flag); }