Beispiel #1
0
        public List<TeacherLoad> GetAllTeachersLoad(string sy)
        {
            SubjectAssignmentService sas = new SubjectAssignmentService();
            List<TeacherLoad> load = new List<TeacherLoad>();
            List<SubjectAssignment> loadBdoList = new List<SubjectAssignment>();
            loadBdoList = sas.GetTeacherSchedule(sy);

            foreach (SubjectAssignment sab in loadBdoList)
            {
                int index = -1;
                int gsc = sab.GradeSectionCode;
                index = load.FindIndex(item => item.GradeSectionCode == gsc && item.SubjectCode==sab.SubjectCode);
                if (index == -1)
                {
                    TeacherLoad sa = new TeacherLoad();
                    TranslateScheduleToLoad(sab, sa);
                    sa.SubjectAssignments = sab.SubjectAssignmentsID.ToString();
                    sa.TimeslotInfo = sab.TimeslotInfo;
                    load.Add(sa);
                }
                else
                {
                    string asses = String.Empty;
                    asses = load[index].SubjectAssignments;
                    string tlinfo = String.Empty;
                    tlinfo = load[index].TimeslotInfo;
                    load[index].SubjectAssignments = asses + " " + sab.SubjectAssignmentsID.ToString();
                    load[index].TimeslotInfo = tlinfo + "/" + sab.TimeslotInfo;
                }
            }
            return load;
        }
        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;
        }
        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;
        }
Beispiel #4
0
        public List<StudentSchedule> GetSubjectsOfSection(int GradeSectionCode,string sy)
        {
            SubjectAssignmentService sas = new SubjectAssignmentService();

            List<StudentSchedule> scheduleForSection = new List<StudentSchedule>();

               scheduleForSection= sas.GetStudentSchedule(GradeSectionCode,sy);

            return scheduleForSection;
        }
Beispiel #5
0
 public List<StudentSchedule> GetSubjectSchedules(string sy)
 {
     SubjectAssignmentService sas = new SubjectAssignmentService();
     return sas.GetSchedules(sy);
 }
Beispiel #6
0
        public List<SubjectAssignment> GetStudentSchedule(int rank, string gradelevel)
        {
            SubjectAssignmentService sas = new SubjectAssignmentService();

            List<SubjectAssignment> salist = new List<SubjectAssignment>();
            salist = sas.GetRightSchedule(rank, gradelevel);
            return salist;
        }
Beispiel #7
0
 public List<StudentSchedule> GetStudentExistingSchedule(List<StudentSubject> StudentSubjectList,string sy)
 {
     SubjectAssignmentService sas = new SubjectAssignmentService();
        return sas.GetStudentExistingSchedule(StudentSubjectList, sy);
 }