コード例 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            formStudent f = new formStudent();

            f.Show();
        }
コード例 #2
0
 private void buttonLogin_Click(object sender, EventArgs e)
 {
     try
     {
         if (!radioButtonTeacher.Checked && !radioButtonStudent.Checked)
         {
             MessageBox.Show("Giriş türünü seçiniz!", "Giriş türü seçilmedi!", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         else if (radioButtonStudent.Checked && DBOperations.CheckStudent(textBoxUsername.Text, textBoxPassword.Text))
         {
             this.Hide();
             formStudent f = new formStudent();
             f.Show();
         }
         else if (DBOperations.CheckTeacher(textBoxUsername.Text, textBoxPassword.Text))
         {
             this.Hide();
             formTeacher f = new formTeacher();
             f.Show();
         }
     }
     catch
     {
         MessageBox.Show("Bir hata gerçekleşti", "Bir hata oldu", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }