public List <ReporteModulo> obtenerAllReporteMdl()
        {
            List <ReporteModulo> reporteMdlList = new List <ReporteModulo>();
            ModuloControl        moduloControl  = new ModuloControl();
            ReporteControl       reporteControl = new ReporteControl();

            try
            {
                String sComando = String.Format("SELECT ID_REPORTE, ID_MODULO, ESTADO " +
                                                "FROM TBL_RPT_MDL " +
                                                "WHERE ESTADO <> 0; ");

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        ReporteModulo reporteMdlTmp = new ReporteModulo();
                        reporteMdlTmp.REPORTE = reporteControl.obtenerReporte(reader.GetInt32(0));
                        reporteMdlTmp.MODULO  = moduloControl.obtenerModulo(reader.GetInt32(1));
                        reporteMdlTmp.ESTADO  = reader.GetInt32(2);
                        reporteMdlList.Add(reporteMdlTmp);
                    }
                }
            }
            catch (OdbcException ex)
            {
                MessageBox.Show(ex.ToString(), "Error al obtener reporte modulo.");
                return(null);
            }

            return(reporteMdlList);
        }
示例#2
0
        public List <ReporteAplicacion> obtenerAllReporteApp()
        {
            List <ReporteAplicacion> reporteAppList    = new List <ReporteAplicacion>();
            ReporteControl           reporteControl    = new ReporteControl();
            ModuloControl            moduloControl     = new ModuloControl();
            AplicacionControl        aplicacionControl = new AplicacionControl();

            try
            {
                String sComando = String.Format("SELECT ID_REPORTE, ID_APLICACION, ID_MODULO, ESTADO " +
                                                "FROM TBL_RPT_APP " +
                                                "WHERE ESTADO <> 0; ");

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        ReporteAplicacion reporteAppTmp = new ReporteAplicacion();
                        reporteAppTmp.REPORTE    = reporteControl.obtenerReporte(reader.GetInt32(0));
                        reporteAppTmp.MODULO     = moduloControl.obtenerModulo(reader.GetInt32(2));
                        reporteAppTmp.APLICACION = aplicacionControl.obtenerAplicacion(reader.GetInt32(1),
                                                                                       reporteAppTmp.MODULO.MODULO);
                        reporteAppTmp.ESTADO = int.Parse(reader.GetString(3));
                        reporteAppList.Add(reporteAppTmp);
                    }
                }
            }
            catch (OdbcException ex)
            {
                MessageBox.Show(ex.ToString(), "Error al obtener reporte aplicacion.");
                return(null);
            }

            return(reporteAppList);
        }