Пример #1
0
        private BE.GratificacionDetalle GratificacionDetalleUiToBe(BE.UI.GratificacionDetalle uiGratificacionDetalle)
        {
            var beGratificacionDetalle = new BE.GratificacionDetalle();

            beGratificacionDetalle.IdGratificacionDetalle = uiGratificacionDetalle.Id;
            beGratificacionDetalle.Anho             = uiGratificacionDetalle.Anho;
            beGratificacionDetalle.Mes              = uiGratificacionDetalle.MesId;
            beGratificacionDetalle.CodigoEmpleado   = uiGratificacionDetalle.EmpleadoCodigo;
            beGratificacionDetalle.BonoNocturno     = uiGratificacionDetalle.BonoNocturno;
            beGratificacionDetalle.BonoHorasExtras  = uiGratificacionDetalle.BonoHorasExtras;
            beGratificacionDetalle.DiasCalendario   = uiGratificacionDetalle.DiasMes;
            beGratificacionDetalle.DiasInasistencia = uiGratificacionDetalle.DiasInasistencias;

            return(beGratificacionDetalle);
        }
Пример #2
0
        private BE.UI.GratificacionDetalle GratificacionDetalleBeToUi(BE.GratificacionDetalle beGratificacionDetalle)
        {
            var uiGratificacionDetalle = new BE.UI.GratificacionDetalle();

            uiGratificacionDetalle.Id                = beGratificacionDetalle.IdGratificacionDetalle;
            uiGratificacionDetalle.Anho              = beGratificacionDetalle.Anho;
            uiGratificacionDetalle.MesId             = beGratificacionDetalle.Mes;
            uiGratificacionDetalle.MesNombre         = this.NombreMes(beGratificacionDetalle.Mes);
            uiGratificacionDetalle.EmpleadoCodigo    = beGratificacionDetalle.CodigoEmpleado;
            uiGratificacionDetalle.BonoNocturno      = beGratificacionDetalle.BonoNocturno;
            uiGratificacionDetalle.BonoHorasExtras   = beGratificacionDetalle.BonoHorasExtras;
            uiGratificacionDetalle.DiasMes           = beGratificacionDetalle.DiasCalendario;
            uiGratificacionDetalle.DiasInasistencias = beGratificacionDetalle.DiasInasistencia;
            uiGratificacionDetalle.DiasCalculo       = uiGratificacionDetalle.DiasMes - uiGratificacionDetalle.DiasInasistencias;

            return(uiGratificacionDetalle);
        }
Пример #3
0
        public List <BE.GratificacionDetalle> ListarDetalle(int idGratificacion)
        {
            try
            {
                var lstBeGratificacionDetalle = new List <BE.GratificacionDetalle>();

                string sp = "SpTbGratificacionDetalleListar";

                using (SqlConnection cnn = new SqlConnection(ConnectionManager.ConexionLocal))
                {
                    cnn.Open();

                    SqlCommand cmd = new SqlCommand(sp, cnn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("@IDGRATIFICACION", idGratificacion));

                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        var beGratificacionDetalle = new BE.GratificacionDetalle();

                        beGratificacionDetalle.IdGratificacionDetalle = int.Parse(reader["IdGratificacionDetalle"].ToString());
                        beGratificacionDetalle.Anho             = int.Parse(reader["Anho"].ToString());
                        beGratificacionDetalle.Mes              = int.Parse(reader["Mes"].ToString());
                        beGratificacionDetalle.CodigoEmpleado   = reader["CodigoEmpleado"].ToString();
                        beGratificacionDetalle.BonoNocturno     = double.Parse(reader["BonoNocturno"].ToString());
                        beGratificacionDetalle.BonoHorasExtras  = double.Parse(reader["BonoHorasExtras"].ToString());
                        beGratificacionDetalle.DiasCalendario   = int.Parse(reader["DiasCalendario"].ToString());
                        beGratificacionDetalle.DiasInasistencia = int.Parse(reader["DiasInasistencia"].ToString());

                        lstBeGratificacionDetalle.Add(beGratificacionDetalle);
                    }
                }

                return(lstBeGratificacionDetalle);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }