private void btnAlterarFunc_Click(object sender, EventArgs e) { Funcionario_DTO obj = new Funcionario_DTO(); obj.Nome = txtNomeFun.Text; obj.Rg = txtRgFunc.Text; obj.Tel = txtTelefoneFunc.Text; obj.Cpf = txtCpfFunc.Text; obj.Endereco = txtEndFunc.Text; obj.IdFun = txtIdFunc.Text; obj.Banco = txtBancoFunc.Text; obj.Conta = txtContaFunc.Text; obj.Agencia = txtAgenciaFunc.Text; string retornoalt = Funcionario_BLL.ValidarAlteracao(obj); MessageBox.Show(retornoalt, "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information); txtNomeFun.Clear(); txtRgFunc.Clear(); txtTelefoneFunc.Clear(); txtCpfFunc.Clear(); txtEndFunc.Clear(); txtIdFunc.Clear(); txtBancoFunc.Clear(); txtContaFunc.Clear(); txtAgenciaFunc.Clear(); btnAlterarFunc.Enabled = false; }
private void btnCadastroFunc_Click(object sender, EventArgs e) { try { Funcionario_DTO obj = new Funcionario_DTO(); obj.Nome = txtNomeFun.Text; obj.Rg = txtRgFunc.Text; obj.Tel = txtTelefoneFunc.Text; obj.Cpf = txtCpfFunc.Text; obj.Endereco = txtEndFunc.Text; obj.IdFun = txtIdFunc.Text; obj.Banco = txtBancoFunc.Text; obj.Conta = txtBancoFunc.Text; obj.Agencia = txtAgenciaFunc.Text; string retorno; retorno = Funcionario_BLL.ValidarFunc(obj); if (retorno == "sucesso") { MessageBox.Show(retorno, "Funcionário cadastrado", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); txtNomeFun.Clear(); txtRgFunc.Clear(); txtTelefoneFunc.Clear(); txtCpfFunc.Clear(); txtEndFunc.Clear(); txtIdFunc.Clear(); txtBancoFunc.Clear(); txtContaFunc.Clear(); txtAgenciaFunc.Clear(); } else { MessageBox.Show(retorno, "Funcionário não cadastrado", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message, "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnBuscasFunc_Click(object sender, EventArgs e) { try { string CPF; CPF = txtCpfFunc.Text; Funcionario_DTO BuscFun = new Funcionario_DTO(); BuscFun = Funcionario_BLL.ValidarBusc(CPF); txtNomeFun.Text = BuscFun.Nome; txtRgFunc.Text = BuscFun.Rg; txtTelefoneFunc.Text = BuscFun.Tel; txtCpfFunc.Text = BuscFun.Cpf; txtEndFunc.Text = BuscFun.Endereco; txtIdFunc.Text = BuscFun.IdFun; txtBancoFunc.Text = BuscFun.Banco; txtContaFunc.Text = BuscFun.Conta; txtAgenciaFunc.Text = BuscFun.Agencia; btnAlterarFunc.Enabled = true; } catch (Exception ex) { MessageBox.Show(ex.Message, "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error); } }