Example #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;
 }
        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;
        }
Example #3
0
 public List<Room> GetAllRooms()
 {
     RoomService r = new RoomService();
     return r.GetAllRooms();
 }
        public List<Room> GetAvailableRooms(string timeslotcode)
        {
            List<Room> roomList = new List<Room>();
            List<SubjectAssignment> schedList = new List<SubjectAssignment>();
            List<Room> takenRooms = new List<Room>();
            List<Room> availableRooms = new List<Room>();

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

            RoomService rs = new RoomService();
            roomList = rs.GetAllRooms();

            availableRooms = roomList.Except<Room>(takenRooms).ToList<Room>();

            return availableRooms;
        }