Ejemplo n.º 1
0
        protected void btnSalvarTrocaSenha_Click(object sender, EventArgs e)
        {
            Resultado     resultado     = new Resultado();
            UsuarioFacade usuarioFacade = new UsuarioFacade();
            string        msg           = "";
            string        script        = "";

            try
            {
                Usuario u = (Usuario)Session["USUARIO"];
                u.NovaSenha = txtSenhaNova1.Text;

                resultado = usuarioFacade.AlterarSenha(u);
                msg       = resultado.Mensagens[0].Descricoes[0].ToString();

                script = Consts.JavaScript.Alert(Consts.Funcoes.Replacer4js(msg.ToString()), false);

                ScriptManager.RegisterStartupScript(this, this.GetType(), "alerta", script, true);

                txtSenhaAtual.Text = "";
                txtSenhaNova1.Text = "";
                txtSenhaNova2.Text = "";

                script = "$dvDetTrocaSenha.jqmHide();";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "abre", script, true);
            }
            catch { }
        }