Ejemplo n.º 1
0
        public DataSet cRecuperaDsResult(string sObjeto)
        {
            DataSet dsData = null;

            try
            {
                string idSession = new clsCacheControl().RecuperarSesionId();
                string FileCache = sObjeto + "_" + idSession;
                dsData = new clsSerializer().XMLDataset(FileCache);
            }
            catch { }
            return(dsData);
        }
        /// <summary>
        /// Metodo para idiomas generales
        /// </summary>
        /// <param name="Forma">Tipo de referencia</param>
        /// <param name="ReferenciaPaginas">Referencia</param>
        /// <returns>Dataset de resultados</returns>

        public DataSet dsIdioma(string Forma, string ReferenciaPaginas, string sOrden)
        {
            DataSet dstDatos   = new DataSet();
            string  Idioma     = clsSesiones.getIdioma();
            string  Aplicacion = clsSesiones.getAplicacion().ToString();

            clsSerializer cSerializer = new clsSerializer();
            string        strPathXML  = clsValidaciones.XMLDatasetCreaGen();
            string        strArchivo  = Forma + "_" + ReferenciaPaginas + sOrden + "_" + Idioma + Aplicacion + ".xml";
            string        strFile     = strPathXML + strArchivo;

            try
            {
                if (File.Exists(strFile))
                {
                    dstDatos = cSerializer.XMLDatasetGen(strFile);
                }
                else
                {
                    string        Control  = clsValidaciones.GetKeyOrAdd("Controls", "Controls");
                    StringBuilder Consulta = new StringBuilder();
                    DataSql       dSql     = new DataSql();
                    Consulta.AppendLine(" SELECT     tblRefereControls_1.strValor AS strControlValue, tblIdioma.strObject AS strEtiqueta, tblIdioma.strLabel, tblIdioma.strText,  ");
                    Consulta.AppendLine(" tblIdioma.strTooltip, tblIdioma.strLink, tblIdioma.strLinkClient, tblIdioma.strImagen, tblIdioma.intTipo ");
                    Consulta.AppendLine(" FROM         tblTipoRefere AS tblTipoRefere_1 INNER JOIN ");
                    Consulta.AppendLine(" tblRefereControls AS tblRefereControls_1 ON tblTipoRefere_1.intidTipoRefere = tblRefereControls_1.intidTipoRefere INNER JOIN ");
                    Consulta.AppendLine(" tblTipoRefere INNER JOIN ");
                    Consulta.AppendLine(" tblRefereControls ON tblTipoRefere.intidTipoRefere = tblRefereControls.intidTipoRefere INNER JOIN ");
                    Consulta.AppendLine(" tblRelaRefereControls ON tblRefereControls.intidRefere = tblRelaRefereControls.intidRefereControl INNER JOIN ");
                    Consulta.AppendLine(" tblIdioma ON tblRelaRefereControls.intidRefereAsociado = tblIdioma.intForma AND  ");
                    Consulta.AppendLine(" tblRefereControls.intAplicacion = tblIdioma.intAplicacion ON tblRefereControls_1.intidRefere = tblIdioma.intEtiqueta AND  ");
                    Consulta.AppendLine(" tblRefereControls_1.intAplicacion = tblIdioma.intAplicacion ");
                    Consulta.AppendLine(" WHERE     (tblTipoRefere.strTipoRefere = '" + ReferenciaPaginas + "') ");
                    Consulta.AppendLine(" AND (tblRefereControls.strIdioma = 'es') ");
                    Consulta.AppendLine(" AND (tblTipoRefere.strIdioma = 'es') ");
                    Consulta.AppendLine(" AND (tblTipoRefere_1.strIdioma = 'es') ");
                    Consulta.AppendLine(" AND (tblRefereControls_1.strIdioma = 'es') ");
                    Consulta.AppendLine(" AND (tblIdioma.strIdioma = '" + Idioma + "') ");
                    Consulta.AppendLine(" AND (tblRefereControls.strRefere = '" + Forma + "') ");
                    Consulta.AppendLine(" AND (tblIdioma.intAplicacion = " + Aplicacion + ")  ");
                    Consulta.AppendLine(" AND (tblTipoRefere_1.strTipoRefere = '" + Control + "')  ");
                    Consulta.AppendLine(" AND (tblRefereControls_1.intOrden = " + sOrden + ") ");
                    Consulta.AppendLine(" ORDER BY tblIdioma.intTipo ");
                    Consulta.AppendLine("   ");
                    Consulta.AppendLine(" SELECT     tblRefereControls_1.strValor AS strControlValue, tblIdioma.strObject AS strEtiqueta ");
                    Consulta.AppendLine(" FROM         tblTipoRefere AS tblTipoRefere_1 INNER JOIN ");
                    Consulta.AppendLine(" tblRefereControls AS tblRefereControls_1 ON tblTipoRefere_1.intidTipoRefere = tblRefereControls_1.intidTipoRefere INNER JOIN ");
                    Consulta.AppendLine(" tblTipoRefere INNER JOIN ");
                    Consulta.AppendLine(" tblRefereControls ON tblTipoRefere.intidTipoRefere = tblRefereControls.intidTipoRefere INNER JOIN ");
                    Consulta.AppendLine(" tblRelaRefereControls ON tblRefereControls.intidRefere = tblRelaRefereControls.intidRefereControl INNER JOIN ");
                    Consulta.AppendLine(" tblIdioma ON tblRelaRefereControls.intidRefereAsociado = tblIdioma.intForma AND  ");
                    Consulta.AppendLine(" tblRefereControls.intAplicacion = tblIdioma.intAplicacion ON tblRefereControls_1.intidRefere = tblIdioma.intEtiqueta AND  ");
                    Consulta.AppendLine(" tblRefereControls_1.intAplicacion = tblIdioma.intAplicacion ");
                    Consulta.AppendLine(" WHERE     (tblTipoRefere.strTipoRefere = '" + ReferenciaPaginas + "') ");
                    Consulta.AppendLine(" AND (tblRefereControls.strIdioma = 'es') ");
                    Consulta.AppendLine(" AND (tblTipoRefere.strIdioma = 'es') ");
                    Consulta.AppendLine(" AND (tblTipoRefere_1.strIdioma = 'es') ");
                    Consulta.AppendLine(" AND (tblRefereControls_1.strIdioma = 'es') ");
                    Consulta.AppendLine(" AND (tblIdioma.strIdioma = '" + Idioma + "') ");
                    Consulta.AppendLine(" AND (tblRefereControls.strRefere = '" + Forma + "') ");
                    Consulta.AppendLine(" AND (tblIdioma.intAplicacion = " + Aplicacion + ")  ");
                    Consulta.AppendLine(" AND (tblTipoRefere_1.strTipoRefere = '" + Control + "')  ");
                    Consulta.AppendLine(" AND (tblRefereControls_1.intOrden = " + sOrden + ") ");
                    Consulta.AppendLine(" GROUP BY tblRefereControls_1.strValor, tblIdioma.strObject   ");

                    dSql.Conexion = Conexion;
                    dstDatos      = dSql.Select(Consulta.ToString());

                    cSerializer.DatasetXMLGen(dstDatos, strFile);
                }
            }
            catch
            {
            }
            return(dstDatos);
        }