Ejemplo n.º 1
0
        private void LoadYearLevels()
        {
            List <string> yearlevels = YearLevel.GetYearLevelsByEducationLevel(_YearLevels, cmbEducationLevel.Text);

            cmbYearLevel.Items.Clear();
            foreach (var item in yearlevels)
            {
                cmbYearLevel.Items.Add(item);
            }
        }
Ejemplo n.º 2
0
        private void LoadSections()
        {
            List <Section> sections = YearLevel.GetYearLevelSections(YearLevel.GetYearLevelID(_YearLevels, cmbEducationLevel.Text, cmbYearLevel.Text));

            cmbSections.Tag = sections;
            cmbSections.Items.Clear();
            foreach (var item in sections)
            {
                cmbSections.Items.Add(item.SectionName);
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int            YearLevelID     = YearLevel.GetYearLevelID(_YearLevels, cmbEducationLevel.Text, cmbYearLevel.Text);
            List <Section> sections        = cmbSections.Tag as List <Section>;
            int            SelectedSection = sections[cmbSections.SelectedIndex].SectionID;

            StudentRegistrationInfo model = new StudentRegistrationInfo()
            {
                RegisteredStudentID = 0,
                StudentID           = _StudentInfo.StudentID,
                YearLevelID         = YearLevelID,
                SectionID           = SelectedSection,
                SchoolYearID        = 1,
            };

            if (StudentRegistrationInfo.RegisterStudent(model) == true)
            {
                MessageBox.Show("Student information has been successfully registered!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Error occured while registration!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }