Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataResponse <Funcionario> response = funcionarioBLL.Autenticar(txtEmail.Text, txtSenha.Text);

            if (response.Sucesso)
            {
                FormMenu frmMenu = new FormMenu();
                this.Hide();
                frmMenu.ShowDialog();
                //Esta linha só executa quando o FormMenu for fechado
                this.Show();
            }
            else
            {
                MessageBox.Show(response.GetErrorMessage());
            }
        }
        private void btnAutenticar_Click(object sender, EventArgs e)
        {
            string        email    = txtUsuario.Text;
            string        senha    = txtSenha.Text;
            LoginResponse resposta = new LoginBLL().Autenticar(email, senha);

            if (!resposta.Sucesso)
            {
                MessageBox.Show(resposta.Mensagem);
            }
            else
            {
                FormMenu frm = new FormMenu();
                this.Hide();
                frm.ShowDialog();
                this.Show();
            }
            FormCleaner.Clear(this);
        }