////Para mantener la sesión activa //[WebMethod(EnableSession = true)] //public static void MantenerSesion() //{ //} protected void Page_Load(object sender, EventArgs e) { //En caso de no tener un Pedido vigente redirige a home var Current = HttpContext.Current; if (Current.Session["Productos"] == null) { Response.Redirect("/Areas/Public/Forms/Home.aspx"); } logueado = (UsuarioEntidad)Current.Session["Usuario"]; idioma = new LenguajeEntidad(); if (!IsPostBack) { idioma = (LenguajeEntidad)Session["Idioma"]; if (idioma == null) { idioma = new LenguajeEntidad(); idioma.DescripcionLenguaje = "es"; Session["Idioma"] = idioma; } cotizacion = new MonedaEmpresaEntidad(); cotizacion = (MonedaEmpresaEntidad)Session["Cotizacion"]; Session.Add("cotizacionAnterior", ""); } else { cotizacion.IdMoneda = Convert.ToInt16(Master.obtenerValorDropDown()); Session["Cotizacion"] = cotizacion; idioma.DescripcionLenguaje = Master.obtenerIdiomaCombo(); Session["Idioma"] = idioma; } if (cotizacion != null) { moneda = _coreMoneda.selectMoneda(cotizacion.IdMoneda); } DropDownList lblIdioma = FindControlFromMaster <DropDownList>("ddlLanguages"); if (lblIdioma != null) { lblIdioma.SelectedValue = idioma.DescripcionLenguaje; } DropDownList lblStatus = FindControlFromMaster <DropDownList>("MonedaDRW"); if (lblStatus != null) { if (cotizacion != null) { lblStatus.SelectedValue = cotizacion.IdMoneda.ToString(); } } if (logueado != null) { var dirs = _usuarioManager.FindDireccionesPredeterminadas(logueado); direccionEnvio = dirs .Where(x => x.IdTipoDireccion == (int)TipoDireccionEntidad.Options.Envio) .FirstOrDefault(); direccionFacturacion = dirs .Where(x => x.IdTipoDireccion == (int)TipoDireccionEntidad.Options.Facturacion) .FirstOrDefault(); telefonoContacto = _usuarioManager.FindTelefonoContacto(logueado.NombreUsuario); } }