Example #1
0
        protected void btnEnviarNewPass_Click(object sender, EventArgs e)
        {
            if ((TxtPassNuevo.Text == TxtPassNew.Text) && (TxtPassNuevo.Text != "" && TxtPassNew.Text != ""))
            {
                Usuario ocambiopsw = new Usuario();
                string  Key;
                Key = ConfigurationManager.AppSettings["TamperProofKey"];

                EUsuario      oecambiopasw = ocambiopsw.cambiarContrasena(TxtSolicitante.Text, Encriptacion.Codificar(TxtPassNew.Text, Key), Convert.ToString(this.Session["sUser"]), Convert.ToString(DateTime.Now));
                EntrySeccion  oSeccion     = new EntrySeccion();
                EEntrySeccion oeseccion    = oSeccion.Register_PrimerSeccion(Convert.ToString(this.Session["sUser"]), Convert.ToString(this.Session["sUser"]), Convert.ToString(DateTime.Now), Convert.ToString(this.Session["sUser"]), Convert.ToString(DateTime.Now));

                limpiarcontroles();
                FAdmin.Get_Delete_Sesion_User(this.Session["sUser"].ToString().Trim());
                //realiza el envio de Email confirmatorio del cambio de clave
                Enviomail  oEnviomail = new Enviomail();
                EEnviomail oeEmail    = oEnviomail.Envio_mails(this.Session["scountry"].ToString().Trim(), "Solicitud_Clave");
                Mails      oMail      = new Mails();
                oMail.Credenciales = true;
                oMail.Puerto       = Convert.ToInt32(ConfigurationManager.AppSettings["Puerto"]); //Se agrega Puerto Ing. CarlosH 30/11/2011
                oMail.Server       = oeEmail.MailServer;
                oMail.MCifrado     = true;                                                        //Se agrega Cifrado Ing. CarlosH 30/11/2011
                oMail.DatosUsuario = new System.Net.NetworkCredential();                          //Se agrega Credenciales Ing. CarlosH 30/11/2011
                oMail.From         = oeEmail.MailFrom;
                oMail.To           = this.Session["smail"].ToString().Trim();
                oMail.BCC          = "*****@*****.**";

                oMail.Subject = "Acuse de Cambio de Clave" + "'   '" + "Usuario" + "'  '" + this.Session["sUser"].ToString().Trim();
                string[] textArray1 = new string[] { "Señor usuario:" + ' ' + "Su Clave se ha modificado Correctamente", "<br><br>", "Atentamente", "<br>", "Administrador Xplora", };

                oMail.Body = string.Concat(textArray1);


                oMail.BodyFormat = "HTML";
                oMail.send();

                oMail      = null;
                oeEmail    = null;
                oEnviomail = null;
                this.Session["mensaje"]  = "Su clave ha sido cambiada correctamente ver confirmación en su correo";
                this.Session["cssclass"] = "MensajesSupConfirm";
                PMensajeClave.CssClass   = this.Session["cssclass"].ToString();
                lblpasw.Text             = this.Session["mensaje"].ToString();
                ModalPopupExtender.Show();
            }
            else
            {
            }
        }
Example #2
0
        /// <summary>
        /// Redireccionar a la Pagina Web Correspondiente Según Perfil de Usuario, si
        /// se redirecciona a Xplora Maps, Actualizar Password o la Página Normal.
        /// </summary>
        /// <param name="paginaUrl"></param>
        private void fncRedireccionar(String paginaUrl)
        {
            EntrySeccion  oSeccion  = new EntrySeccion();
            EEntrySeccion oeSeccion = new EEntrySeccion();

            try{
                oeSeccion = oSeccion.PrimerAcceso(sUser);
                if (oSeccion.getMessages().Equals(""))
                {
                    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"];
                        // Xplora Maps Alicorp
                        if (this.Session["companyid"].ToString() == "1562" &&
                            (this.Session["Perfilid"].ToString() == "6001" ||
                             this.Session["Perfilid"].ToString() == "4512"))
                        {
                            Response.Redirect("http://sige.lucky.com.pe:8081/");
                        } // Xplora Maps Colgate
                        else if (this.Session["companyid"].ToString() == "1561" &&
                                 this.Session["Perfilid"].ToString() == "4512")
                        {
                            Response.Redirect("http://sige.lucky.com.pe:8282");
                        } // WebSite Operativo y Administrativo
                        else
                        {
                            //this.Response.Redirect("~/" + sPagina, true);
                            this.Response.Redirect("~/" + paginaUrl, true);
                        }
                    }
                }
                else
                {
                    messages = "Error: " + oSeccion.getMessages();
                }
            }catch (Exception ex) {
                messages = "Error: " + ex.Message.ToString();
            }
        }