Esempio n. 1
0
 private void btnEntrar_Click(object sender, EventArgs e)
 {
     try
     {
         controle.Acesso(txtLogin.Text, txtSenha.Text);
         if (controle.mensagem.Equals(""))
         {
             if (controle.VerificarAcesso)
             {
                 MessageBox.Show("Logado com Sucesso", "Entrando", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 BemVindo bemvindo = new BemVindo();
                 this.Hide();
                 bemvindo.Show();
                 bemvindo.lblloginEditar.Text = txtLogin.Text.Substring(0, 1).ToUpper() + txtLogin.Text.Substring(1, txtLogin.Text.IndexOf("@") - 1);
                 bemvindo.txtLogin.Text       = txtLogin.Text;
                 bemvindo.txtSenha.Text       = txtSenha.Text;
                 bemvindo.txtConfirmar.Text   = txtSenha.Text;
             }
             else
             {
                 MessageBox.Show("Login ou senha incorreto", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show(controle.mensagem);
         }
     }
     catch (Exception)
     {
         MessageBox.Show(controle.mensagem);;
     }
 }