private void button1_Click(object sender, EventArgs e) { string username = textBox1.Text; string password = textBox2.Text; if (us.loginUser(username, password)) { MessageBox.Show("Login successful"); User u = us.getUser(username); textBox1.Text = ""; textBox2.Text = ""; owner.setuser(u); } else { MessageBox.Show("Login failed"); } }
private void button1_Click(object sender, EventArgs e) { string username = textBox1.Text; string email = textBox2.Text; string password = textBox3.Text; if (IsValidEmail(email)) { User u = new User(username, password, email); string text = us.AddUser(u); MessageBox.Show(text); if (text == "User registered correctly") { owner.setuser(u); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; } } else { MessageBox.Show("Please use a valid email account"); } }