Exemple #1
0
 private async void button1_Click(object sender, EventArgs e)
 {
     if (radioButton1.Checked)
     {
         type = Type.JobSeeker;
         if (await LoginValidation.Validate(type, username_box.Text, password_box.Text))
         {
             JobSeekerController jscontr = new JobSeekerController();
             _myId = jscontr.GetIdByUsername(username_box.Text);
             Hide();
             JobSeekerMenu JSMenu = new JobSeekerMenu(_myId);
             JSMenu.ShowDialog(this);
             username_box.Text = "";
             password_box.Text = "";
             Show();
         }
         else
         {
             MessageBox.Show("Username or Password is incorrect");
         }
     }
     else if (radioButton2.Checked)
     {
         type = Type.Employer;
         if (await LoginValidation.Validate(type, username_box.Text, password_box.Text))
         {
             EmployerController empcontr = new EmployerController();
             _myId = empcontr.GetIdByUsername(username_box.Text);
             Hide();
             EmployerMenu EMenu = new EmployerMenu(_myId);
             EMenu.ShowDialog(this);
             username_box.Text = "";
             password_box.Text = "";
             Show();
         }
         else
         {
             MessageBox.Show("Username or Password is incorrect");
         }
     }
     else
     {
         MessageBox.Show("Please choose a type of login");
     }
 }