private void button1_Click(object sender, EventArgs e) { ProjetoEntrar controle = new ProjetoEntrar(); controle.acessar(txtLogin.Text, txtSenha.Text); if (controle.mensagem.Equals("")) { if (controle.existe) { MessageBox.Show("Login efetuado com Sucesso!!", "Entrando", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); th = new Thread(AbrirHome); th.SetApartmentState(ApartmentState.STA); th.Start(); } else { MessageBox.Show("Login ou Senha não encontrados!!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show(controle.mensagem); } }
private void button1_Click(object sender, EventArgs e) { ProjetoEntrar controle = new ProjetoEntrar(); String mensagem = controle.criar(txtUser.Text, txtSenha.Text, txtConfSenha.Text); if (controle.existe) { MessageBox.Show(mensagem, "Cadastro", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); th = new Thread(AbrirLogin); th.SetApartmentState(ApartmentState.STA); th.Start(); } else { MessageBox.Show(controle.mensagem); } }