コード例 #1
0
        private void GetParameters()
        {
            if (Session["oParamentro"] != null)
            {
                oParamentro = (eArticuloParametro)Session["oParamentro"];
            }

            IdArticulo      = (Request["IdArticulo"] != null) ? Convert.ToInt32(Request["IdArticulo"]) : 0;
            IdArticuloPadre = (Request["IdArticuloPadre"] != null) ? Convert.ToInt32(Request["IdArticuloPadre"]) : 0;
            IdEsquema       = (Request["IdEsquema"] != null) ? Convert.ToInt32(Request["IdEsquema"]) : 0;
            if (Request["IdModulo"] != null)
            {
                oParamentro.IdModulo = Convert.ToInt32(Request["IdModulo"]);
            }
            if (Request["IdMenuWeb"] != null)
            {
                oParamentro.IdMenuWeb = Convert.ToInt32(Request["IdMenuWeb"]);
            }
            if (Request["email_usu"] != null)
            {
                oUsuarios = cCMS.UsuariosWeb_item_email(Request["email_usu"].ToString());
            }
            if (Request["p"] != null)
            {
                PageIndex = Convert.ToInt32(Request["p"]);
            }

            if (Request["id_producto"] != null)
            {
                id_producto = Convert.ToInt32(Request["id_producto"]);
            }
            if (IdArticuloPadre > 0)
            {
                eArticulo oArticuloPadre = (IdArticuloPadre > 0) ? cCMS.Articulo_item(IdArticuloPadre) : null;
                if (oArticuloPadre != null)
                {
                    oParamentro.IdMenuWeb  = oArticuloPadre.IdMenuWeb;
                    oParamentro.IdIdioma   = oArticuloPadre.IdIdioma;
                    oParamentro.IdMinisite = oArticuloPadre.IdMinisite;
                    oParamentro.IdEsquema  = IdEsquema;
                }
            }

            if (IdArticulo > 0)
            {
                oArticulo = (IdArticulo > 0) ? cCMS.Articulo_item(IdArticulo) : null;
                if (oArticulo != null)
                {
                    IdArticuloPadre        = oArticulo.IdArticuloPadre;
                    IdEsquema              = oArticulo.IdEsquema;
                    oParamentro.IdMenuWeb  = oArticulo.IdMenuWeb;
                    oParamentro.IdIdioma   = oArticulo.IdIdioma;
                    oParamentro.IdMinisite = oArticulo.IdMinisite;
                    oParamentro.IdEsquema  = oArticulo.IdEsquema;
                }
            }

            Session["oParamentro"] = oParamentro;
        }
コード例 #2
0
        private void GetParameters()
        {
            if (Session["oParamentro"] != null)
            {
                oParamentro = (eArticuloParametro)Session["oParamentro"];
            }

            IdArticuloPadre = (Request["IdArticuloPadre"] != null) ? Convert.ToInt32(Request["IdArticuloPadre"]) : 0;
            if (Request["IdModulo"] != null)
            {
                oParamentro.IdModulo = Convert.ToInt32(Request["IdModulo"]);
            }
            if (Request["IdModulo"] != null)
            {
                IdModulo = Convert.ToInt32(Request["IdModulo"]);
            }
            if (Request["IdMenuWeb"] != null)
            {
                oParamentro.IdMenuWeb = Convert.ToInt32(Request["IdMenuWeb"]);
            }
            if (Request["IdMenuWeb"] != null)
            {
                IdMenuWeb = Convert.ToInt32(Request["IdMenuWeb"]);
            }
            if (Request["p"] != null)
            {
                PageIndex = Convert.ToInt32(Request["p"]);
            }

            oArticuloPadre = (IdArticuloPadre > 0) ? cCMS.Articulo_item(IdArticuloPadre) : null;
            if (oArticuloPadre != null)
            {
                oParamentro.IdMenuWeb  = oArticuloPadre.IdMenuWeb;
                oParamentro.IdIdioma   = oArticuloPadre.IdIdioma;
                oParamentro.IdMinisite = oArticuloPadre.IdMinisite;
                IdEsquema = oArticuloPadre.IdEsquema;
            }

            lblError.Text = "";
            if (Request["nErr"] != null)
            {
                lblError.Text = "Se ha producido un error en la aplicación: ";
                if (Request["nErr"].ToString() == "404" && Request["IdEsquema"] != null)
                {
                    lblError.Text += "No se puede localizar el esquema [" + Request["IdEsquema"].ToString() + "]";
                }
            }

            oMenuWeb = cCMS.MenuWeb_item(oParamentro.IdMenuWeb);
            if (oMenuWeb == null)
            {
                lblError.Text = "Se ha producido un error en la aplicación: No se encuentra la seccion web [" + oParamentro.IdMenuWeb.ToString() + "]";
                return;
            }
        }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request["lID"] != null && Request["oPd"] != null)
     {
         lista  = Request["lID"];
         oPadre = cCMS.Articulo_item(Convert.ToInt32(Request["oPd"]));
         FillContent2();
     }
     else if (Request["aID"] != null)
     {
         oPagina = cCMS.Articulo_item(Convert.ToInt32(Request["aID"]));
         FillContent();
     }
 }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ScriptManager.RegisterClientScriptBlock(this, GetType(), "init_Layer", "var URL_ROOT='" + ClientScriptHelper.getURLRoot() + "';", true);
     litScriptHeader.Text = litScriptHeader.Text.Replace("{URL_BASE}", ClientScriptHelper.getURLHome());
     if (Request["aID"] != null)
     {
         oPagina = cCMS.Articulo_item(Convert.ToInt32(Request["aID"]));
         FillContent();
     }
 }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["aID"] != null)
            {
                oPagina = cCMS.Articulo_item(Convert.ToInt32(Request["aID"]));

                if (Request["cod"] != null)
                {
                    codigo = Convert.ToInt32(Request["cod"]);
                }
                FillContent();
            }
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string domain   = System.Configuration.ConfigurationManager.AppSettings["Domain"].ToString();
            string root     = System.Configuration.ConfigurationManager.AppSettings["WebRoot"].ToString();
            short  idiomaID = (Request["iID"] != null) ? Convert.ToByte(Request["iID"]) : Convert.ToByte(1);

            site_url = "http://" + domain + root;

            //Page.Response.ContentType = "text/xml";
            //Page.Response.Charset = "UTF-8";

            sbSiteMap.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
            sbSiteMap.Append("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n\n");

            List <eArticulo> lArticulo = cCMS.ArticuloEnlaceSiteMap_listar(idiomaID);

            foreach (eArticulo oArticulo in lArticulo)
            {
                eArticulo oArt = cCMS.Articulo_item(oArticulo.IdArticulo);
                sbSiteMap.Append("<url>");
                sbSiteMap.Append("<loc>" + site_url + oArt.URLEstatica + "</loc>\n");
                // sbSiteMap.Append("<lastmod>" + oArt.FechaActualizada.ToString("yyyy-mm-dd hh:mm:ss")+ "</lastmod>\n");
                sbSiteMap.Append("</url>\n\n");

                List <eProducto> lProducto = cCMS.Producto_listarCategoria(oArticulo.IdArticulo);
                foreach (eProducto oProducto in lProducto)
                {
                    sbSiteMap.Append("<url>");
                    sbSiteMap.Append("<loc>" + site_url + oArt.URLEstatica + "?p=" + oProducto.URLEstatica + "</loc>\n");
                    // sbSiteMap.Append("<lastmod>" + oArt.FechaActualizada.ToString("yyyy-mm-dd hh:mm:ss") + "</lastmod>\n");
                    sbSiteMap.Append("</url>\n\n");
                }
            }

            sbSiteMap.Append("</urlset>\n");

            Response.Clear();
            Response.Buffer          = true;
            Response.ContentType     = "text/xml";
            Response.Charset         = "UTF-8";
            Response.ContentEncoding = System.Text.Encoding.Default;
            Response.Write(sbSiteMap);
            Response.End();
        }
コード例 #7
0
        public static String getEnlace_Articulo(eArticulo oArticulo)
        {
            string Url = getURLRoot();

            if (oArticulo.TipoEnlace > 0)
            {
                switch (oArticulo.TipoEnlace)
                {
                case 1:
                    if (oArticulo.IdArticuloEnlace != 0)
                    {
                        eArticulo oItem = cCMS.Articulo_item(oArticulo.IdArticuloEnlace);
                        Url += (oItem != null) ? oItem.URLEstatica: "";
                    }
                    break;

                case 2:
                    if (ParametroHelper.GetParametro_Valor(oArticulo.Parametro, "Visualizar") == "2")
                    {
                        string width  = ParametroHelper.GetParametro_Valor(oArticulo.Parametro, "Ancho de ventana");
                        string height = ParametroHelper.GetParametro_Valor(oArticulo.Parametro, "Alto de ventana");
                        Url = "javascript:PopupFrame('" + oArticulo.URLEnlace + "', '" + width + "', '" + height + "');";
                    }
                    else
                    {
                        Url = Util.Cadena.ParseLink(oArticulo.URLEnlace);
                    }
                    break;
                    //case 3:
                    //    UrlParams = (oArticulo.IdMenuWebEnlace == 0) ? "?wsID=" + IdWebSite : "?mwID=" + oArticulo.IdMenuWebEnlace.ToString();
                    //    break;
                }
            }
            else
            {
                Url += oArticulo.URLEstatica;
            }

            return(Url);
        }
コード例 #8
0
        private void Ubicacion()
        {
            if (idUbicacion == 0)
            {
                return;
            }

            eArticulo        eUbicacion = cCMS.Articulo_item(idUbicacion);
            List <eArticulo> lComplejos = cCMS.Articulo_listarWeb(eUbicacion.IdArticulo, eUbicacion.IdMenuWeb, eUbicacion.IdIdioma, eUbicacion.IdMinisite);

            TerminoIdioma_AddGrupo(2, eUbicacion.IdIdioma);

            combo += "<option value = \"-1\" >" + TerminoIdioma_GetValor("complejo") + "</option>";
            foreach (var oCombo in lComplejos)
            {
                combo += "<option value = " + oCombo.IdArticulo + ">";
                combo += oCombo.Titulo;
                combo += "</option >\n";
            }

            litUbicacion.Text = combo;
        }
コード例 #9
0
        private void CheckURLMapping()
        {
            lCMS   cCMS = new lCMS();
            string root = ClientScriptHelper.getURLRoot();

            // If the requested file exists
            HttpContext current = HttpContext.Current;

            current.Trace.Warn("ApplicationInstance", Context.ApplicationInstance.GetType().FullName);
            current.Trace.Warn("Request.Url", current.Request.Path.ToString());
            current.Trace.Warn("Request.RequestType", current.Request.RequestType);

            if (current.Request.RequestType == "" || !current.Request.PhysicalPath.EndsWith("\\404.aspx") && File.Exists(current.Request.PhysicalPath))
            {
                // Do nothing here, just serve the file
                current.Trace.Warn("File.Exists", "No hace nada");
            }
            // If the file does not exist then
            else
            {
                // Get the URL requested by the user
                string sRequestUrl = current.Request.Url.ToString().ToLower();
                if (sRequestUrl.Contains(".axd") || sRequestUrl.EndsWith(".gif") || sRequestUrl.EndsWith(".jpg") || sRequestUrl.EndsWith(".swf") || sRequestUrl.EndsWith(".bmp") || sRequestUrl.EndsWith(".ico") || sRequestUrl.EndsWith(".js"))
                {
                    return;
                }

                string[] aRequest   = current.Request.Url.ToString().Split(';');
                string   urlRequest = "";

                string sParameters   = "";
                string sRequestedURL = "";

                if (aRequest.Length > 1)
                {
                    urlRequest = aRequest[1].Substring(aRequest[1].IndexOf('/', 10));
                }
                else
                {
                    //sRequestedURL = Request.Path.Substring(1);
                    sRequestedURL = Request.Path;
                    sParameters   = current.Request.Url.Query;
                    if (sParameters != "")
                    {
                        sParameters = sParameters.Substring(1);
                    }
                }

                //if (sRequestedURL.EndsWith("/")) sRequestedURL = sRequestedURL.Substring(0, sRequestedURL.Length - 1);
                if (sRequestedURL.StartsWith(root))
                {
                    sRequestedURL = sRequestedURL.Substring(root.Length);
                }
                //sRequestedURL = urlRequest.Substring(1);

                // You can retrieve the ID of the content from database that is
                // relevant to this requested URL (as per your business logic)

                current.Trace.Warn("sRequestedURL", sRequestedURL);
                current.Trace.Warn("sParameters", sParameters);
                string sTargetURL = "Content/Index.aspx"; //Change to Page Not Found: ERROR 404


                string sURLnew = URLRedirect.Get301(sRequestedURL);
                if (sURLnew != sRequestedURL)
                {
                    ClientScriptHelper.Redirect301(this.Context, root + sURLnew);
                    sRequestedURL = sURLnew;
                }
                string Registro = (Request["registro"] != null) ? (Request["registro"]).ToString() : "";
                if (Registro == "true")
                {
                    sRequestedURL = "registro";
                }
                switch (sRequestedURL)
                {
                case "": sTargetURL = "Content/Index.aspx"; break;

                //case "productos/producto_item": sTargetURL = "Content/ProductoItem.aspx?idproducto=" + IdProducto; break;
                case "producto_wishlist": sTargetURL = "Content/ProductoWishlist.aspx"; break;

                case "producto_compras": sTargetURL = "Content/ProductoCompras.aspx"; break;

                case "registro": sTargetURL = "Content/Registro.aspx"; break;

                case "home": sTargetURL = "Content/Index.aspx"; break;

                case "admin": sTargetURL = "Admin/Index/login.aspx"; break;

                case "despacho": sTargetURL = "Content/Despacho.aspx"; break;

                case "verificar": sTargetURL = "Content/Verificar.aspx"; break;

                case "cuenta": sTargetURL = "Content/Cuenta.aspx"; break;

                case "cuenta_detalle": sTargetURL = "Content/CuentaDetalle.aspx"; break;

                case "direccion_despacho": sTargetURL = "Content/DireccionDespacho.aspx"; break;

                case "historial_pedidos": sTargetURL = "Content/Historial_Pedidos.aspx"; break;

                case "confirmacion_visanet": sTargetURL = "Content/Gracias-compra.aspx"; break;

                case "direccion": sTargetURL = "Content/Direccion.aspx"; break;

                case "direccionfancybox": sTargetURL = "Content/DireccionFancybox.aspx"; break;

                case "restablecer-contrasena": sTargetURL = "Content/PagRestablecer-Contrasena.aspx"; break;

                case "libro-reclamaciones": sTargetURL = "Content/Libro_Reclamaciones.aspx"; break;

                case "libro-reclamaciones-detalle": sTargetURL = "Content/Libro_Reclamaciones_Detalle.aspx"; break;

                case "libro-reclamaciones-gracias": sTargetURL = "Content/Libro_Reclamaciones_Gracias.aspx"; break;

                case "job": sTargetURL = "Content/job.aspx"; break;

                default:
                    if (sRequestedURL.Contains("/"))
                    {
                        eArticulo oArticulo = new eArticulo();

                        int IDPagina = cCMS.Articulo_item(sRequestedURL);
                        if (IDPagina > 0)
                        {
                            sTargetURL = "Content/Index.aspx?aID=" + IDPagina.ToString();
                        }
                        else
                        {
                            sTargetURL = Error404(sTargetURL);
                        }
                    }
                    else
                    {
                        eMenuWebDetalle eMenuWebDetalle = new eMenuWebDetalle();

                        int IDSeccion = cCMS.MenuWebDetalle_item(sRequestedURL);
                        if (IDSeccion > 0)
                        {
                            sTargetURL = "Content/Index.aspx?mwID=" + IDSeccion.ToString();
                        }
                        else
                        {
                            sTargetURL = Error404(sTargetURL);
                        }
                    }
                    break;
                }

                if (sParameters != "")
                {
                    sTargetURL += (sTargetURL.Contains("?") ? "&" : "?") + sParameters;
                }

                current.Trace.Warn("sTargetURL", sTargetURL);

                // Owing to RewritePath, the user will see requested URL in the address bar
                // The second argument should be false, to keep your references
                // to images, css files
                Context.RewritePath(root + sTargetURL, false);
            }
        }
コード例 #10
0
        //private void SetMinisite()
        //{
        //    if (Request["wsID"] != null) IdMinisite = Convert.ToInt16(Request["wsID"]);
        //    //else if (Session["IdMinisite"] != null) IdMinisite = Convert.ToInt16(Session["IdMinisite"]); //Fix when back to home

        //    if (Request["lgID"] != null) IdIdioma = Convert.ToInt16(Request["lgID"]);
        //    else if (Session["IdIdioma"] != null) IdIdioma = Convert.ToInt16(Session["IdIdioma"]);

        //    Session["IdMinisite"] = IdMinisite;
        //    Session["IdIdioma"] = IdIdioma;
        //    IdMenuWeb = (IdMinisite != 0) ? 2 : 1;
        //}

        //private void LoadUserInfo()
        //{
        //    if (Session["cuenta_usuario"] != null)
        //    {
        //        oUsuarioWeb = (eUsuariosWeb)Session["cuenta_usuario"];
        //    }
        //}

        private void LoadRequests()
        {
            eMenuWebDetalle oMenuWebDetalle = null;

            if (Request["aID"] == null)
            {
                //SetMinisite();
                IdMenuWeb   = (Request["mwID"] != null) ? Convert.ToInt32(Request["mwID"]) : 0;
                oSeccionWeb = cCMS.MenuWebDetalle_item(IdMenuWeb, IdIdioma, IdMinisite);
                Trace.Warn(">IdMenuWeb, IdIdioma, IdMinisite", IdMenuWeb.ToString() + ", " + IdIdioma.ToString() + ", " + IdMinisite.ToString());

                if (oSeccionWeb == null)
                {
                    IdMenuWeb   = (IdMinisite != 0) ? 2 : 1; //Cargar Home Page
                    oSeccionWeb = cCMS.MenuWebDetalle_item(IdMenuWeb, IdIdioma, IdMinisite);
                    Trace.Warn("oSeccionWeb == null:: IdMenuWeb, IdIdioma, IdMinisite", IdMenuWeb.ToString() + ", " + IdIdioma.ToString() + ", " + IdMinisite.ToString());
                }
                else
                {
                    if (!oSeccionWeb.VerContenido)
                    {
                        if ((oPagina = ClientScriptHelper.getFirstArticulo(oSeccionWeb)) != null)
                        {
                            Response.Redirect("~/Content/Index.aspx?aID=" + oPagina.IdArticulo.ToString());
                        }
                    }
                    else
                    {
                        SetPage_TagTitle(oSeccionWeb.Titulo);
                        return;
                    }
                }

                SetPage_TagTitle(oPagina);

                return;
            }
            else
            {
                oPagina = ClientScriptHelper.ValidarPagina(cCMS.Articulo_item(Convert.ToInt32(Request["aID"])), this.Context);

                if (oPagina != null)
                {
                    IdArticulo = oPagina.IdArticulo;
                    IdMenuWeb  = oPagina.IdMenuWeb;
                    IdMinisite = oPagina.IdMinisite;
                    IdIdioma   = oPagina.IdIdioma;

                    if (oMenuWebDetalle == null)
                    {
                        oSeccionWeb = cCMS.MenuWebDetalle_item(oPagina.IdMenuWeb, oPagina.IdIdioma, oPagina.IdMinisite);
                    }

                    SetPage_TagTitle(oPagina);
                }
                else
                {
                    ClientScriptHelper.ErrorHandler(404, this.Context);
                }
            }

            return;
        }