private void createbutton_Click(object sender, EventArgs e)
        {
            CourseRegistration           c     = new CourseRegistration();
            CourseRepository             cRepo = new CourseRepository();
            CourseRegistrationRepository d     = new CourseRegistrationRepository();
            CourseResultsRepository      rr    = new CourseResultsRepository();

            c.CourseId   = this.courseidtextBox.Text;
            c.CourseName = d.GetCourse2(this.courseidtextBox.Text).CourseName;

            c.Section   = d.GetCourse2(this.courseidtextBox.Text).Section;
            c.Semester  = d.GetCourse2(this.courseidtextBox.Text).Semester;
            c.AccountId = this.accountidtextBox.Text;
            c.Status    = "Confirmed";
            CourseRegistrationRepository cr    = new CourseRegistrationRepository();
            CourseRepository             r     = new CourseRepository();
            AccountRepository            ar    = new AccountRepository();
            StudentBalanceRepository     sRepo = new StudentBalanceRepository();
            StudentBalance sb = new StudentBalance();

            sb.AccountId = this.accountidtextBox.Text;

            try
            {
                s = ar.GetAccountTypeShovon2(c.AccountId).AccountType;
            }
            catch
            {
            }

            if (cr.CourseVerification2(c.CourseId) == this.courseidtextBox.Text && s == "Student" && cRepo.GetCourse2(this.courseidtextBox.Text).MaxStudent != cRepo.GetCourse2(this.courseidtextBox.Text).CurrentStudent)
            {
                if (cr.DoubleIDRegistrationVerify(this.accountidtextBox.Text, this.courseidtextBox.Text).Contains(this.accountidtextBox.Text))
                {
                    MessageBox.Show("Student Already In the Course ");
                }
                else
                {
                    if (cr.Insert2(c) && rr.DoReg(c.AccountId, c.CourseId, c.Semester, c.Section, c.CourseName) && sRepo.UpdateStudentBalance(sb))
                    {
                        if (r.Increase2(c.CourseId))
                        {
                            MessageBox.Show("Successful");
                        }
                        else
                        {
                            MessageBox.Show("Error Current Student Not Increased");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Error Inserting");
                    }
                }
            }
            else
            {
                MessageBox.Show("Error Course Or Student Verification");
            }
        }
        private void DoneRegistrationClicked(object sender, EventArgs e)
        {
            string fullName   = CourseComboBox.Text;
            string nameCourse = fullName.Remove(fullName.Length - 2, 2);

            course  = nameCourse;
            section = CourseComboBox.Text;
            section = "" + section[fullName.Length - 1];

            List <Course>    cList = new List <Course>();
            CourseRepository cvr   = new CourseRepository();

            cList = cvr.GetCourseIdStudent(course, semester, section);

            string courseId = "";
            int    maxStudent = 0, currentStudent = 0;

            for (int i = 0; i < cList.Count(); i++)
            {
                courseId       = cList[i].CourseId;
                maxStudent     = cList[i].MaxStudent;
                currentStudent = cList[i].CurrentStudent;
            }

            CourseRegistrationRepository cdr = new CourseRegistrationRepository();
            CourseResultsRepository      xdr = new CourseResultsRepository();
            bool yo = xdr.DoReg(ID, courseId, semester, section, course);

            if (cdr.DoRegistration(ID, courseId, semester, section, course))
            {
                MessageBox.Show("Registration for this subject is Done", "Done");
            }
            else
            {
                MessageBox.Show("Registration for this subject is not Possible", "Error");
            }

            this.RegistrationLabel.Text += semester + ": " + course + " " + section + "\n";
        }