Example #1
0
        private BE.Gratificacion GratificacionUiToBe(BE.UI.Gratificacion uiGratificacion)
        {
            var beGratificacion = new BE.Gratificacion();

            beGratificacion.IdGratificacion            = uiGratificacion.Id;
            beGratificacion.Periodo                    = uiGratificacion.Periodo;
            beGratificacion.FechaInicio                = uiGratificacion.FechaInicial;
            beGratificacion.FechaFinal                 = uiGratificacion.FechaFinal;
            beGratificacion.Dias                       = uiGratificacion.Dias;
            beGratificacion.CodigoEmpleado             = uiGratificacion.EmpleadoCodigo;
            beGratificacion.BonoNocturnoPromedio       = uiGratificacion.BonoNocturno;
            beGratificacion.BonoHorasExtrasPromedio    = uiGratificacion.BonoHorasExtras;
            beGratificacion.SueldoBase                 = uiGratificacion.SueldoBase;
            beGratificacion.AsignacionFamiliar         = uiGratificacion.AsignacionFamiliar;
            beGratificacion.DiasLaborados              = uiGratificacion.DiasCalculo;
            beGratificacion.GratificacionBruta         = uiGratificacion.GratificacionBruta;
            beGratificacion.BonoExtraordinario         = uiGratificacion.GratificacionBono;
            beGratificacion.GratificacionNeta          = uiGratificacion.GratificacionNeta;
            beGratificacion.DescuentoRetencionJudicial = uiGratificacion.DescuentoRetencioJudicial;
            beGratificacion.DescuentoImpuesto          = uiGratificacion.DescuentoImpuestos;
            beGratificacion.GratificacionPagar         = uiGratificacion.GratificacionPago;

            if (uiGratificacion.Detalle != null)
            {
                beGratificacion.Detalle = new List <BE.GratificacionDetalle>();

                foreach (var uiGratificacionDetalle in uiGratificacion.Detalle)
                {
                    var beGratificacionDetalle = this.GratificacionDetalleUiToBe(uiGratificacionDetalle);
                    beGratificacion.Detalle.Add(beGratificacionDetalle);
                }
            }

            return(beGratificacion);
        }
Example #2
0
 public bool Actualizar(BE.UI.Gratificacion uiGratificacion)
 {
     try
     {
         var beGratificacion = this.GratificacionUiToBe(uiGratificacion);
         var rpta            = new DA.Gratificacion().Actualizar(beGratificacion);
         return(rpta > 0);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #3
0
 public bool Insertar(ref BE.UI.Gratificacion uiGratificacion)
 {
     try
     {
         var beGratificacion = this.GratificacionUiToBe(uiGratificacion);
         var rpta            = new DA.Gratificacion().Insertar(ref beGratificacion);
         return(rpta > 0);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #4
0
 public FrmGratificacionMant(FrmGratificacionList frmList)
 {
     try
     {
         InitializeComponent();
         this.frmList         = frmList;
         this.uiGratificacion = new BE.UI.Gratificacion();
     }
     catch (Exception ex)
     {
         Util.ErrorMessage(ex.Message);
     }
 }
Example #5
0
        private BE.UI.Gratificacion GratificacionBeToUi(BE.Gratificacion beGratificacion)
        {
            var uiGratificacion = new BE.UI.Gratificacion();

            uiGratificacion.Id                        = beGratificacion.IdGratificacion;
            uiGratificacion.Periodo                   = beGratificacion.Periodo;
            uiGratificacion.FechaInicial              = beGratificacion.FechaInicio;
            uiGratificacion.FechaFinal                = beGratificacion.FechaFinal;
            uiGratificacion.Dias                      = beGratificacion.Dias;
            uiGratificacion.EmpleadoCodigo            = beGratificacion.CodigoEmpleado;
            uiGratificacion.EmpleadoNombres           = new LN.Empleado().ObtenerNombreCompleto(beGratificacion.CodigoEmpleado);
            uiGratificacion.BonoNocturno              = beGratificacion.BonoNocturnoPromedio;
            uiGratificacion.BonoHorasExtras           = beGratificacion.BonoHorasExtrasPromedio;
            uiGratificacion.SueldoBase                = beGratificacion.SueldoBase;
            uiGratificacion.AsignacionFamiliar        = beGratificacion.AsignacionFamiliar;
            uiGratificacion.DiasCalculo               = beGratificacion.DiasLaborados;
            uiGratificacion.GratificacionBruta        = beGratificacion.GratificacionBruta;
            uiGratificacion.GratificacionBono         = beGratificacion.BonoExtraordinario;
            uiGratificacion.GratificacionNeta         = beGratificacion.GratificacionNeta;
            uiGratificacion.DescuentoRetencioJudicial = beGratificacion.DescuentoRetencionJudicial;
            uiGratificacion.DescuentoImpuestos        = beGratificacion.DescuentoImpuesto;
            uiGratificacion.GratificacionPago         = beGratificacion.GratificacionPagar;

            if (beGratificacion.Detalle != null)
            {
                uiGratificacion.Detalle = new List <BE.UI.GratificacionDetalle>();

                foreach (var beGratificacionDetalle in beGratificacion.Detalle)
                {
                    var uiGratificacionDetalle = this.GratificacionDetalleBeToUi(beGratificacionDetalle);
                    uiGratificacion.Detalle.Add(uiGratificacionDetalle);
                }
            }

            return(uiGratificacion);
        }
Example #6
0
        private void Limpiar()
        {
            try
            {
                //Limpiar objeto
                this.uiGratificacion = new BE.UI.Gratificacion();

                this.CargarEmpleados();
                this.CargarPeriodos();

                foreach (Control crtl in this.grpGratificacion.Controls)
                {
                    if (crtl is TextBox)
                    {
                        ((TextBox)crtl).Clear();
                        ((TextBox)crtl).ReadOnly = true;
                    }
                }

                foreach (Control crtl in this.grpSueldo.Controls)
                {
                    if (crtl is TextBox)
                    {
                        ((TextBox)crtl).Text     = "0.0";
                        ((TextBox)crtl).ReadOnly = true;
                    }
                }

                foreach (Control crtl in this.grpBonos.Controls)
                {
                    if (crtl is TextBox)
                    {
                        ((TextBox)crtl).Text     = "0.0";
                        ((TextBox)crtl).ReadOnly = true;
                    }
                }

                foreach (Control crtl in this.grpDescuentos.Controls)
                {
                    if (crtl is TextBox)
                    {
                        ((TextBox)crtl).Text     = "0.0";
                        ((TextBox)crtl).ReadOnly = true;
                    }
                }

                foreach (Control crtl in this.grpResumen.Controls)
                {
                    if (crtl is TextBox)
                    {
                        ((TextBox)crtl).Text     = "0.0";
                        ((TextBox)crtl).ReadOnly = true;
                    }
                }

                var lstUiGratificacionDetalle = new List <BE.UI.GratificacionDetalle>();
                var source = new BindingSource();
                source.DataSource = lstUiGratificacionDetalle;
                this.dgvDetalleGratificaciones.DataSource = source;

                this.FormatoDetalleGratificacion();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #7
0
        public void Cargar(BE.UI.Gratificacion uiGratificacion)
        {
            try
            {
                if (uiGratificacion != null)
                {
                    this.uiGratificacion = new LN.Gratificacion().Obtener(uiGratificacion.Id);

                    this.txtPeriodo.Text         = this.uiGratificacion.Periodo;
                    this.txtDias.Text            = this.uiGratificacion.Dias.ToString();
                    this.txtFechaInicial.Text    = this.uiGratificacion.FechaInicial.ToString("dd/MM/yyyy");
                    this.txtFechaFinal.Text      = this.uiGratificacion.FechaFinal.ToString("dd/MM/yyyy");
                    this.txtEmpleadoCodigo.Text  = this.uiGratificacion.EmpleadoCodigo;
                    this.txtEmpleadoNombres.Text = this.uiGratificacion.EmpleadoNombres;

                    this.txtSueldoBase.Text            = this.uiGratificacion.SueldoBase.ToString("N2");
                    this.txtSueldoAsigFam.Text         = this.uiGratificacion.AsignacionFamiliar.ToString("N2");
                    this.txtBonoNocturno.Text          = this.uiGratificacion.BonoNocturno.ToString("N2");
                    this.txtBonoExtra.Text             = this.uiGratificacion.BonoHorasExtras.ToString("N2");
                    this.txtDescuentoRJ.Text           = this.uiGratificacion.DescuentoRetencioJudicial.ToString("N2");
                    this.txtDescuentoImpuesto.Text     = this.uiGratificacion.DescuentoImpuestos.ToString("N2");
                    this.txtDescuentoImpuesto.ReadOnly = false;

                    this.txtGratificacionBruta.Text        = this.uiGratificacion.GratificacionBruta.ToString("N2");
                    this.txtGratificacionBonificacion.Text = this.uiGratificacion.GratificacionBono.ToString("N2");
                    this.txtGratificacionNeta.Text         = this.uiGratificacion.GratificacionNeta.ToString("N2");
                    this.txtGratificacionPago.Text         = this.uiGratificacion.GratificacionPago.ToString("N2");

                    if (this.uiGratificacion.Detalle == null)
                    {
                        this.uiGratificacion.Detalle = new List <BE.UI.GratificacionDetalle>();
                    }

                    double bonoNocturno   = 0.0;
                    double bonoHorasExtra = 0.0;
                    int    diasCalculo    = 0;

                    foreach (BE.UI.GratificacionDetalle uiGratificacionDetalle in this.uiGratificacion.Detalle)
                    {
                        bonoNocturno   += uiGratificacionDetalle.BonoNocturno;
                        bonoHorasExtra += uiGratificacionDetalle.BonoHorasExtras;
                        diasCalculo    += uiGratificacionDetalle.DiasCalculo;
                    }

                    this.txtDetalleBonoNocturno.Text    = bonoNocturno.ToString("N2");
                    this.txtDetalleBonoHorasExtras.Text = bonoHorasExtra.ToString("N2");
                    this.txtDetalleDiasCalculo.Text     = diasCalculo.ToString();

                    var source = new BindingSource();
                    source.DataSource = this.uiGratificacion.Detalle;

                    this.dgvDetalleGratificaciones.DataSource = source;

                    this.FormatoDetalleGratificacion();
                }
            }
            catch (Exception ex)
            {
                Util.ErrorMessage(ex.Message);
            }
        }