Пример #1
0
 public void TranslateGradeSectionBDOToGradeSection(GradeSectionBDO gs, GradeSection gsb)
 {
     RoomService rService = new RoomService();
     Room room = new Room();
     TeacherService tService = new TeacherService();
     Teacher teacher = new Teacher();
     string message = string.Empty;
        room= rService.GetRoom(gs.HomeRoomNumber);
        teacher=  tService.GetTeacher(gs.HomeRoomTeacherId, ref message);
     gsb.Deactivated = gs.Deactivated;
     gsb.GradeLevel = gs.GradeLevel;
     gsb.GradeSectionCode = gs.GradeSectionCode;
     gsb.HomeRoom = room;
     gsb.HomeRoomNumber = gs.HomeRoomNumber;
     gsb.HomeRoomTeacherId = gs.HomeRoomTeacherId;
     gsb.HomeRoomTeacher = teacher;
     if(teacher.MiddleName==String.Empty)
        gsb.TeacherName = teacher.LastName + ", " + teacher.FirstName ;
     else
     gsb.TeacherName = teacher.LastName + ", " + teacher.FirstName + " " + teacher.MiddleName.Substring(0, 1);
     gsb.Class = gs.Class;
     gsb.SY = gs.SY;
     gsb.Section = gs.Section;
 }
Пример #2
0
 public Teacher GetTeacherDetail(string teacherID, ref string message)
 {
     TeacherService ts = new TeacherService();
     return ts.GetTeacher(teacherID, ref message);
 }
Пример #3
0
 public Teacher GetTeacher(string lastname, string middlename, string firstname)
 {
     TeacherService ts = new TeacherService();
     return ts.GetTeacher(lastname, firstname, middlename);
 }
Пример #4
0
 public List<Teacher> GetAllTeachers()
 {
     TeacherService t = new TeacherService();
     return t.GetAllTeachers();
 }
Пример #5
0
        public void TranslateScheduleBDOToSchedule(SubjectAssignmentBDO sabdo, SubjectAssignment sched)
        {
            GradeSectionService gs = new GradeSectionService();
            GradeSection g = new GradeSection();
            gs.TranslateGradeSectionBDOToGradeSection(sabdo.GradeSection, g);
            sched.GradeSection = g;
            sched.Section = g.Section;
            sched.GradeLevel = g.GradeLevel;
            sched.Class = (int)g.Class;

            RoomService rs = new RoomService();
            Room r = new Room();
            rs.TranslateRoomBDOtoRoomDTO(sabdo.Room, r);
            sched.Room = r;
            sched.RoomCode = r.RoomCode;

            SubjectService ss = new SubjectService();
            Subject s = new Subject();
            ss.TranslateSubjectBDOToSubject(sabdo.Subject, s);
            sched.Subject = s;

            TeacherService ts = new TeacherService();
            Teacher t = new Teacher();
            ts.TranslateTeacherBDOToTeacherDTO(sabdo.Teacher, t);
            sched.Teacher = t;
            if (t.MiddleName == String.Empty)
                sched.TeacherName = t.LastName + ", " + t.FirstName;
            else
                sched.TeacherName = t.LastName + ", " + t.FirstName + " " + t.MiddleName.Substring(0, 1) + ".";

            TimeslotService times = new TimeslotService();
            Timeslot time = new Timeslot();
            times.TranslateTimeslotBDOToTimeslotDTo(sabdo.Timeslot, time);
            sched.Timeslot = time;
            sched.Timestart = time.TimeStart;
            sched.TimeEnd = time.TimeEnd;
            sched.Days = time.Days;

            sched.Deactivated = sabdo.Deactivated;
            sched.GradeSectionCode = sabdo.GradeSectionCode;
            sched.RoomId = sabdo.RoomId;
            sched.SubjectAssignmentsID = sabdo.SubjectAssignmentsID;
            sched.SubjectCode = sabdo.SubjectCode;

            sched.SY = sabdo.SY;
            sched.TeacherId = sabdo.TeacherId;
            sched.TimeSlotCode = sabdo.TimeSlotCode;

            sched.TimeslotInfo = time.Days + " " + time.TimeStart + "-" + time.TimeEnd;
            sched.SubjectInfo = sabdo.SubjectCode + " " + sched.Section + " " + sched.TimeslotInfo;

            sched.SubjectDescription = s.Description;
        }
Пример #6
0
        public List<Teacher> GetAvailableTeachers(string timeslotcode)
        {
            List<Teacher> teacherList = new List<Teacher>();
            List<SubjectAssignment> schedList = new List<SubjectAssignment>();
            List<Teacher> takenTeachers = new List<Teacher>();
            List<Teacher> availableTeachers = new List<Teacher>();

            SubjectAssignmentService sas = new SubjectAssignmentService();
            schedList = GetAllSchedules();
            foreach (SubjectAssignment sa in schedList)
            {
                takenTeachers.Add(sa.Teacher);
            }

            TeacherService ts = new TeacherService();
            teacherList = ts.GetAllTeachers();

            availableTeachers = teacherList.Except<Teacher>(takenTeachers).ToList<Teacher>();

            return availableTeachers;
        }