Пример #1
0
 private void btnRegister_Click(object sender, EventArgs e)
 {
     try
     {
         StudentInformationClass.SetStudentNo = StudentNumber(txtStudentNo.Text);
         StudentInformationClass.SetFullName  = FullName(txtLastName.Text, txtFirstName.Text, txtMiddleInitial.Text);
         StudentInformationClass.SetContactNo = ContactNo(txtContactNo.Text);
         StudentInformationClass.SetAge       = Age(txtAge.Text);
         StudentInformationClass.SetBirthday  = datePickerBirthday.Value.ToString("yyyy- MM-dd");
         StudentInformationClass.SetProgram   = cbPrograms.Text;
         StudentInformationClass.SetGender    = cbGender.Text;
         frmConfirmation frm = new frmConfirmation();
         frm.ShowDialog();
     }
     catch (FormatException ex)
     {
         MessageBox.Show(ex.Message);
     }
     catch (ArgumentNullException ex)
     {
         MessageBox.Show(ex.Message);
     }
     catch (IndexOutOfRangeException ex)
     {
         MessageBox.Show(ex.Message);
     }
     catch (StackOverflowException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            StudentInformationClass.SetFullName = FullName(txtLastName.Text,
                                                           txtFirstName.Text, txtMiddleInitial.Text);
            StudentInformationClass.SetStudentNo = (int)StudentNumber(txtStudentNo.Text);
            StudentInformationClass.SetProgram   = cbPrograms.Text;
            StudentInformationClass.SetGender    = cbGender.Text;
            StudentInformationClass.SetContactNo = (int)ContactNo(txtContactNo.Text);
            StudentInformationClass.SetAge       = Age(txtAge.Text);
            StudentInformationClass.SetBirthDay  = datePickerBirthday.Value.ToString("yyyy-MM-dd");
            frmConfirmation frm = new frmConfirmation();

            frm.ShowDialog();
        }