예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            frmMenuPrincipal tela = new frmMenuPrincipal();

            tela.Show();
            this.Hide();
        }
예제 #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                LoginBusiness business = new LoginBusiness();
                UsuarioDTO    user     = business.Autenticar(txtNome.Text, txtSenha.Text);

                if (user.nm_Usuario != null)
                {
                    UserSession.UsuarioLogado = user;

                    frmMenuPrincipal tela = new frmMenuPrincipal();
                    tela.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Credenciais inválidas.", "Black Fit LTDA", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message, "Black Fit LTDA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception)
            {
                MessageBox.Show("Ocorreu um erro não identificado.", "Black Fit LTDA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #3
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         frmMenuPrincipal tela = new frmMenuPrincipal();
         tela.Show();
         this.Hide();
     }
     catch
     {
         MessageBox.Show("Ocorreu um erro");
     }
 }
예제 #4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                string username = txtLogin.Text;
                string password = txtSenha.Text;

                FuncionarioBusiness business    = new FuncionarioBusiness();
                FuncionarioDTO      funcionario = business.Logar(username, password);

                if (funcionario != null)
                {
                    UserSession.UsuarioLogado = funcionario;

                    frmMenuPrincipal tela = new frmMenuPrincipal();
                    tela.Show();
                    this.Hide();
                }
            }
            catch
            {
                MessageBox.Show("Ocorreu um erro");
            }
        }