Example #1
0
        private void frmManageSubject_Load(object sender, EventArgs e)
        {
            ILearningAreaService laService = new LearningAreaService();
            IGradeLevelService   glService = new GradeLevelService();

            gradeLevel = new List <GradeLevel>(glService.GetAllGradeLevels());


            colGradeLevel               = new GridViewComboBoxColumn("GradeLevel");
            colGradeLevel.HeaderText    = "Grade Level";
            colGradeLevel.FieldName     = "GradeLevel";
            colGradeLevel.ValueMember   = "GradeLev";
            colGradeLevel.DisplayMember = "Description";
            colGradeLevel.Width         = 110;

            colGradeLevel.DataSource = gradeLevel;

            gvSubjects.Columns.Add(colGradeLevel);


            if (Op.Equals("edit"))
            {
                SetFields();
                SetSubjectGrid();
                this.Size = new Size(812, 571);
            }

            if (Op.Equals("new"))
            {
                BindSubjectGrid();
                gvSubjects.Enabled = false;
                btnSave.Enabled    = false;
                this.Size          = new Size(812, 209);
            }
        }
Example #2
0
        private void frmStudentDetails_Load(object sender, EventArgs e)
        {
            pvStudent.SelectedPage = pvStudent.Pages[0];

            IGradeLevelService glService = new GradeLevelService();

            gradeLevel = new List <GradeLevel>(glService.GetAllGradeLevels());
            if (gradeLevel.Count > 0)
            {
                gradeLevel[0].Description = "None";
            }

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


            if (Op.Equals("new"))
            {
                GenerateStudentID();
                cmbGradeLevel.SelectedIndex = 0;
                btnEditID.Visible           = false;
            }

            if (Op.Equals("edit"))
            {
                SetFields();
            }
        }
Example #3
0
        private String getNext(String g)
        {
            GradeLevelService gls   = new GradeLevelService();
            GradeLevel        grade = gls.NextGradeLevel(g);

            return(grade.GradeLev);


            //switch (g)
            //{
            //    case "0":
            //        return "N";
            //    case "N":
            //        return "K1";

            //    case "K1":
            //        return "K2";

            //    case "K2":
            //        return "1";

            //    case "1":
            //        return "2";

            //    case "2":
            //        return "3";

            //    case "3":
            //        return "4";

            //    case "4":
            //        return "5";

            //    case "5":
            //        return "6";
            //    case "6":
            //        return "7";

            //    case "8":
            //        return "9";

            //    case "9":
            //        return "10";
            //    default: return null;

            //}
        }
Example #4
0
        public void LoadStudents()
        {
            IGradeLevelService glService = new GradeLevelService();

            gradeLevel = new List <GradeLevel>(glService.GetAllGradeLevels());
            if (gradeLevel.Count > 0)
            {
                gradeLevel[0].Description = "None";
            }

            IGradeSectionService sectionService = new GradeSectionService();

            sections = new List <GradeSection>(sectionService.GetAllGradeSections());

            IRegistrationService registrationService = new RegistrationService();

            RegisteredStudents = new List <string>(registrationService.GetEnrolledStudents(GlobalClass.currentsy));
            IStudentService studentService = new StudentService();
            string          message        = String.Empty;

            try
            {
                var students = studentService.GetAllStudents();
                studentList          = new List <Student>(students);
                gvStudent.DataSource = students;
                gvStudent.Refresh();

                if (gvStudent.RowCount != 0)
                {
                    gvStudent.Rows[0].IsSelected = true;
                }
            }
            catch (Exception ex)
            {
                message = "Error Loading Student List";
                MessageBox.Show(ex.ToString());
            }
        }