Exemplo n.º 1
0
        public string Error404(string sTargetURL)
        {
            lCMS             cCMS = new lCMS();
            List <eArticulo> lArt = cCMS.ArticuloPlantilla_listarWeb(94, 10, 1, 0);

            if (lArt.Count > 0)
            {
                sTargetURL = "Content/Index.aspx?aID=" + lArt[0].IdArticulo.ToString();
                ClientScriptHelper.Redirect301(this.Context, ClientScriptHelper.getEnlace_Articulo(lArt[0]));
            }
            return(sTargetURL);
        }
        public static List <eTerminoIdioma> AddGrupo(List <eTerminoIdioma> lTerminoIdioma, short IDTerminoGrupo, short IDIdioma)
        {
            lCMS cCMS = new lCMS();
            List <eTerminoIdioma> lTIdioma = lCMS.TerminoIdioma_listarWeb(IDTerminoGrupo, IDIdioma);

            if (lTIdioma != null && lTIdioma.Count > 0)
            {
                foreach (eTerminoIdioma oTIdioma in lTIdioma)
                {
                    lTerminoIdioma.Add(oTIdioma);
                }
            }

            return(lTerminoIdioma);
        }
Exemplo n.º 3
0
        void bindListado()
        {
            lCMS cCMS = new lCMS();

            List <eOrden> lOrden = new List <eOrden>();

            lOrden = cCMS.Orden_buscar(0, "", "", "", DateTime.Now, DateTime.Now, "");

            foreach (var itemOrden in lOrden)
            {
                ePago oPago = new ePago();

                List <eOrden> lOrdenComplete = new List <eOrden>();

                lOrdenComplete = cCMS.Orden_buscar_codigo(itemOrden.CodigoOrden);

                eOrden oOrden = lOrdenComplete[0];

                if (oOrden.EstadoPago == "DENEGADO" || oOrden.EstadoPago == "AUTORIZADO" || oOrden.EstadoPago == "TRUNCA")
                {
                    try
                    {
                        WSConsulTicket.WSConsultaEticketSoapClient soapClient = new WSConsulTicket.WSConsultaEticketSoapClient();
                        string xmlIn = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> " +
                                       "<consulta_eticket>" +
                                       "<parametros>" +
                                       "<parametro id=\"CODTIENDA\">" + oOrden.ePago.CodTiendaPago + "</parametro>" +
                                       "<parametro id=\"ETICKET\">" + oOrden.Eticket + "</parametro>" +
                                       "</parametros>" +
                                       "</consulta_eticket>";
                        string      xmlConsultaEticket = soapClient.ConsultaEticket(xmlIn);
                        GridView    grvListado         = new GridView();
                        string      myXMLfile          = xmlConsultaEticket.ToString();
                        XmlDocument xm = new XmlDocument();
                        xm.LoadXml(myXMLfile);
                        XmlNodeReader reader = new XmlNodeReader(xm);
                        while (reader.Read())
                        {
                            XmlNode xmlNode1 = xm.ReadNode(reader);
                            if (xmlNode1.InnerText != "version=\"1.0\" encoding=\"UTF-8\"")
                            {
                                XmlNodeList xmlNodeLi    = xmlNode1.ChildNodes;
                                XmlElement  xmlNodeCampo = xmlNode1["operacion"];
                                if (xmlNodeCampo != null)
                                {
                                    XmlNodeList   xmlNodeListCampo = xmlNodeCampo.ChildNodes;
                                    List <string> listaCampo       = new List <string>();
                                    int           contCampo        = 0;
                                    foreach (XmlElement item in xmlNodeListCampo)
                                    {
                                        listaCampo.Add(item.InnerText);
                                        //Response.Write("Num. campo: "+contCampo.ToString()+" campo: " + item.Attributes[0].Value.ToString() + " valor: " + item.InnerText + "<br>");
                                        contCampo = contCampo + 1;
                                    }
                                    //Response.Write(" Tot campo --> " + contCampo.ToString());

                                    oPago.RespuestaPago  = listaCampo[0].ToString();
                                    oPago.EstadoPago     = listaCampo[1].ToString();
                                    oPago.CodTiendaPago  = listaCampo[2].ToString();
                                    oPago.NumOtPago      = listaCampo[3].ToString();
                                    oPago.CodigoAccion   = listaCampo[4].ToString();
                                    oPago.NombrePago     = listaCampo[6].ToString();
                                    oPago.FechaYHoraPago = Convert.ToDateTime(listaCampo[15].ToString());
                                    oPago.ETicketPago    = oOrden.Eticket;
                                    oPago.NumTarjetaPan  = listaCampo[5].ToString();
                                    oPago.DescEci        = listaCampo[10].ToString();
                                    oPago.ImpTotal       = listaCampo[14].ToString();


                                    break;
                                }
                                break;
                            }
                        }


                        //actualizamos orden
                        if (oOrden.EstadoPago == "TRUNCA" || oOrden.EstadoPago == "DENEGADO")
                        {
                            if (oPago.EstadoPago != null)
                            {
                                if (oPago.EstadoPago != oOrden.EstadoPago)
                                {
                                    cCMS.PagoEstado_Update(oOrden.CodigoOrden, oPago.EstadoPago);

                                    if (oPago.EstadoPago != "DENEGADO")
                                    {
                                        EnviarCorreo(oOrden.CodigoOrden, oOrden.eUsuario.Codigo_Confirmacion);
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                }
            }
        }
Exemplo n.º 4
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);
            }
        }