Example #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);
        }