Пример #1
0
        public List <GastoEntity> ListarDetalladoPaginado(Parametro pFiltro)
        {
            List <GastoEntity> lstGastoEntity = new List <GastoEntity>();

            try
            {
                using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion))
                {
                    var resul = SQLDC.pa_S_GastoPagina(pFiltro.p_NumPagina,
                                                       pFiltro.p_TamPagina,
                                                       pFiltro.p_OrdenPor,
                                                       pFiltro.p_OrdenTipo,
                                                       pFiltro.codGasto,
                                                       pFiltro.codPlantillaDeta,
                                                       pFiltro.codArea,
                                                       pFiltro.numAnio);
                    foreach (var item in resul)
                    {
                        GastoEntity objGastoEntity = new GastoEntity();
                        objGastoEntity.Codigo                                                 = item.codGasto;
                        objGastoEntity.codPlantillaDeta                                       = item.codPlantillaDeta;
                        objGastoEntity.monTotal                                               = item.monTotal;
                        objGastoEntity.cntCantidad                                            = item.cntCantidad;
                        objGastoEntity.numDocumento                                           = item.numDocumento;
                        objGastoEntity.gloObservacion                                         = item.gloObservacion;
                        objGastoEntity.fecGasto                                               = item.fecGasto;
                        objGastoEntity.codEmpleadoResp                                        = item.codEmpleadoResp;
                        objGastoEntity.objEmpleadoResp.desNombre                              = item.codEmpleadoRespNombre;
                        objGastoEntity.segUsuarioEdita                                        = item.segUsuarioEdita;
                        objGastoEntity.segFechaEdita                                          = item.segFechaCrea;
                        objGastoEntity.segUsuarioEdita                                        = item.segUsuarioEdita;
                        objGastoEntity.segFechaEdita                                          = item.segFechaCrea;
                        objGastoEntity.segMaquinaOrigen                                       = item.segMaquinaOrigen;
                        objGastoEntity.objEmpleadoResp.codArea                                = item.codArea.HasValue ? item.codArea.Value : 0;
                        objGastoEntity.objEmpleadoResp.objArea.desNombre                      = item.codAreaNombre;
                        objGastoEntity.objPlantillaDeta.objPlantilla.codPresupuesto           = item.codPresupuesto.HasValue ? item.codPresupuesto.Value : 0;
                        objGastoEntity.objPlantillaDeta.objPlantilla.objPresupuesto.desNombre = item.codPresupuestoNombre;

                        objGastoEntity.ROW       = item.ROWNUM.HasValue ? item.ROWNUM.Value : 0;
                        objGastoEntity.TOTALROWS = item.TOTALROWS.HasValue ? item.TOTALROWS.Value : 0;
                        lstGastoEntity.Add(objGastoEntity);
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error(String.Concat("ListarPaginado", " | ", ex.Message.ToString()));
                throw ex;
            }
            return(lstGastoEntity);
        }
Пример #2
0
        public List<GastoEntity> ListarDetalladoPaginado(Parametro pFiltro)
        {
            List<GastoEntity> lstGastoEntity = new List<GastoEntity>();
            try
            {
                using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion))
                {
                    var resul = SQLDC.pa_S_GastoPagina(pFiltro.p_NumPagina,
                                                       pFiltro.p_TamPagina,
                                                       pFiltro.p_OrdenPor,
                                                       pFiltro.p_OrdenTipo,
                                                       pFiltro.codGasto,
                                                       pFiltro.codPlantillaDeta,
                                                       pFiltro.codArea,
                                                       pFiltro.numAnio);
                    foreach (var item in resul)
                    {
                        GastoEntity objGastoEntity = new GastoEntity();
                        objGastoEntity.Codigo = item.codGasto;
                        objGastoEntity.codPlantillaDeta = item.codPlantillaDeta;
                        objGastoEntity.monTotal = item.monTotal;
                        objGastoEntity.cntCantidad = item.cntCantidad;
                        objGastoEntity.numDocumento = item.numDocumento;
                        objGastoEntity.gloObservacion = item.gloObservacion;
                        objGastoEntity.fecGasto = item.fecGasto;
                        objGastoEntity.codEmpleadoResp = item.codEmpleadoResp;
                        objGastoEntity.objEmpleadoResp.desNombre = item.codEmpleadoRespNombre;
                        objGastoEntity.segUsuarioEdita = item.segUsuarioEdita;
                        objGastoEntity.segFechaEdita = item.segFechaCrea;
                        objGastoEntity.segUsuarioEdita = item.segUsuarioEdita;
                        objGastoEntity.segFechaEdita = item.segFechaCrea;
                        objGastoEntity.segMaquinaOrigen = item.segMaquinaOrigen;
                        objGastoEntity.objEmpleadoResp.codArea = item.codArea.HasValue ? item.codArea.Value : 0;
                        objGastoEntity.objEmpleadoResp.objArea.desNombre = item.codAreaNombre;
                        objGastoEntity.objPlantillaDeta.objPlantilla.codPresupuesto = item.codPresupuesto.HasValue ? item.codPresupuesto.Value : 0;
                        objGastoEntity.objPlantillaDeta.objPlantilla.objPresupuesto.desNombre = item.codPresupuestoNombre;

                        objGastoEntity.ROW = item.ROWNUM.HasValue ? item.ROWNUM.Value : 0;
                        objGastoEntity.TOTALROWS = item.TOTALROWS.HasValue ? item.TOTALROWS.Value : 0;
                        lstGastoEntity.Add(objGastoEntity);
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error(String.Concat("ListarPaginado", " | ", ex.Message.ToString()));
                throw ex;
            }
            return lstGastoEntity;
        }