示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            RegistrationServiceClient registrationService = new RegistrationServiceClient();

            EnrolMe.StudentSY = RegisterStudent.StudentId + SY;
            EnrolMe.StudentId = RegisterStudent.StudentId;
            EnrolMe.SY = SY;
            EnrolMe.GradeLevel = this.GradeLevel;
            EnrolMe.Dismissed = false;
            EnrolMe.DiscountId = Int32.Parse(cmbScholarship.SelectedValue.ToString());
            EnrolMe.Rank = (int)RegisterStudent.ranking;
            //EnrolMe.GradeSectionCode=
            if (EnrolMe.Stat.Equals("b") || EnrolMe.Stat.Equals("c"))
            {
                if (registrationService.EnrolStudent(EnrolMe))
                {
                    Log("C", "StudentEnrolments", EnrolMe);
                    Log("U", "Students", EnrolMe);
                    Log("C", "StudentTraits", EnrolMe);

                    MessageBox.Show(this, "Student Successfully Registered.");
                    frmControlSubjects fmControlSubjects = new frmControlSubjects();
                    fmControlSubjects.controlStudentId = RegisterStudent.StudentId;
                    fmControlSubjects.ShowDialog(this);

                }
                else
                {
                    MessageBox.Show(this, "Student Registration Failed.");
                }
            }
            else
            {
                if (registrationService.EnrolStudent(EnrolMe))
                {
                    Log("C", "StudentEnrolments", EnrolMe);
                    Log("U", "Students", EnrolMe);
                    Log("C", "StudentTraits", EnrolMe);

                    MessageBox.Show(this, "Student Successfully Registered.");

                    frmControlSubjects fmControlSubjects = new frmControlSubjects();
                    fmControlSubjects.controlStudentId = RegisterStudent.StudentId;
                    fmControlSubjects.ShowDialog(this);

                }
                else
                    MessageBox.Show(this, "Student Registration Failed.");
            }
            this.Close();
        }