Beispiel #1
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     try
     {
         Login  aLogin = new Login(userNameTextBox.Text, passwordTextBox.Text);
         string msg    = aLoginBll.login(aLogin);
         if (msg.Equals("Yes"))
         {
             this.Hide();
             WelcomeUI aWindow = new WelcomeUI();
             aWindow.Show();
             aWindow.welcomeLabel.Text       = aLogin.userName;
             aWindow.enteredAsInfoLabel.Text = @"Manager";
         }
         else
         {
             MessageBox.Show(msg, @"Message");
             clearTextBoxes();
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
     }
 }
        private void loginButton_Click(object sender, EventArgs e)
        {
            try
            {
                Login aLogin = new Login(userNameTextBox.Text, passwordTextBox.Text);
                string msg = aLoginBll.login(aLogin);
                if (msg.Equals("Yes"))
                {
                    this.Hide();
                    WelcomeUI aWindow = new WelcomeUI();
                    aWindow.Show();
                    aWindow.welcomeLabel.Text = aLogin.userName;
                    aWindow.enteredAsInfoLabel.Text = @"Manager";

                }
                else
                {
                    MessageBox.Show(msg, @"Message");
                    clearTextBoxes();
                }

            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }