protected void btnLogin_Click(object sender, EventArgs e)
        {
            string login = this.txtLogin.Text;
            string senha = this.txtSenha.Text;

            WebService.WebService ws = new WebService.WebService();
            WebService.Usuario usuario = ws.EfetuarLogin(login, senha);

            if (usuario == null)
            {
                Response.Redirect("~/Usuario/UsuarioInvalido.aspx");
            }
            else
            {
                //if (usuario.Usu_status == 1)
                //{
                    Session["userId"] = usuario.Usu_id;
                    Session["userName"] = usuario.Usu_nome;
                    FormsAuthentication.RedirectFromLoginPage(login, true);
                //}
                //else
                //{
                //    Response.Redirect("~/Usuario/ContaNaoAtivada.aspx");
                //}
            }
        }
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            string email = this.txtEmail.Text;

            WebService.WebService ws = new WebService.WebService();

            string senhaRecuperada = ws.RecuperarSenha(email);

            string from = "*****@*****.**";
            string assunto = "Recuperação de senha - Controle de Gastos.";
            string body = "Sua senha foi recuperada com sucesso. <br /><strong>Senha: </strong>" + senhaRecuperada;
            string smtp = "";
            int porta = 0;
            string usuario = "";
            string senha = "";

            if (senhaRecuperada != string.Empty)
            {
                Email.EnvioDeEmail EnvMail = new Email.EnvioDeEmail();
                if (EnvMail.dispararEmail(email, string.Empty, string.Empty, from, assunto, body, 1, true, true, smtp, porta, usuario, senha))
                {
                    Response.Redirect("~/Usuario/SenhaSucesso.aspx");
                }
                else
                {
                    Response.Redirect("~/Usuario/Error.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Usuario/Error.aspx");
            }
        }
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                string senhaAtual = this.txtSenhaAtual.Text;
                string senhaNova = this.txtSenha.Text;
                Int32 usuario = Convert.ToInt32(Session["userId"]);

                WebService.WebService ws = new WebService.WebService();

                if (ws.AlterarSenha(usuario, senhaAtual, senhaNova))
                {
                    this.txtSenhaAtual.Text = "";
                    this.txtSenha.Text = "";
                    this.txtConfirmarSenha.Text = "";
                    this.lblSuccess.Text = "Sua senha foi alterada com sucesso. Acesse novamente com sua nova senha.";
                    FormsAuthentication.SignOut();
                }
                else
                {
                    Response.Redirect("~/Error.aspx");
                }
            }
        }