Ejemplo n.º 1
0
        private void btnCadastrar_Click(object sender, EventArgs e)
        {
            string endereco = cmbCidade.Text + ", " + cmbEstado.Text;
            bool   ehAtivo;

            if (chkÉAtivo.Checked)
            {
                ehAtivo = true;
            }
            else
            {
                ehAtivo = false;
            }
            bool ehAdmin;

            if (chkÉAdm.Checked)
            {
                ehAdmin = true;
            }
            else
            {
                ehAdmin = false;
            }
            Funcionario f = new Funcionario(txtNomeFuncionario.Text, mtxtCPFFuncionario.Text, mtxtRGFuncionario.Text,
                                            endereco, mtxtTelefoneFuncionario.Text, txtEmailFuncionario.Text, txtSenhaFuncionario.Text,
                                            ehAdmin, ehAtivo);


            MessageBox.Show(bll.cadastrarFuncionario(f));

            dgvFuncionarios.DataSource = null;
            dgvFuncionarios.DataSource = bll.LerTodos();
            FormCleaner.Clear(this);
        }
 private void FormPesquisaFuncionario_Load(object sender, EventArgs e)
 {
     dgvFuncionario.DataSource = null;
     dgvFuncionario.DataSource = bll.LerTodos();
     cmbOption.SelectedIndex   = 0;
     mtxtCPF.Enabled           = false;
 }
Ejemplo n.º 3
0
        private void bxtInserir_Click(object sender, EventArgs e)
        {
            Funcionario f = new Funcionario(Registro.NOVO_REGISTRO, txtNome.Text, txtCPF.Text, txtRG.Text, txtTelefone.Text, txtEmail.Text, txtSenha.Text, chkAdm.Checked);

            MessageBox.Show(bll.Inserir(f));
            dataGridView1.DataSource = bll.LerTodos();
            FormCleaner.Clear(this);
        }