コード例 #1
0
ファイル: loginForm.cs プロジェクト: SimeonKaishev/HangManV3
 /// <summary>
 /// The method logs the user in
 /// </summary>
 private void btnLogIn_Click(object sender, EventArgs e)
 {
     try
     {
         LoginBusiness.LogIn(Username, pass);
         this.Hide();
         var window = new Form1();
         window.ShowDialog();
         this.Close();
     }
     catch (UserDoesntExistExeption)
     {
         string            message = "User doesnt exists!";
         string            caption = "Error!";
         MessageBoxButtons buttons = MessageBoxButtons.OK;
         MessageBox.Show(message, caption, buttons);
     }
     catch (IncorrectPassExeption)
     {
         string            message = "Incorrect password!";
         string            caption = "Error!";
         MessageBoxButtons buttons = MessageBoxButtons.OK;
         MessageBox.Show(message, caption, buttons);
     }
 }