public BE.UI.PlanillaDetalle ObtenerPlantillaDetalle(string codigoEmpleado) { try { BE.UI.PlanillaDetalle uiPlanillaDetalle = null; var lstPlantillaDetalle = ListarPlantillaDetalle(); uiPlanillaDetalle = lstPlantillaDetalle.Where(x => x.EmpleadoCodigo == codigoEmpleado).FirstOrDefault(); return(uiPlanillaDetalle); } catch (Exception ex) { throw ex; } }
public void Cargar(BE.UI.PlanillaDetalle beDetalle) { try { if (beDetalle != null) { this.txtEmpleadoCodigo.Text = beDetalle.EmpleadoCodigo; this.txtEmpleadoNombres.Text = beDetalle.EmpleadoNombre; this.txtPeriodo.Text = beDetalle.Periodo; this.txtBonoNocturnoCantidad.Text = beDetalle.BonoNocturnoFormato; this.txtBonoNocturno.Text = beDetalle.BonoNocturnoTotal.ToString("N2"); this.txtBonoExtrasCantidad.Text = beDetalle.BonoHorasExtrasFormato; this.txtBonoExtra.Text = beDetalle.BonoHorasExtrasTotal.ToString("N2"); this.txtBonoFeriadosCantidad.Text = beDetalle.BonoFeriadoFormato; this.txtBonoFeriado.Text = beDetalle.BonoFeriadoTotal.ToString("N2"); this.txtDescuentoInasistenciasCantidad.Text = beDetalle.DescuentoInasistenciaFormato; this.txtDescuentoInasistencias.Text = beDetalle.DescuentoInasistenciaTotal.ToString("N2"); this.txtDescuentoTardanzasCantidad.Text = beDetalle.DescuentoTardanzaFormato; this.txtDescuentoTardanzas.Text = beDetalle.DescuentoTardanzaTotal.ToString("N2"); this.txtSueldoBase.Text = beDetalle.Base.ToString("N2"); this.txtSueldoAsigFam.Text = beDetalle.AsignacionFamiliar.ToString("N2"); this.txtDeduccionRJ.Text = beDetalle.RetencionJudicialTotal.ToString("N2"); this.txtDeduccionAdelantos.Text = beDetalle.AdelantoTotal.ToString("N2"); this.txtDeduccionPrestamos.Text = beDetalle.PrestamoTotal.ToString("N2"); this.txtPensionPrivada.Text = beDetalle.AfpTotal.ToString("N2"); this.txtPensionPublica.Text = beDetalle.SnpTotal.ToString("N2"); this.txtEssalud.Text = beDetalle.EsSaludTotal.ToString("N2"); this.txtSueldoNeto.Text = beDetalle.TotalNeto.ToString("N2"); this.txtSueldoPago.Text = beDetalle.TotalPagar.ToString("N2"); this.cboCalculoPor.SelectedValue = beDetalle.CalcularPor; } } catch (Exception ex) { Util.ErrorMessage(ex.Message); } }
public List <BE.UI.PlanillaDetalle> ListarPlantillaDetalle() { try { var lstUiPlantillaDetalle = new List <BE.UI.PlanillaDetalle>(); var daPlanilla = new DA.Planilla(); var bePlanilla = daPlanilla.Obtener(this.anho, this.mes); if (bePlanilla != null) { int idPlanilla = bePlanilla.ID; var lstBePlanillaDetalle = new DA.Planilla().Detalle(idPlanilla); foreach (BE.PlanillaDetalle beDetalle in lstBePlanillaDetalle) { var uiPlanillaDetalle = new BE.UI.PlanillaDetalle(); uiPlanillaDetalle.Periodo = this.anho.ToString() + "/" + this.mes.ToString(); uiPlanillaDetalle.EmpleadoCodigo = beDetalle.CodigoEmpleado; uiPlanillaDetalle.EmpleadoNombre = new DA.Trabajador().ObtenerNombreCompleto(beDetalle.CodigoEmpleado); var beCargo = new DA.Cargo().Obtener(beDetalle.IdCargo); if (beCargo != null) { uiPlanillaDetalle.CargoID = beDetalle.IdCargo; uiPlanillaDetalle.CargoNombre = beCargo.Nombre; } uiPlanillaDetalle.Base = beDetalle.SueldoBase; uiPlanillaDetalle.AsignacionFamiliar = beDetalle.AsignacionFamiliar; uiPlanillaDetalle.CalcularPor = "M"; uiPlanillaDetalle.BonoNocturnoCantidad = beDetalle.CantidadMinutosBonoNocturno; uiPlanillaDetalle.BonoNocturnoTotal = beDetalle.TotalMinutoBonoNocturno; uiPlanillaDetalle.BonoHorasExtrasCantidad = beDetalle.CantidadMinutosBonoHorasExtras; uiPlanillaDetalle.BonoHorasExtrasTotal = beDetalle.TotalMinutoBonoHorasExtras; uiPlanillaDetalle.BonoFeriadoCantidad = beDetalle.CantidadMinutosBonoFeriado; uiPlanillaDetalle.BonoFeriadoTotal = beDetalle.TotalMinutoBonoFeriado; uiPlanillaDetalle.DescuentoTardanzaCantidad = beDetalle.CantidadMinutosDescuentoTardanza; uiPlanillaDetalle.DescuentoTardanzaTotal = beDetalle.TotalMinutoDescuentoTardanza; uiPlanillaDetalle.DescuentoInasistenciaCantidad = beDetalle.CantidadMinutosDescuentoInasistencia; uiPlanillaDetalle.DescuentoInasistenciaTotal = beDetalle.TotalDescuentoInasistencia; uiPlanillaDetalle.SnpNombre = "ONP"; uiPlanillaDetalle.SnpTotal = beDetalle.SnpTotal; if (beDetalle.Afp != null && beDetalle.Afp.IdAfp > 0) { var beAfp = new BE.Afp() { IdAfp = beDetalle.Afp.IdAfp }; if (new DA.Afp().Obtener(ref beAfp)) { uiPlanillaDetalle.AfpID = beAfp.IdAfp; uiPlanillaDetalle.AfpNombre = beAfp.Nombre; } } uiPlanillaDetalle.AfpTipo = beDetalle.AfpTipo; uiPlanillaDetalle.AfpAporteObligatorio = beDetalle.AfpAporteObligatorio; uiPlanillaDetalle.AfpAporteVoluntario = beDetalle.AfpAporteVoluntario; uiPlanillaDetalle.AfpSeguro = beDetalle.AfpSeguro; uiPlanillaDetalle.AfpComision = beDetalle.AfpComision; uiPlanillaDetalle.AfpTotal = beDetalle.AfpTotal; uiPlanillaDetalle.ImpuestoTotal = beDetalle.ImpuestoTotal; uiPlanillaDetalle.RetencionJudicialTotal = beDetalle.RetencionJudicialTotal; uiPlanillaDetalle.AdelantoTotal = beDetalle.AdelantoTotal; uiPlanillaDetalle.PrestamoTotal = beDetalle.PrestamoTotal; uiPlanillaDetalle.GratificacionTotal = 0.0; uiPlanillaDetalle.EsSaludTotal = beDetalle.EsSaludTotal; uiPlanillaDetalle.MovilidadTotal = beDetalle.TotalMovilidad; uiPlanillaDetalle.TotalBase = beDetalle.TotalSueldoBase; uiPlanillaDetalle.TotalBruto = beDetalle.TotalSueldoBruto; uiPlanillaDetalle.TotalNeto = beDetalle.TotalSueldoNeto; uiPlanillaDetalle.TotalPagar = beDetalle.TotaPago; lstUiPlantillaDetalle.Add(uiPlanillaDetalle); } } bePlanilla = null; return(lstUiPlantillaDetalle); } catch (Exception ex) { throw ex; } }