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); }
public List <Aplicacion> obtenerAllAplicacionByMdl(int modulo) { List <Aplicacion> aplicacionList = new List <Aplicacion>(); ModuloControl moduloControl = new ModuloControl(); try { String sComando = String.Format("SELECT PK_ID_APLICACION, PK_ID_MODULO, NOMBRE_APLICACION, " + "DESCRIPCION_APLICACION, ESTADO_APLICACION " + "FROM TBL_APLICACION " + "WHERE PK_ID_MODULO = {0} " + "AND ESTADO_APLICACION <> 0; ", modulo.ToString()); OdbcDataReader reader = transaccion.ConsultarDatos(sComando); if (reader.HasRows) { while (reader.Read()) { Aplicacion aplicacionTmp = new Aplicacion(); aplicacionTmp.APLICACION = int.Parse(reader.GetString(0)); aplicacionTmp.MODULO = moduloControl.obtenerModulo(int.Parse(reader.GetString(1))); aplicacionTmp.NOMBRE = reader.GetString(2); aplicacionTmp.DESCRIPCION = reader.GetString(3); aplicacionTmp.ESTADO = int.Parse(reader.GetString(4)); aplicacionList.Add(aplicacionTmp); } } } catch (OdbcException ex) { MessageBox.Show(ex.ToString(), "Error al obtener lista de aplicacion."); return(null); } return(aplicacionList); }
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); }