Example #1
0
        private void LoadMe(object sender, EventArgs e)
        {
            SubjectAssignmentServiceClient subjectAss = new SubjectAssignmentServiceClient();
            FeeServiceClient feeSer = new FeeServiceClient();

            gradeLevels = new List<ScheduleServiceRef.GradeLevel>(subjectAss.GetAllGradeLevels());
            schoolYears = new List<FeeServiceRef.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";
        }
Example #2
0
 private void InitializeLists()
 {
     SubjectAssignmentServiceClient schedService = new SubjectAssignmentServiceClient();
     scheduleList = new List<SubjectAssignment>(schedService.GetAllSchedules());
     gradeLevels = new List<GradeLevel>(schedService.GetAllGradeLevels());
     gradeLevels.RemoveAll(x => x.GradeLev == "0");
     sections = new List<GradeSection>(schedService.GetAllSections());
 }
Example #3
0
        private void InitializeLists()
        {
            SubjectAssignmentServiceClient schedService = new SubjectAssignmentServiceClient();

            syList = new List<SchoolYear>(schedService.GetAllSY());
        }
Example #4
0
 private void SetSchedGrid()
 {
     if (SelectedSchedule != null)
     {
         SubjectAssignmentServiceClient schedService = new SubjectAssignmentServiceClient();
         createdSchedule = new List<SubjectAssignment>(schedService.GetStudentExSchedule(SelectedSchedule.GradeSectionCode, currentSY));
         gvSchedule.DataSource = createdSchedule;
     }
 }
Example #5
0
        private void SaveSchedule()
        {
            Boolean ret = false;
            radWaitingBar1.StartWaiting();

            SubjectAssignmentServiceClient schedService = new SubjectAssignmentServiceClient();

            ret = schedService.CreateSchedule(createdSchedule.ToArray());
            foreach (SubjectAssignment sa in createdSchedule)
                Log("C", "SubjectAssignments",sa);

            if (ret)
            {
                schedules = new List<SubjectAssignment>(schedService.GetAllSchedules());
                createdSchedule.Clear();
                InitializeLists();
                LoadSchedules();

                radWaitingBar1.StopWaiting();

                MessageBox.Show(this, "Schedule saved successfully!");
            }
            else
            {
                radWaitingBar1.StopWaiting();
                MessageBox.Show("Error Saving");
            }
        }
Example #6
0
        private void InitializeLists()
        {
            SubjectAssignmentServiceClient schedService = new SubjectAssignmentServiceClient();
            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());
        }
Example #7
0
 private void frmScheduleDetails_Load(object sender, EventArgs e)
 {
     SubjectAssignmentServiceClient schedService = new SubjectAssignmentServiceClient();
     schedules = new List<SubjectAssignment>(schedService.GetAllSchedules());
     LoadSchedules();
 }
Example #8
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[4].Value.ToString());
                if (iSelectedSAid == 0)
                {
                    schedules.RemoveAll(x => x.SubjectAssignmentsID == 0 && x.SubjectCode == gvSchedule.Rows[selectedIndex].Cells[0].Value.ToString()
                                   && x.TimeslotInfo == gvSchedule.Rows[selectedIndex].Cells[1].Value.ToString() && x.RoomCode == gvSchedule.Rows[selectedIndex].Cells[2].Value.ToString()
                                   && x.TeacherName == gvSchedule.Rows[selectedIndex].Cells[3].Value.ToString() && x.Section == gvSchedule.Rows[selectedIndex].Cells[5].Value.ToString());

                    createdSchedule.RemoveAll(x => x.SubjectAssignmentsID == 0 && x.SubjectCode == gvSchedule.Rows[selectedIndex].Cells[0].Value.ToString()
                                        && x.TimeslotInfo == gvSchedule.Rows[selectedIndex].Cells[1].Value.ToString() && x.RoomCode == gvSchedule.Rows[selectedIndex].Cells[2].Value.ToString()
                                        && x.TeacherName == gvSchedule.Rows[selectedIndex].Cells[3].Value.ToString() && x.Section == gvSchedule.Rows[selectedIndex].Cells[5].Value.ToString());
                }
                else
                {
                    int iSAid = int.Parse(gvSchedule.Rows[selectedIndex].Cells[4].Value.ToString());

                SubjectAssignmentServiceClient schedService = new SubjectAssignmentServiceClient();
                string message = String.Empty;
                    schedService.DeleteSchedule(iSAid, ref message);
                    Log("D", "StudentSubjects", gvSchedule.Rows[selectedIndex]);

                }

                InitializeLists();
                LoadSchedules();
            }
        }