Beispiel #1
0
        public static Classroom Convert(DbClassroom dbClassroom)
        {
            if (dbClassroom == null)
            {
                return(null);
            }

            return(new Classroom()
            {
                Id = dbClassroom.Id,
                Name = dbClassroom.Name,
                Number = dbClassroom.Number,
                Capacity = dbClassroom.Capacity,

                ClassroomTypeId = dbClassroom.ClassroomTypeId,
                ClassroomType = ClassroomTypeConverter.Convert(dbClassroom.ClassroomType),

                BuildingId = dbClassroom.BuildingId,
                Building = BuildingConverter.Convert(dbClassroom.Building),

                BanPeriodTimeslots = dbClassroom.BanClassroomPeriodTimeslots
                                     .Select(x => PeriodTimeslotConverter.Convert(x.PeriodTimeslot))
                                     .ToList()
            });
        }
Beispiel #2
0
        public static Teacher Convert(DbTeacher dbTeacher)
        {
            if (dbTeacher == null)
            {
                return(null);
            }

            return(new Teacher()
            {
                Id = dbTeacher.Id,
                FirstName = dbTeacher.FirstName,
                SecondName = dbTeacher.SecondName,
                MiddleName = dbTeacher.MiddleName,
                Gender = dbTeacher.Gender,
                Birthday = dbTeacher.Birthday,

                DepartmentId = dbTeacher.DepartmentId,
                Department = DepartmentConverter.Convert(dbTeacher.Department),

                PostId = dbTeacher.PostId,
                Post = PostConverter.Convert(dbTeacher.Post),

                BanPeriodTimeslots = dbTeacher.BanTeacherPeriodTimeslots
                                     .Select(x => PeriodTimeslotConverter.Convert(x.PeriodTimeslot))
                                     .ToList()
            });
        }
Beispiel #3
0
        public static ScheduleCell Convert(DbScheduleCell dbScheduleCell)
        {
            if (dbScheduleCell == null)
            {
                return(null);
            }

            return(new ScheduleCell()
            {
                ClassroomId = dbScheduleCell.ClassroomId,
                Classroom = ClassroomConverter.Convert(dbScheduleCell.Classroom),

                PeriodTimeslotId = dbScheduleCell.PeriodTimeslotId,
                PeriodTimeslot = PeriodTimeslotConverter.Convert(dbScheduleCell.PeriodTimeslot),

                TeachingUnitId = dbScheduleCell.TeachingUnitId,
                TeachingUnit = TeachingUnitConverter.Convert(dbScheduleCell.TeachingUnit)
            });
        }