Beispiel #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;
            }
        }
Beispiel #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);
        }
        public void ExibirInformacoes()
        {
            try
            {
                DataBase.Entity.tb_funcionario mod = new DataBase.Entity.tb_funcionario();

                funcionario = Convert.ToInt32(cboFuncionario.SelectedValue);
                DateTime mes = dtpMes.Value;

                Business.FolhaPagamentoBusiness bu = new Business.FolhaPagamentoBusiness();
                salario = bu.ConsultaSalario(funcionario);

                Business.PontoBusiness bu2 = new Business.PontoBusiness();
                decimal hra_extra          = Convert.ToDecimal(bu2.CalcularHorasExtras(funcionario, mes));
                cal_extra          = bu.HoraExtra50(salario, hra_extra);
                lblExtra50.Text    = Convert.ToString(cal_extra);
                lblExtra50.Visible = true;

                lblBruto.Text    = Convert.ToString(salario) + " R$";
                lblBruto.Visible = true;

                inss            = bu.CalcularInss(salario);
                lblINSS.Text    = Convert.ToString(inss) + " R$";
                lblINSS.Visible = true;

                vt            = bu.CalculoVT(salario);
                lblVT.Text    = Convert.ToString(vt) + " R$";
                lblVT.Visible = true;

                falta            = bu.Faltas(funcionario, mes);
                descfalt         = bu.DescontoFalta(falta, salario);
                lblFalta.Text    = Convert.ToString(falta) + "x" + " (" + Convert.ToString(descfalt) + " R$ )";
                lblFalta.Visible = true;

                ir            = bu.CalculoIR(salario);
                lblIR.Text    = Convert.ToString(ir) + " R$";
                lblIR.Visible = true;

                decimal tdesc = inss + vt + descfalt + ir;
                lblDescontoTotal.Text    = Convert.ToString(tdesc) + " R$";
                lblDescontoTotal.Visible = true;

                sfamily            = bu.SalarioFamilia(salario, funcionario);
                lblFamilia.Text    = Convert.ToString(sfamily) + " R$";
                lblFamilia.Visible = true;

                decimal plr = nudPLR.Value;

                decimal totbenf = plr + cal_extra + sfamily;
                lblBeneficio.Text    = Convert.ToString(totbenf) + " R$";
                lblBeneficio.Visible = true;

                salarioliquido = (salario - tdesc) + totbenf;

                lblLiquido.Text    = Convert.ToString(salarioliquido);
                lblLiquido.Visible = true;
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }