Esempio n. 1
0
        private void btnLoginFun_Click(object sender, EventArgs e)
        {
            Funcionarios    fun   = new Funcionarios();
            DaoFuncionarios d_fun = new DaoFuncionarios();

            try
            {
                fun = d_fun.BuscarPorMatricula(Convert.ToInt16(txtLogin.Text));

                if (txtLogin.Text == Convert.ToString(fun.matricula) && txtSenha.Text == fun.senha)
                {
                    MessageBox.Show("Seja bem vindo!");
                    this.Visible = false;
                    View.frmMenu menu = new View.frmMenu();
                    menu.logado = 2;
                    menu.ShowDialog();
                    this.Visible = true;
                }
            }
            catch
            {
                MessageBox.Show("Algo de errado não está certo! Contate o ADM");
            }
        }