Exemple #1
0
        private void btnProcurar_Click(object sender, EventArgs e)
        {
            funcionario.matricula = Convert.ToInt16(txtMatricula.Text);
            funcionario           = d_fun.BuscarPorMatricula(funcionario.matricula);

            txtMatricula.Text = Convert.ToString(funcionario.matricula);
            txtRG.Text        = Convert.ToString(funcionario.rg);
            txtNome.Text      = funcionario.nome;
            txtCargo.Text     = funcionario.cargo;
            txtComents.Text   = Convert.ToString(funcionario.coments);
            txtCNPJ.Text      = Convert.ToString(funcionario.cli.cnpj);
        }
Exemple #2
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");
            }
        }