private void loginButton_Click(object sender, EventArgs e) { if (statusLabel.Text == "Connected") { if (usernameTextBox.Text != "" && passwordTextBox.Text != "") { Tuple <bool, User.AccessRights> login = network.login(usernameTextBox.Text, passwordTextBox.Text); if (login.Item1) { Form form = new ClientApplication(network, usernameTextBox.Text.ToLower(), login.Item2); this.Hide(); if (form.ShowDialog() == DialogResult.Cancel) { this.Dispose(); } } else { MessageBox.Show("Wrong username or password"); } } else { MessageBox.Show("Please enter a username and a password!"); } } }
private void loginButton_Click(object sender, EventArgs e) { if (statusLabel.Text == "Connected") { if (usernameTextBox.Text != "" && passwordTextBox.Text != "") { Tuple<bool, User.AccessRights> login = network.login(usernameTextBox.Text, passwordTextBox.Text); if (login.Item1) { Form form = new ClientApplication(network, usernameTextBox.Text.ToLower(), login.Item2); this.Hide(); if (form.ShowDialog() == DialogResult.Cancel) this.Dispose(); } else MessageBox.Show("Wrong username or password"); } else MessageBox.Show("Please enter a username and a password!"); } }