/// <summary>
        /// Obtener Información de la Aplicación de la Tabla [appLucky]
        /// </summary>
        /// <param name="sCountry">Codigo del Pais</param>
        /// <param name="smodul">Código del Módulo</param>
        /// <returns></returns>
        public EAplicacionWeb obtenerAplicacion(string sCountry, string smodul)
        {
            EAplicacionWeb oeAplicacionWeb = new EAplicacionWeb();

            try{
                EAplicacion oeAplicacion = odAplicacion.obtenerPK(sCountry, smodul);

                if (odAplicacion.getMessage().Equals(""))
                {
                    oeAplicacionWeb.NombreWeb = oeAplicacion.nameapp;
                    oeAplicacionWeb.verapp    = oeAplicacion.verapp;
                    oeAplicacionWeb.abrapp    = oeAplicacionWeb.abrapp;
                    oeAplicacionWeb.HomePage  = oeAplicacion.appurl;
                    log.Info("[AplicacionWeb][obtenerAplicacion_Passed]:");
                    //odAplicacion = null;
                }
                else
                {
                    message = odAplicacion.getMessage();
                    log.Debug("[AplicacionWeb][obtenerAplicacion_Failed] :" + message);
                }
            }
            catch (Exception ex) {
                message = "Ocurrio un Error: " + ex.ToString().Substring(0, 100) + "...";
                log.Error("[AplicacionWeb][obtenerAplicacion_Failed] : ", ex);
            }

            return(oeAplicacionWeb);
        }
示例#2
0
        /// <summary>
        /// Retorna la Pagina a la que debe ser redireccionado el usuario despues de loguearse.
        /// </summary>
        private String fncGetDataAplicationWeb()
        {
            String pagina = "";

            EAplicacionWeb oeAplicacionWeb = new EAplicacionWeb();
            AplicacionWeb  oAplicacionWeb  = new AplicacionWeb();

            try
            {
                oeAplicacionWeb = oAplicacionWeb.obtenerAplicacion(this.Session["scountry"].ToString(), this.Session["smodul"].ToString());
                // Verifica que no haya Errores
                if (oAplicacionWeb.getMessage().Equals(""))
                {
                    this.Session["oeAplicacionWeb"] = oeAplicacionWeb;
                    this.Session["cod_applucky"]    = oeAplicacionWeb.codapplucky;
                    this.Session["abr_app"]         = oeAplicacionWeb.abrapp;
                    this.Session["app_url"]         = oeAplicacionWeb.appurl;

                    pagina = oeAplicacionWeb.HomePage;

                    //oeUsuarioAcceso = null;
                    //oeAplicacionWeb = null;
                    //oAplicacionWeb = null;
                }
                else
                {
                    messages = "Error: " + oAplicacionWeb.getMessage();
                }
            }
            catch (Exception ex) {
                messages = "Error: " + ex.Message.ToString();
            }

            return(pagina);
        }
示例#3
0
        /// <summary>
        /// Evento Go Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void GO_Click(object sender, EventArgs e)
        {
            /// Si los Control cmbselModulos y cmbcliente son diferente de 0
            if (cmbselModulos.Text != "0" && cmbcliente.Text != "0")
            {
                // Instanciando el BusinessLogic para obtener la información del App
                AplicacionWeb oAplicacionWeb = new AplicacionWeb();

                // Obteniendo información de la Aplicación
                EAplicacionWeb oeAplicacionWeb =
                    oAplicacionWeb.obtenerAplicacion(
                        this.Session["scountry"].ToString().Trim(),
                        cmbselModulos.SelectedItem.Value);

                // Verificar que no haya Errores
                if (oAplicacionWeb.getMessage().Equals(""))
                {
                    this.Session["oeAplicacionWeb"] = oeAplicacionWeb;
                    this.Session["cod_applucky"]    = oeAplicacionWeb.codapplucky;
                    this.Session["abr_app"]         = oeAplicacionWeb.abrapp;
                    this.Session["app_url"]         = oeAplicacionWeb.appurl;
                    this.Session["companyid"]       = cmbcliente.SelectedItem.Value;
                    DataTable dturllogo =
                        oCoon.ejecutarDataTable("UP_WEBXPLORA_GEN_LOGOCLIENT",
                                                Convert.ToInt32(cmbcliente.Text));
                    this.Session["fotocomany"] = dturllogo.Rows[0][0].ToString().Trim();
                    this.Session["sNombre"]    = cmbcliente.SelectedItem.Text;
                    string sPagina = oeAplicacionWeb.HomePage;
                    oeAplicacionWeb = null;
                    oAplicacionWeb  = null;
                    this.Response.Redirect("~/" + sPagina, true);
                    //if (this.Session["scountry"].ToString() == "589" && cmbselModulos.SelectedItem.Value == "MOVIL")
                    //{
                    //Response.Redirect("http://localhost:61260/?data=" + Lucky.CFG.Util.Encriptacion.QueryStringEncode(this.Session["sUser"].ToString() + "/" + this.Session["companyid"].ToString() + "/" + this.Session["sNombre"].ToString(), "usr"));

                    //    //Response.Redirect("http://localhost:61260 <http://localhost:61260/> ", true);
                    //}
                    //else
                    //{
                    //    this.Response.Redirect("~/" + sPagina, true);
                    //}
                }
                else
                {
                    Alertas.CssClass  = "MensajesSupervisor";
                    LblAlert.Text     = "Error:";
                    LblFaltantes.Text = "Sr. Usuario, ocurrió un error inesperado: "
                                        + oAplicacionWeb.getMessage();
                    ModalPopupAlertas.Show();
                    return;
                }
            }
        }
示例#4
0
        protected void GO_Click(object sender, EventArgs e)
        {
            if (cmbselModulos.Text != "0" && cmbcliente.Text != "0")
            {
                AplicacionWeb oAplicacionWeb = new AplicacionWeb();

                EAplicacionWeb oeAplicacionWeb = oAplicacionWeb.obtenerAplicacion(this.Session["scountry"].ToString().Trim(), cmbselModulos.SelectedItem.Value);

                this.Session["oeAplicacionWeb"] = oeAplicacionWeb;
                this.Session["cod_applucky"]    = oeAplicacionWeb.codapplucky;
                this.Session["abr_app"]         = oeAplicacionWeb.abrapp;
                this.Session["app_url"]         = oeAplicacionWeb.appurl;
                this.Session["companyid"]       = cmbcliente.SelectedItem.Value;
                DataTable dturllogo = oCoon.ejecutarDataTable("UP_WEBXPLORA_GEN_LOGOCLIENT", Convert.ToInt32(cmbcliente.Text));

                this.Session["fotocomany"] = dturllogo.Rows[0][0].ToString().Trim();
                this.Session["sNombre"]    = cmbcliente.SelectedItem.Text;
                string sPagina = oeAplicacionWeb.HomePage;
                oeAplicacionWeb = null;
                oAplicacionWeb  = null;
                this.Response.Redirect("~/" + sPagina, true);
            }
        }
示例#5
0
        protected void btningreso_Click(object sender, EventArgs e)
        {
            string sPagina = "~/";

            try
            {
                UpdateProg1.Visible    = true;
                PProgresso.Style.Value = "Display:block;";

                DateTime fFecha = Convert.ToDateTime(Session["fFecha"]);


                sUser = txtuser.Text.ToLower();

                sPassw = txtpassw.Text;
                //Se deshabilita la verificacion de sesion
                //DataTable dtsesionuser = null;
                //dtsesionuser = ProcesoAdmin.Get_User_Sesion_Conteo(sUser);

                //if (dtsesionuser.Rows.Count > 0)
                //{
                //    this.Session["encabemensa"] = "Error de Autenticacion";
                //    this.Session["mensaje"] = "El Usuario" + " " + sUser + " " + "ya tiene" + "<br>" + "una sesion SIGE Activa";
                //    this.Session["cssclass"] = "MensajesSupervisor";
                //    Mensajes_Usuario();
                //    return;


                //}


                //ProcesoAdmin.Get_Obtener_User_Sesion(sUser);

                //Guardar las variables de sesión

                this.Session["sUser"]  = sUser;
                this.Session["sPassw"] = sPassw;

                this.Session["fFecha"] = fFecha;
                //Session["Service"] = 254;
                //Session["Canal"]="1000";


                EUsuario oeUsuario = oUsuario.obtener(sUser, sPassw);


                sCoutry                    = oeUsuario.codCountry;
                sDepartament               = oeUsuario.coddepartam;
                scity                      = oeUsuario.codcity;
                smail                      = oeUsuario.PersonEmail;
                this.Session["smail"]      = smail;
                this.Session["companyid"]  = oeUsuario.companyid;
                this.Session["fotocomany"] = oeUsuario.fotocompany;

                sNombre = oeUsuario.companyName;



                this.Session["sNombre"] = sNombre;

                snameuser = oeUsuario.PersonFirtsname + " " + oeUsuario.PersonSurname;
                this.Session["nameuser"] = snameuser;

                smodul = oeUsuario.Moduloid;
                this.Session["scountry"] = sCoutry;
                this.Session["scity"]    = scity;
                this.Session["personid"] = oeUsuario.Personid;
                this.Session["smodul"]   = smodul;
                idnivel = oeUsuario.idlevel;
                this.Session["idnivel"] = idnivel;

                snamenivel = oeUsuario.leveldescription;
                this.Session["namenivel"]  = snamenivel;
                this.Session["Perfilid"]   = oeUsuario.Perfilid;
                this.Session["nameperfil"] = oeUsuario.NamePerfil;
                this.Session["Service"]    = 254;
                this.Session["Canal"]      = "0";
                this.Session["Nivel"]      = 0;

                Sesion_Users su = new Sesion_Users();
                //string HostName =System.Net.Dns.GetHostByAddress(Request.UserHostAddress).HostName;
                //string RemoteHost = HttpContext.Current.Request.UserHostAddress;
                //string RemoteHost = HttpContext.Current.Request.ServerVariables["HTTP_USER_ADDR"];


                string RemoteHost = Request.ServerVariables["REMOTE_ADDR"];



                su.Registrar_Auditoria(this.Session["sUser"].ToString(), Convert.ToInt32(this.Session["companyid"]), RemoteHost, DateTime.Now);


                ObtenerDatosEnvioMail();

                if (oeUsuario != null)
                {
                    UsuarioAcceso  oUsuarioAcceso  = new UsuarioAcceso();
                    EUsuarioAcceso oeUsuarioAcceso = new EUsuarioAcceso();
                    oeUsuarioAcceso = oUsuarioAcceso.obtenerAleatorioxUsuario(sUser, sPassw);
                    UniqueLogin(sUser);
                    AplicacionWeb  oAplicacionWeb  = new AplicacionWeb();
                    EAplicacionWeb oeAplicacionWeb = oAplicacionWeb.obtenerAplicacion(sCoutry, smodul);
                    this.Session["oeAplicacionWeb"] = oeAplicacionWeb;
                    this.Session["cod_applucky"]    = oeAplicacionWeb.codapplucky;
                    this.Session["abr_app"]         = oeAplicacionWeb.abrapp;
                    this.Session["app_url"]         = oeAplicacionWeb.appurl;
                    sPagina         = oeAplicacionWeb.HomePage;
                    oeUsuarioAcceso = null;
                    oeAplicacionWeb = null;
                    oAplicacionWeb  = null;
                }
                //PProgresso.Style.Value = "Display:none";
                //PProgresso_ModalPopupExtender.Hide();
            }



            catch (Exception ex)
            {
                Lucky.CFG.Exceptions.Exceptions exs = new Lucky.CFG.Exceptions.Exceptions(ex);
                string errMessage = "";
                if (ex.Message.Substring(0, 20) == "Error en la Autenticación de Usuario" ||
                    ex.Message.Substring(0, 20) == "La Clave es Errrada o Usuario no Existe")
                {
                    //errMessage = new Lucky.CFG.Util.Functions().preparaMsgError(ex.Message);


                    //this.Response.Redirect("~/err_mensaje.aspx?msg=" + errMessage, true);
                    this.Session["encabemensa"] = "Error de Autenticación";
                    this.Session["mensaje"]     = "Usuario y/o Clave Erradas";
                    this.Session["cssclass"]    = "MensajesSupervisor";
                    Mensajes_Usuario();
                    return;
                }
                else
                {
                    //Enviar error a fin de evitar que este se pierda con el redirect de página.

                    exs.Country = "SIGE(" + ConfigurationManager.AppSettings["COUNTRY"] + ") - Usuario " + this.Session["sUser"].ToString();
                    string sCountry = ConfigurationManager.AppSettings["COUNTRY"];
                    //exs.errorWebsite(sCountry);
                    //errMessage += new Lucky.CFG.Util.Functions().preparaMsgError(ex.Message);
                    errMessage = "Error de Autenticacion para " + ' ' + sUser + ' ' + "Clave errada o Usuario Inactivo";
                    this.Session["errMessage"] = errMessage;
                    //this.Response.Redirect("~/err_mensaje.aspx?msg=" + errMessage, true);
                    this.Session["encabemensa"] = "Error de Autenticacion";
                    this.Session["mensaje"]     = "Usuario y/o Clave Erradas";
                    this.Session["cssclass"]    = "MensajesSupervisor";
                    ProcesoAdmin.Get_Delete_Sesion_User(sUser);
                    Mensajes_Usuario();
                    return;
                }
            }

            EEntrySeccion oeSeccion = oSeccion.PrimerAcceso(sUser);

            if (oeSeccion.seccionname == "1")
            {
                Response.Redirect("Cambio_pswd.aspx", true);
            }
            //if (Request.Cookies["SIGE_URLRedirect"] == null)
            //{


            //    this.Response.Redirect("~/" + sPagina, true);



            //}
            else
            {
                //HttpCookie hcURLRedirect = Request.Cookies["SIGE_URLRedirect"];
                this.Response.Redirect("~/" + sPagina, true);
            }
        }