/// <summary> /// ///שליפת שעות לאמא /// </summary> /// public List <TimeSpan> getAllH(string idP) { List <studens> ls = DAL.studensDAL.GetAllStudents().Where(s => s.id_parent == idP).ToList(); List <TimeSpan> lfromHour = new List <TimeSpan>(); List <TimeSpan> ltohoure = new List <TimeSpan>(); ls.ForEach(x => { timesBL time = new timesBL(); timesDTO g = time.GetTimeforMother(x.id); if (g.code_class != 0) { lfromHour.Add(g.from_hour); ltohoure.Add(g.to_hour); } }); List <TimeSpan> lt = new List <TimeSpan>(); TimeSpan min = new TimeSpan(00, 00, 00); TimeSpan max = new TimeSpan(00, 00, 00); min = lfromHour.Min(); max = ltohoure.Max(); TimeSpan h = new TimeSpan(01, 00, 00); TimeSpan y1 = new TimeSpan(); for (TimeSpan y = min; y <= max; y = y1) { y1 = y; y1 = y.Add(h); lt.Add(y); } return(lt); }
// מחזירה לכל אמא את ילידה public List <studentDTO> get_kids(string id_p) { List <studens> ls = studensDAL.GetKids(id_p); if (ls == null) { return(new List <studentDTO>()); } List <studentDTO> studentListDTO = new List <studentDTO>(); ls.ForEach(x => { studentDTO s = new studentDTO(); s.id = x.id; s.code_class = x.code_class; s.id_parent = x.id_parent; s.first_name = x.first_name; s.last_name = x.last_name; timesBL time = new timesBL(); studentListDTO.Add(s); }); return(studentListDTO); }