/// <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 timesDTO GetTimesForMother(string id) { timesBL time = new timesBL(); timesDTO t = time.GetTimeforMother(id); return(t); }
//מקבל תז הורה public timesDTO GetTimeforMother(string id) { times timesList = timesDAL.GetTimesForMother(id); if (timesList == null) { return(new timesDTO()); } timesDTO t = new timesDTO(); t.code = timesList.code; t.code_class = timesList.code_class; t.from_hour = timesList.from_hour; t.to_hour = timesList.to_hour; return(t); }
public List <timesDTO> GetTimesByCodeInstatition(int id) { List <times> timesList = timesDAL.GetTimesByCodeInstation(id); if (timesList == null) { return(new List <timesDTO>()); } List <timesDTO> timesListDTO = new List <timesDTO>(); timesList.ForEach(x => { timesDTO t = new timesDTO(); t.code = x.code; t.code_class = x.code_class; t.from_hour = x.from_hour; t.to_hour = x.to_hour; timesListDTO.Add(t); }); return(timesListDTO); }
//עדכון public void UpdateTimes(timesDTO times) { var timeMapper = iMapper.Map <timesDTO, times>(times); timesDAL.UpdateTimes(timeMapper); }
public int AddTimes(timesDTO times) { var timeMapper = iMapper.Map <timesDTO, times>(times); return(timesDAL.AddTimes(timeMapper)); }
public void Put(timesDTO timesDTO) { timesBL timesBL = new timesBL(); timesBL.UpdateTimes(timesDTO); }
public void Post(timesDTO timesDTO) { timesBL timesBL = new timesBL(); timesBL.AddTimes(timesDTO); }