Esempio n. 1
0
        private void frmControlSubjects_Load(object sender, EventArgs e)
        {        

            IRegistrationService registrationService = new RegistrationService();
            string message = String.Empty;
            
            ControlStudent = registrationService.GetStudent(controlStudentId,ref message);
            StudentEnrollment enrStudent = new StudentEnrollment();

            SY = GlobalClass.currentsy;
            enrStudent = registrationService.GetStudentEnrolled(controlStudentId,SY);

            ISubjectAssignmentService schedService = new SubjectAssignmentService();
            sections = new List<GradeSection>(schedService.GetAllSections());
            List<GradeSection> gs = new List<GradeSection>();
            gs = sections.FindAll(s => s.GradeLevel == ControlStudent.GradeLevel);

            //   cbSection.DataSource = gs;

            int index = gs.FindIndex(s => s.Section == ControlStudent.Section);
            gradeSectionCode = gs[index].GradeSectionCode;
            loadSched();
            txtSection.Text = ControlStudent.Section;
          //  cbSection.Text = ControlStudent.Section;
            txtSY.Text = SY;
            txtGradeLevel.Text = ControlStudent.GradeLevel;
            txtStudentId.Text = ControlStudent.StudentId;
            txtStudentName.Text = ControlStudent.LastName + "," + ControlStudent.FirstName + " " + ControlStudent.MiddleName;
            txtPrevGPA.Text = ControlStudent.Average.ToString();
            txtUnitsFailed.Text = ControlStudent.UnitsFailedLastYear.ToString();
           
        }
Esempio n. 2
0
        public List <TeacherLoad> GetTeacherLoad(string TeacherId, string sy)
        {
            SubjectAssignmentService sas         = new SubjectAssignmentService();
            List <TeacherLoad>       load        = new List <TeacherLoad>();
            List <SubjectAssignment> loadBdoList = new List <SubjectAssignment>();

            loadBdoList = sas.GetTeacherSchedule(TeacherId, sy);

            foreach (SubjectAssignment sab in loadBdoList)
            {
                int index = -1;
                int gsc   = sab.GradeSectionCode;
                index = load.FindIndex(item => item.GradeSectionCode == gsc);
                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);
        }
Esempio n. 3
0
        public List<TeacherLoad> GetTeacherLoad(string TeacherId, string sy)
        {
            SubjectAssignmentService sas = new SubjectAssignmentService();
            List<TeacherLoad> load = new List<TeacherLoad>();
            List<SubjectAssignment> loadBdoList = new List<SubjectAssignment>();
            loadBdoList = sas.GetTeacherSchedule(TeacherId, sy);

            foreach (SubjectAssignment sab in loadBdoList)
            {
                int index = -1;
                int gsc = sab.GradeSectionCode;
                index = load.FindIndex(item => item.GradeSectionCode == gsc);
                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;
        }
Esempio n. 4
0
 private void InitializeLists()
 {
     ISubjectAssignmentService schedService = new SubjectAssignmentService();
     scheduleList = new List<SubjectAssignment>(schedService.GetAllSchedules());
     gradeLevels = new List<GradeLevel>(schedService.GetAllGradeLevels());
     gradeLevels.RemoveAll(x => x.GradeLev == "0");
     sections = new List<GradeSection>(schedService.GetAllSections());
 }
Esempio n. 5
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);
        }
Esempio n. 6
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);
        }
Esempio n. 7
0
 private void InitializeLists()
 {
     ISubjectAssignmentService schedService = new SubjectAssignmentService();
     currentSY = schedService.GetCurrentSY();
     gradeLevels = new List<GradeLevel>(schedService.GetAllGradeLevels());
     gradeLevels.RemoveAll(x => x.GradeLev == "0");
     sections = new List<GradeSection>(schedService.GetAllSections());
     subjects = new List<Subject>(schedService.GetAllSubjects());
     
     timeslots = new List<Timeslot>(schedService.GetTimeslots());
     rooms = new List<Room>(schedService.GetAllRooms());
     teachers = new List<Teacher>(schedService.GetAllTeachers());
 }
Esempio n. 8
0
        private void LoadMe(object sender, EventArgs e)
        {
           ISubjectAssignmentService subjectAss = new SubjectAssignmentService();
            IFeeService feeSer = new FeeService();

            gradeLevels = new List<GradeLevel>(subjectAss.GetAllGradeLevels());
            schoolYears = new List<SchoolYear>(feeSer.GetLastFiveSY());
            sections = new List<GradeSection>(subjectAss.GetAllSections());

            cmbGradeLevel.DataSource = gradeLevels;
            cmbGradeLevel.ValueMember = "GradeLev";
            cmbGradeLevel.DisplayMember = "Description";

            cmbSY.DataSource = schoolYears;
            cmbSY.ValueMember = "SY";
            cmbSY.DisplayMember = "SY";
            
        }
Esempio n. 9
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);
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int selectedIndex = gvSchedule.CurrentRow.Index;
            
            if (selectedIndex >= 0)
            {
                int iSelectedSAid = int.Parse(gvSchedule.Rows[selectedIndex].Cells["SubjectAssignmentId"].Value.ToString());
                if (iSelectedSAid == 0)
                {
                    schedules.RemoveAll(x => x.SubjectAssignmentsID == 0 && x.SubjectCode == gvSchedule.Rows[selectedIndex].Cells["SubjectCode"].Value.ToString()
                                   && x.TimeslotInfo == gvSchedule.Rows[selectedIndex].Cells["TimeslotInfo"].Value.ToString() && x.RoomCode == gvSchedule.Rows[selectedIndex].Cells["RoomCode"].Value.ToString()
                                   && x.TeacherId == gvSchedule.Rows[selectedIndex].Cells["TeacherId"].Value.ToString() && x.Section == gvSchedule.Rows[selectedIndex].Cells["Section"].Value.ToString());

                    createdSchedule.RemoveAll(x => x.SubjectAssignmentsID == 0 && x.SubjectCode == gvSchedule.Rows[selectedIndex].Cells["SubjectCode"].Value.ToString()
                                        && x.TimeslotInfo == gvSchedule.Rows[selectedIndex].Cells["TimeslotInfo"].Value.ToString() && x.RoomCode == gvSchedule.Rows[selectedIndex].Cells["RoomCode"].Value.ToString()
                                        && x.TeacherId == gvSchedule.Rows[selectedIndex].Cells["TeacherId"].Value.ToString() && x.Section == gvSchedule.Rows[selectedIndex].Cells["Section"].Value.ToString());
                }
                else
                {
                    schedules.RemoveAll(x => x.SubjectAssignmentsID == iSelectedSAid && x.SubjectCode == gvSchedule.Rows[selectedIndex].Cells["SubjectCode"].Value.ToString()
                                   && x.TimeslotInfo == gvSchedule.Rows[selectedIndex].Cells["TimeslotInfo"].Value.ToString() && x.RoomCode == gvSchedule.Rows[selectedIndex].Cells["RoomCode"].Value.ToString()
                                   && x.TeacherId == gvSchedule.Rows[selectedIndex].Cells["TeacherId"].Value.ToString() && x.Section == gvSchedule.Rows[selectedIndex].Cells["Section"].Value.ToString());


                    ISubjectAssignmentService schedService = new SubjectAssignmentService();
                    string message = String.Empty;
                    schedService.DeleteSchedule(iSelectedSAid, ref message);
                    Log("D", "StudentSubjects", gvSchedule.Rows[selectedIndex]);
                    
                }


                InitializeLists();
                LoadSchedules();

                gvSchedule.DataSource = null;
                gvSchedule.DataSource = schedules.FindAll(x => x.GradeSectionCode == sectioncode); ;
                gvSchedule.Refresh();

            }
            
        }
Esempio n. 12
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;

        }
Esempio n. 13
0
 private void InitializeLists()
 {
     ISubjectAssignmentService schedService = new SubjectAssignmentService();
     
     syList = new List<SchoolYear>(schedService.GetAllSY());
 }
Esempio n. 14
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;
        }
Esempio n. 15
0
 public List<StudentSchedule> GetStudentExistingSchedule(List<StudentSubject> StudentSubjectList, string sy)
 {
     SubjectAssignmentService sas = new SubjectAssignmentService();
     return sas.GetStudentExistingSchedule(StudentSubjectList, sy);
 }
Esempio n. 16
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;
        }
Esempio n. 17
0
        private void btnChangeSection_Click(object sender, EventArgs e)
        {
            ISubjectAssignmentService schedService = new SubjectAssignmentService();
            sections = new List<GradeSection>(schedService.GetAllSectionsOfGradeLevel(ControlStudent.GradeLevel));
            //List<GradeSection> gs = new List<GradeSection>();
            //gs = sections.FindAll(s => s.GradeLevel == ControlStudent.GradeLevel);
            cbSection.DataSource = sections;
            cbSection.DisplayMember = "Section";
            cbSection.ValueMember = "GradeSectionCode";
            this.txtSection.Visible = false;
            this.cbSection.Visible = true;

            changed = true;
          
          //  cbSection.Text = ControlStudent.Section;

        }
Esempio n. 18
0
 private void frmScheduleDetails_Load(object sender, EventArgs e)
 {
     ISubjectAssignmentService schedService = new SubjectAssignmentService();
     schedules = new List<SubjectAssignment>(schedService.GetAllSchedules());
     LoadSchedules();
 }
Esempio n. 19
0
 private void SetSchedGrid()
 {
     if (SelectedSchedule != null)
     {
         ISubjectAssignmentService schedService = new SubjectAssignmentService();
         createdSchedule = new List<SubjectAssignment>(schedService.GetStudentExSchedule(SelectedSchedule.GradeSectionCode, currentSY));
         gvSchedule.DataSource = createdSchedule;
     }
 }
Esempio n. 20
0
        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;
        }
Esempio n. 21
0
 public List<StudentSchedule> GetSubjectSchedules(string sy)
 {
     SubjectAssignmentService sas = new SubjectAssignmentService();
     return sas.GetSchedules(sy);
 }
Esempio n. 22
0
        private void SaveSchedule()
        {
            Boolean ret = false;

            ISubjectAssignmentService schedService = new SubjectAssignmentService();
           
            ret = schedService.CreateSchedule(createdSchedule);
            foreach (SubjectAssignment sa in createdSchedule) 
                Log("C", "SubjectAssignments",sa);
              
            if (ret)
            {
                schedules = new List<SubjectAssignment>(schedService.GetAllSchedules());
                createdSchedule.Clear();
                InitializeLists();
                LoadSchedules();
                

                MessageBox.Show(this, "Schedule saved successfully!");
            }
            else
            {
                MessageBox.Show("Error Saving");
            }
        }
Esempio n. 23
0
        public List <StudentSchedule> GetSubjectSchedules(string sy)
        {
            SubjectAssignmentService sas = new SubjectAssignmentService();

            return(sas.GetSchedules(sy));
        }
Esempio n. 24
0
        public List <StudentSchedule> GetStudentExistingSchedule(List <StudentSubject> StudentSubjectList, string sy)
        {
            SubjectAssignmentService sas = new SubjectAssignmentService();

            return(sas.GetStudentExistingSchedule(StudentSubjectList, sy));
        }