Esempio n. 1
0
 public static int GetTeacherId(HoursForTeacherDTO item)
 {
     foreach (var i in GetTeachers())
     {
         if (i.userId == item.TeacherId)
         {
             return(i.userId);
         }
     }
     return(0);
 }
Esempio n. 2
0
 public IHttpActionResult AddHourAndDay(HoursForTeacherDTO HoursForTeacher)
 {
     try
     {
         BL.HoursForTeacherBL.HoursForTeacherAdd(HoursForTeacher);
         return(Ok());
     }
     catch
     {
         return(BadRequest());
     }
 }
 public static int getIdHour(HoursForTeacherDTO hoursForTeacherDTO)
 {
     foreach (var item in Converters.HoursForTeacherConvert.DTOHoursForTeacherList(DAL.HoursForTeacherDAL.GetHoursForTeacher()))
     {
         if (item.TeacherId == hoursForTeacherDTO.TeacherId)
         {
             if (item.Day == hoursForTeacherDTO.Day && item.Endtime == hoursForTeacherDTO.Endtime && item.Starttime == hoursForTeacherDTO.Starttime)
             {
                 return(BL.TeacherBL.GetTeacherId(item));
             }
         }
     }
     return(0);
 }
Esempio n. 4
0
        public static HoursForTeacherDTO GetHoursForTeacherDTO(HoursForTeacher HoursForTeacher)
        {
            HoursForTeacherDTO HoursForTeacherDTO = new HoursForTeacherDTO();

            //HoursForTeacherDTO.HoursForTeacherId = HoursForTeacher.HoursForTeacherId;
            HoursForTeacherDTO.Day       = HoursForTeacher.Day;
            HoursForTeacherDTO.Starttime = HoursForTeacher.Starttime.ToString();
            HoursForTeacherDTO.Endtime   = HoursForTeacher.Endtime.ToString();
            HoursForTeacherDTO.TeacherId = HoursForTeacher.TeacherId;

            //foreach (var item in DAL.UserDal.GetUsers())
            //{
            //    if (item.id == HoursForTeacher.TeacherId)
            //    {
            //        HoursForTeacherDTO.password = item.password;
            //        HoursForTeacherDTO.teacherName = item.firstName;
            //    }
            //}
            return(HoursForTeacherDTO);
        }
 public static void HoursForTeacherAdd(HoursForTeacherDTO hoursForTeacher)
 {
     DAL.HoursForTeacherDAL.HoursForTeacherAdd(Converters.HoursForTeacherConvert.GetHoursForTeacher(hoursForTeacher));
 }
Esempio n. 6
0
        public int getIdHour(HoursForTeacherDTO HoursForTeacherDTO)
        {
            int x = BL.HoursForTeacherBL.getIdHour(HoursForTeacherDTO);

            return(x);
        }