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 { } }
protected void btnLogin_Click(object sender, EventArgs e) { string msgConfirmacao = string.Empty; Resultado resultado = new Resultado(); Usuario u = new Usuario(); UsuarioFacade UsuarioF = new UsuarioFacade(); resultado = UsuarioF.Autenticar(u, ref resultado); if (resultado.Sucesso) { Session.Add("USUARIO", u); Response.Redirect("Default.aspx"); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "ResultadoConfirmação", "alert('" + resultado.Mensagens[0].Descricoes[0].ToString() + "');", true); } }
public List<Usuario> ListarUsuarios() { Resultado resultado = new Resultado(); List<Usuario> Teste = new UsuarioFacade().Listar("", ref resultado); return Teste; }