public List <string[]> consultarInstanciaCNPorId(string sqlString)
        {
            PPersistencia.ejecutaProcedures ejec = new PPersistencia.ejecutaProcedures();
            List <string[]> resultado            = ejec.ejcPsdConsulta(sqlString);

            return(resultado);
        }
        public List <string[]> insertarRFCxCN(string sqlString)
        {
            PPersistencia.ejecutaProcedures ejec = new PPersistencia.ejecutaProcedures();
            List <string[]> resultado            = ejec.ejcPsdConsulta(sqlString);

            return(resultado);
        }
        public static List <string[]> consultarConfiguracionEmail(string tipoConfig)
        {
            PPersistencia.ejecutaProcedures ejec = new PPersistencia.ejecutaProcedures();
            string sqlString = "select SMTPAdd,puerto,SSLOpt from email where sufijo = '" + tipoConfig + "';";

            return(ejec.ejcPsdConsulta(sqlString));
        }
        public string consultarNoticiasSeleccionadasMotrarEnSortTable(string[] numeros, string especificacion, string tipoTabla) // noticias seleccionadas, especificacion dentro(in), fuera(not in)
        {
            string sqlString = "";

            if (especificacion == "dentro")
            {
                sqlString += "select idnoticia as I,'<div>Titulo: </div>' + titulo as Titulo,'<div>Contenido: </div>' + (select SUBSTRING((select cuerpo),0,100)) as Contenido, " +
                             "'<div>Fecha de inicio: </div>' + cast(fechainicio as CHAR(12)) as Fecha_Inicio,'<div>Fecha de fin: </div>' + cast(fechafin as CHAR(12)) as Fecha_fin, " +
                             "'<div>URL de la imagen: </div>' + (select SUBSTRING((select urlImagen),0,100)) as URL_de_imagen from noticia " +
                             "where idNoticia in (";
            }
            else
            {
                sqlString += "select idnoticia as I,'<div>Titulo: </div>' + titulo as Titulo,'<div>Contenido: </div>' + (select SUBSTRING((select cuerpo),0,100)) as Contenido, " +
                             "'<div>Fecha de inicio: </div>' + cast(fechainicio as CHAR(12)) as Fecha_Inicio,'<div>Fecha de fin: </div>' + cast(fechafin as CHAR(12)) as Fecha_fin, " +
                             "'<div>URL de la imagen: </div>' + (select SUBSTRING((select urlImagen),0,100)) as URL_de_imagen from noticia " +
                             "where idNoticia not in (";
            }


            for (int i = 0; i < numeros.Length; i++)
            {
                sqlString += numeros[i];
                if (i + 1 < numeros.Length)
                {
                    sqlString += ",";
                }
            }
            sqlString += ") and tipoNoticia = 0";

            PPersistencia.ejecutaProcedures ejec = new PPersistencia.ejecutaProcedures();
            List <string[]> resultado            = ejec.ejcPsdConsulta(sqlString);

            if (resultado.Count > 1)
            {
                List <int> listaEvitar = new List <int>();
                if (especificacion == "dentro" && tipoTabla == "sort")
                {
                    return(Gen.Util.CS.Gen.convertToHtmlTableSort(resultado, "sortable2", "droptrue' style='width:" + "" + ";"));
                }
                else if (especificacion == "fuera" && tipoTabla == "sort")
                {
                    return(Gen.Util.CS.Gen.convertToHtmlTableSort(resultado, "sortable1", "droptrue' style='width:" + "" + ";"));
                }
                else
                {
                    return(Gen.Util.CS.Gen.convertToHtmlTableDelete(resultado, "tableToOrder", "tblComun' style='width:" + "90%" + ";", listaEvitar, false, false, false, false, 0, 1));
                }
            }
            else
            {
                return("<strong>No se encontraron resultados para mostrar en la tabla</strong>");
            }
        }
Beispiel #5
0
        public static string[] consultarUsuarioCOntrasenaInstancia(string instancia)
        {
            PPersistencia.ejecutaProcedures ejec = new PPersistencia.ejecutaProcedures();
            string          sqlString            = "select usuario, pass, sociedad from instancia where idInstancia = " + instancia;
            List <string[]> res = ejec.ejcPsdConsulta(sqlString);

            string[] array = new string[3];
            array[0] = res[1][0].Trim();
            array[1] = res[1][1].Trim();
            array[2] = res[1][2].Trim();
            return(array);
        }
        public string consultarNoticiasSeleccionadas(string[] numeros, string especificacion, string tipoTabla) // noticias seleccionadas, especificacion dentro(in), fuera(not in)
        {
            string sqlString = "";

            if (especificacion == "dentro")
            {
                sqlString += "select idNoticia as I, titulo as Titulo, (select SUBSTRING((select cuerpo),0,8000)) as Contenido, " +
                             "fechaInicio as Fecha_Inicio, fechafin as Fecha_fin, urlImagen as URL_de_imagen, esbloq as Estatus from noticia " +
                             "where idNoticia in (";
            }
            else
            {
                sqlString += "select idnoticia as I, titulo as Titulo, (select SUBSTRING((select cuerpo),0,8000)) as Contenido, " +
                             "fechainicio as Fecha_Inicio, fechafin as Fecha_fin, urlImagen as URL_de_imagen, esbloq as Estatus from noticia " +
                             "where idNoticia not in (";
            }


            for (int i = 0; i < numeros.Length; i++)
            {
                sqlString += numeros[i];
                if (i + 1 < numeros.Length)
                {
                    sqlString += ",";
                }
            }
            sqlString += ")";

            PPersistencia.ejecutaProcedures ejec = new PPersistencia.ejecutaProcedures();
            List <string[]> resultado            = ejec.ejcPsdConsulta(sqlString);

            if (resultado.Count > 1)
            {
                List <int> listaEvitar = new List <int>();
                if (especificacion == "dentro" && tipoTabla == "sort")
                {
                    return(Gen.Util.CS.Gen.convertToHtmlTableSortGrupoNoticia(resultado, "sortable2", "droptrue' style='width:" + "auto" + ";", 1));
                }
                else if (especificacion == "fuera" && tipoTabla == "sort")
                {
                    return(Gen.Util.CS.Gen.convertToHtmlTableSortGrupoNoticia(resultado, "sortable1", "droptrue' style='width:" + "auto" + ";", 1));
                }
                else
                {
                    return(Gen.Util.CS.Gen.convertToHtmlTableDelete(resultado, "tableToOrder", "tblComun' style='width:" + "90%" + ";", listaEvitar, false, false, false, false, 0, 1));
                }
            }
            else
            {
                return("<div>No se encontraron resultados para mostrar en la tabla</div>");
            }
        }
        public string consultarNoticiasUl(string ancho)
        {
            PPersistencia.ejecutaProcedures ejec = new PPersistencia.ejecutaProcedures();
            string sqlString = "";

            sqlString += "select idNoticia as I,'<div>Titulo: </div>' + titulo as Titulo,'<div>Contenido: </div>' + (select SUBSTRING((select cuerpo),0,8000)) as Contenido, " +
                         "'<div>Fecha de inicio: </div>' + cast(fechaInicio as CHAR(12)) as Fecha_Inicio,'<div>Fecha de fin: </div>' + cast(fechaFin as CHAR(12)) as Fecha_fin, " +
                         "'<div>URL de la imagen: </div>' + (select SUBSTRING((select urlImagen),0,100)) as URL_de_imagen from noticia where tipoNoticia = 0 ";
            List <string[]> resultado = ejec.ejcPsdConsulta(sqlString);

            //List<string[]> resultado = ejec.ejcPsdConsultaNOticia();
            if (resultado.Count > 1)
            {
                return(Gen.Util.CS.Gen.convertToHtmlTableSort(resultado, "sortable1", "droptrue' style='width:" + ancho + ";"));
            }
            else
            {
                return("<div>No se encontraron resultados para mostrar en la tabla</div>");
            }
        }