コード例 #1
0
        public Reporte obtenerReporte(int reporte)
        {
            Reporte reporteTmp = new Reporte();

            try
            {
                String sComando = String.Format("SELECT PK_id_reporte, NOMBRE, ESTADO, nombre_archivo " +
                                                "FROM TBL_REPORTE " +
                                                "WHERE PK_id_reporte  = {0} " +
                                                " AND ESTADO <> 0; ",
                                                reporte);

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        reporteTmp.REPORTE        = reader.GetInt32(0);
                        reporteTmp.NOMBRE         = reader.GetString(1);
                        reporteTmp.ESTADO         = reader.GetInt32(2);
                        reporteTmp.NOMBRE_ARCHIVO = reader.GetString(3);
                    }
                }
            }
            catch (OdbcException ex)
            {
                MessageBox.Show(ex.ToString(), "Error al obtener reporte");
                return(null);
            }

            return(reporteTmp);
        }
コード例 #2
0
        public List <Modulo> obtenerAllModulo()
        {
            List <Modulo> moduloList = new List <Modulo>();

            try
            {
                String sComando = String.Format("SELECT PK_ID_MODULO, NOMBRE_MODULO, DESCRIPCION_MODULO, ESTADO_MODULO " +
                                                "FROM TBL_MODULO " +
                                                "WHERE ESTADO_MODULO <> 0; ");

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        Modulo moduloTmp = new Modulo();
                        moduloTmp.MODULO      = int.Parse(reader.GetString(0));
                        moduloTmp.NOMBRE      = reader.GetString(1);
                        moduloTmp.DESCRIPCION = (reader.GetString(2).ToString() != null ? reader.GetString(2) : " ");
                        moduloTmp.ESTADO      = int.Parse(reader.GetString(3));
                        moduloList.Add(moduloTmp);
                    }
                }
            }
            catch (OdbcException ex)
            {
                MessageBox.Show(ex.ToString(), "Error al obtener lista de modulos.");
                return(null);
            }

            return(moduloList);
        }
コード例 #3
0
        public ReporteModulo obtenerReporteMdl(int modulo, int reporte)
        {
            ReporteModulo  reporteMdlTmp  = new ReporteModulo();
            ModuloControl  moduloControl  = new ModuloControl();
            ReporteControl reporteControl = new ReporteControl();

            try
            {
                String sComando = String.Format("SELECT PK_id_reporte, PK_id_Modulo, ESTADO " +
                                                "FROM TBL_RPT_MDL " +
                                                "WHERE PK_id_Modulo = {0} " +
                                                " AND PK_id_reporte = {1} " +
                                                " AND ESTADO <> 0; ",
                                                modulo.ToString(), reporte.ToString());

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

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

            return(reporteMdlTmp);
        }
コード例 #4
0
        public ReporteAplicacion obtenerReporteApp(int app, int modulo)
        {
            ReporteAplicacion reporteAppTmp = new ReporteAplicacion();

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

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        reporteAppTmp.REPORTE.REPORTE       = int.Parse(reader.GetString(0));
                        reporteAppTmp.APLICACION.APLICACION = int.Parse(reader.GetString(1));
                        reporteAppTmp.MODULO.MODULO         = int.Parse(reader.GetString(2));
                        reporteAppTmp.ESTADO = int.Parse(reader.GetString(3));
                    }
                }
            }
            catch (OdbcException ex)
            {
                MessageBox.Show(ex.ToString(), "Error al obtener reporte aplicacion.");
                return(null);
            }

            return(reporteAppTmp);
        }
コード例 #5
0
        public ConfiguracionRpt obtenerConfiguracionRpt(int configuracionRpt)
        {
            ConfiguracionRpt configuracionRptTmp = new ConfiguracionRpt();

            try
            {
                String sComando = String.Format("SELECT PK_id_configuracion , NOMBRE, RUTA, ESTADO " +
                                                "FROM TBL_CONFIGURACION_RPT " +
                                                "WHERE PK_id_configuracion  = {0} " +
                                                "AND ESTADO <> 0; ",
                                                configuracionRpt.ToString());

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        configuracionRptTmp.CONFIGURACION = reader.GetInt32(0);
                        configuracionRptTmp.NOMBRE        = reader.GetString(1);
                        configuracionRptTmp.RUTA          = reader.GetString(2);
                        configuracionRptTmp.ESTADO        = reader.GetInt32(3);
                    }
                }
            }
            catch (OdbcException ex)
            {
                MessageBox.Show(ex.ToString(), "Error al obtener reporte");
                return(null);
            }

            return(configuracionRptTmp);
        }
コード例 #6
0
        public ReporteAplicacion obtenerReporteApp(int app, int modulo)
        {
            ReporteAplicacion reporteAppTmp = new ReporteAplicacion();

            try
            {
                String sComando = String.Format("SELECT PK_id_reporte , PK_id_aplicacion, PK_id_MODULO, ESTADO " +
                                                "FROM TBL_RPT_APP " +
                                                "WHERE PK_id_aplicacion = {0} " +
                                                " AND PK_id_MODULO = {1}" +
                                                " AND ESTADO <> 0; ",
                                                app.ToString(), modulo.ToString());

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        reporteAppTmp.REPORTE    = rep.obtenerReporte(reader.GetInt32(0));
                        reporteAppTmp.APLICACION = this.app.obtenerAplicacion(reader.GetInt32(1), reader.GetInt32(2));
                        reporteAppTmp.MODULO     = mod.obtenerModulo(reader.GetInt32(2));
                        reporteAppTmp.ESTADO     = reader.GetInt32(3);
                    }
                }
            }
            catch (OdbcException ex)
            {
                throw new Exception("No se obtuvieron registros." + ex.ToString());
            }

            return(reporteAppTmp);
        }
コード例 #7
0
        public Reporte obtenerReporte(int reporte)
        {
            Reporte reporteTmp = new Reporte();
            ConfiguracionRptControl confiControl = new ConfiguracionRptControl();

            try
            {
                String sComando = String.Format("SELECT ID_REPORTE, ID_CONFIGURACION, NOMBRE, ESTADO, FILENAME " +
                                                "FROM TBL_REPORTE " +
                                                "WHERE ID_REPORTE = {0}; ",
                                                reporte);

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        reporteTmp.REPORTE       = int.Parse(reader.GetString(0));
                        reporteTmp.CONFIGURACION = confiControl.obtenerConfiguracionRpt(int.Parse(reader.GetString(1)));
                        reporteTmp.NOMBRE        = reader.GetString(2);
                        reporteTmp.ESTADO        = int.Parse(reader.GetString(3));
                        reporteTmp.FILENAME      = reader.GetString(4);
                    }
                }
            }
            catch (OdbcException ex)
            {
                MessageBox.Show(ex.ToString(), "Error al obtener reporte");
                return(null);
            }

            return(reporteTmp);
        }
コード例 #8
0
        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  = reader.GetInt32(0);
                        aplicacionTmp.MODULO      = moduloControl.obtenerModulo(reader.GetInt32(1));
                        aplicacionTmp.NOMBRE      = reader.GetString(2);
                        aplicacionTmp.DESCRIPCION = reader.IsDBNull(3) ? " " : reader.GetString(3);
                        aplicacionTmp.ESTADO      = reader.GetInt32(4);
                        aplicacionList.Add(aplicacionTmp);
                    }
                }
            }
            catch (OdbcException ex)
            {
                MessageBox.Show(ex.ToString(), "Error al obtener lista de aplicacion.");
                return(null);
            }

            return(aplicacionList);
        }
コード例 #9
0
        public PropiedadReporte obtenerPropiedadPorUsuarioAplicacion(string usuario, int aplicacion, int modulo)
        {
            PropiedadReporte  propiedad  = new PropiedadReporte();
            ReporteControl    rpt        = new ReporteControl();
            Usuario           usu        = new Usuario();
            AplicacionControl app        = new AplicacionControl();
            ModuloControl     mdl        = new ModuloControl();
            UsuarioControl    usuControl = new UsuarioControl();

            try
            {
                String sComando = String.Format("SELECT * FROM Tbl_Propiedad_Rpt " +
                                                "WHERE PK_id_usuario = '{0}' AND PK_id_aplicacion = {1} AND PK_id_modulo = {2} AND estado <> 0;",
                                                usuario, aplicacion, modulo);

                OdbcDataReader reader = transaccion.ConsultarDatos(sComando);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        propiedad.REPORTE    = rpt.obtenerReporte(reader.GetInt32(0));
                        propiedad.USUARIO    = usuControl.SetUsuario(reader.GetString(1));
                        propiedad.APLICACION = reader.IsDBNull(2) ? null : app.obtenerAplicacion(reader.GetInt32(2), reader.GetInt32(3));
                        propiedad.MODULO     = mdl.obtenerModulo(reader.GetInt32(3));
                        propiedad.IMPRIMIR   = reader.GetInt32(4);
                        propiedad.ESTADO     = reader.GetInt32(5);
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString(), "Error al insertar configuracion para PROPIEDADES.");
            }
            return(propiedad);
        }