Exemplo n.º 1
0
    protected void btnContinuar_Click(object sender, EventArgs e)
    {
        Responsaveis r     = new Responsaveis();
        int          resId = Convert.ToInt32(Session["idResponsavel"]);

        if (txtSenha.Text == txtRepeteSenha.Text)
        {
            r.Res_senha = txtSenha.Text;

            switch (ResponsavelBD.UpdateSenhaResponsavel(r, resId))
            {
            case 0:
                Session.Remove("idResponsavel");
                Response.Redirect("Login.aspx");
                break;

            case -2:
                break;
            }
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>$('#modalSenhaErrada').modal('show');</script>", false);
        }
    }
Exemplo n.º 2
0
    protected void btnSalvarSenha_Click(object sender, EventArgs e)
    {
        Responsaveis r           = new Responsaveis();
        int          pesId       = Convert.ToInt32(Session["idPessoa"]);
        DataSet      ds          = ResponsavelBD.SelectDados(pesId);
        string       senhaAntiga = ds.Tables[0].Rows[0]["res_senha"].ToString();

        if (txtSenhaAntiga.Text == senhaAntiga)
        {
            int resId = Convert.ToInt32(Session["idResponsavel"]);
            r.Res_senha = txtNovaSenha.Text;

            switch (ResponsavelBD.UpdateSenhaResponsavel(r, resId))
            {
            case 0:
                Response.Redirect("Login.aspx");
                break;

            case -2:
                Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>$('#modalErroInformações').modal('show');</script>", false);
                break;
            }
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>$('#modalSenhaAntigaErrada').modal('show');</script>", false);
        }
    }