Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Course course = new Course()
            {
                courseId    = Int32.Parse(lbCourseId.Text),
                name        = tbCourseName.Text,
                courseCode  = tbCourseCode.Text,
                schoolYear  = Int32.Parse(tbSchoolYear.Text),
                blockPeriod = Int32.Parse(tbBlockPeriod.Text),
                credits     = Int32.Parse(tbCredits.Text)
            };


            editCourse.editCourse(course);
            form.refreshListview();
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Course course = new Course()
            {
                name        = tbCourseName.Text,
                courseCode  = tbCourseCode.Text,
                schoolYear  = Int32.Parse(tbSchoolYear.Text),
                blockPeriod = Int32.Parse(tbBlockPeriod.Text),
                credits     = Int32.Parse(tbCredits.Text)
            };

            AddCourse addCourse = new AddCourse();

            if (!addCourse.addCourse(course))
            {
                MessageBox.Show("Something went wrong please try again!", "Error", MessageBoxButtons.OK);
            }

            form.refreshListview();
        }