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(); }
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); }
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; }
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()); }
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); }
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); }
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()); }
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"; }
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); }
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(); } }
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; }
private void InitializeLists() { ISubjectAssignmentService schedService = new SubjectAssignmentService(); syList = new List<SchoolYear>(schedService.GetAllSY()); }
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; }
public List<StudentSchedule> GetStudentExistingSchedule(List<StudentSubject> StudentSubjectList, string sy) { SubjectAssignmentService sas = new SubjectAssignmentService(); return sas.GetStudentExistingSchedule(StudentSubjectList, sy); }
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; }
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; }
private void frmScheduleDetails_Load(object sender, EventArgs e) { ISubjectAssignmentService schedService = new SubjectAssignmentService(); schedules = new List<SubjectAssignment>(schedService.GetAllSchedules()); LoadSchedules(); }
private void SetSchedGrid() { if (SelectedSchedule != null) { ISubjectAssignmentService schedService = new SubjectAssignmentService(); createdSchedule = new List<SubjectAssignment>(schedService.GetStudentExSchedule(SelectedSchedule.GradeSectionCode, currentSY)); gvSchedule.DataSource = createdSchedule; } }
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; }
public List<StudentSchedule> GetSubjectSchedules(string sy) { SubjectAssignmentService sas = new SubjectAssignmentService(); return sas.GetSchedules(sy); }
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"); } }
public List <StudentSchedule> GetSubjectSchedules(string sy) { SubjectAssignmentService sas = new SubjectAssignmentService(); return(sas.GetSchedules(sy)); }
public List <StudentSchedule> GetStudentExistingSchedule(List <StudentSubject> StudentSubjectList, string sy) { SubjectAssignmentService sas = new SubjectAssignmentService(); return(sas.GetStudentExistingSchedule(StudentSubjectList, sy)); }