예제 #1
0
파일: MainForm.cs 프로젝트: Maharba/Asky
        private void MainForm_Load(object sender, EventArgs e)
        {
            // this.Hide();

            quizDocument1 = QuizDocument

            using (RegisterForm rf = new RegisterForm())
            {
                if (rf.ShowDialog(this) == DialogResult.OK)
                {
                    professor = rf.GetProfessorData();
                    student = rf.GetStudentData();
                    if (professor == null || student == null)
                    {
                        MessageBox.Show(Resources.MainForm_MainForm_Load_Error,
                            Resources.MainForm_MainForm_Load_Error_Title, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Application.Restart();
                    }
                }
                else
                {
                    Application.Exit();
                }
            }
        }
예제 #2
0
 private void RegisterForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     student = new Student()
                     {
                         FirstName = txtStudentFirstName.Text,
                         ID = txtStudentID.Text,
                         LastName = txtStudentLastName.Text,
                         Mail = txtStudentMail.Text
                     };
     professor = new Professor()
                     {
                         FirstName = txtProfessorFirstName.Text,
                         LastName = txtProfessorLastName.Text,
                         Mail = txtProfessorMail.Text,
                         Subject = txtProfessorSubject.Text
                     };
 }