private void txtID_KeyUp(object sender, KeyEventArgs e) { dgvPonto.AutoGenerateColumns = false; if (e.KeyCode == Keys.Enter) { int id = Convert.ToInt32(txtID.Text); Business.RHBusiness busrh = new Business.RHBusiness(); Business.PontoBusiness busponto = new Business.PontoBusiness(); Model.Entities.tb_car_ponto ponto = new Model.Entities.tb_car_ponto(); Model.Entities.tb_funcionario func = busrh.ListarFunciinario(id); lblNome.Text = "Nome: " + func.nm_funcionario; ponto.id_funcionario = func.id_funcionario; ponto.dt_dia = DateTime.Now.Date; ponto.hr_almoco = DateTime.Now.TimeOfDay; ponto.hr_entrada = DateTime.Now.TimeOfDay; ponto.hr_saida = DateTime.Now.TimeOfDay; ponto.hr_saidaextra = DateTime.Now.TimeOfDay; ponto.hr_extra = DateTime.Now.TimeOfDay; ponto.hr_volta = DateTime.Now.TimeOfDay; Model.Entities.tb_car_ponto model = busponto.AdicionarPonto(ponto); List <Model.Entities.tb_car_ponto> list = busponto.ListarPonto(id); dgvPonto.DataSource = list; } }
private void button2_Click(object sender, EventArgs e) { try { Model.Entities.tb_funcionario func = cboCpf.SelectedItem as Model.Entities.tb_funcionario; Model.Entities.tb_funcionario novo = new Model.Entities.tb_funcionario(); novo.id_funcionario = func.id_funcionario; novo.bl_va = chkVa.Checked; novo.bl_vt = chkVt.Checked; novo.ds_cel = txtCel.Text; novo.ds_cep = txtCep.Text; novo.ds_cpf = txtCpf.Text; novo.ds_email = txtEmail.Text.Trim(); novo.ds_rg = txtRg.Text; novo.ds_setor = cboSetor.Text; novo.ds_tel = txtTel.Text; novo.dt_contratacao = dtpContratacao.Value; novo.dt_nasc = dtpNasc.Value; novo.end_funcionario = txtEnd.Text; novo.nm_cargo = txtCargo.Text.Trim(); novo.nm_funcionario = txtNome.Text.Trim(); novo.qt_salario = nudSalario.Value; novo.nu_funcionario = txtNCasa.Text.Trim(); novo.uf_estado = cboUF.Text; novo.vl_va = nudVa.Value; novo.vl_vt = nudVt.Value; if (rdnCasado.Checked == true) { novo.est_civil = "Casado"; } else { novo.est_civil = "Solteiro"; } if (rdnM.Checked == true) { novo.ds_genero = "M"; } else { novo.ds_genero = "F"; } Business.RHBusiness busrh = new Business.RHBusiness(); busrh.Alterar(novo); MessageBox.Show("Alteração efetuada com sucesso", "Fast Care", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (ArgumentException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception) { MessageBox.Show("Ocorreu um erro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ConsultarCpf() { Business.RHBusiness busrh = new Business.RHBusiness(); List <Model.Entities.tb_funcionario> list = busrh.ListarPorTodos(); cboCpf.DisplayMember = nameof(Model.Entities.tb_funcionario.ds_cpf); cboCpf.DataSource = list; }
private void cboOrdem_SelectedIndexChanged(object sender, EventArgs e) { string ordem = cboOrdem.Text; Business.RHBusiness busrh = new Business.RHBusiness(); List <Model.Entities.tb_funcionario> lista = busrh.ListarTodosPorOrdem(ordem); dgvFuncionario.DataSource = lista; }
public frmAlterarFuncionario() { InitializeComponent(); Business.RHBusiness busrh = new Business.RHBusiness(); List <Model.Entities.tb_funcionario> list = busrh.ListarPorTodos(); cboCpf.DisplayMember = nameof(Model.Entities.tb_funcionario.ds_cpf); cboCpf.DataSource = list; }
private void nudId_ValueChanged(object sender, EventArgs e) { dgvFuncionario.AutoGenerateColumns = false; int id = Convert.ToInt32(nudId.Value); Business.RHBusiness rh = new Business.RHBusiness(); List <Model.Entities.tb_funcionario> lista = rh.ListarPorID(id); dgvFuncionario.DataSource = lista; }
private void button2_Click(object sender, EventArgs e) { Model.Entities.tb_funcionario func = cboCpf.SelectedItem as Model.Entities.tb_funcionario; Business.RHBusiness busrh = new Business.RHBusiness(); busrh.Remover(func.id_funcionario); MessageBox.Show("Remoção efetuada com sucesso", "Fast Care", MessageBoxButtons.OK, MessageBoxIcon.Information); ConsultarCpf(); }
private void nudId_ValueChanged_1(object sender, EventArgs e) { int ID = Convert.ToInt32(nudId.Value); DateTime mes = dtpmesreferente.Value; Business.RHBusiness busi = new Business.RHBusiness(); Business.PontoBusiness busponto = new Business.PontoBusiness(); Model.Entities.tb_funcionario pag = busi.ListarFunciinario(ID); txtnome.Text = pag.nm_funcionario; txtfuncao.Text = pag.nm_cargo; nudsalario.Value = pag.qt_salario; nudVA.Value = Convert.ToDecimal(pag.vl_va); nudVt.Value = Convert.ToDecimal(pag.vl_vt); nudhoras.Value = busponto.BuscarHorasMes(ID, mes); }