예제 #1
0
        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;
            }
        }
예제 #2
0
        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);
        }