Пример #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DataUser dataUser = new DataUser();
            User     user     = (User)Session["User"];

            lblErrorCon.Visible          = false;
            lblErrorCamposVacios.Visible = false;

            if (txtConNueva.Text.Equals("") || txtConVieja.Text.Equals(""))
            {
                lblErrorCamposVacios.Visible = true;
            }
            else
            {
                if (txtConVieja.Text.Equals(user.Password))
                {
                    user.Password = txtConNueva.Text;
                    dataUser.updatePassword(user);

                    lblErrorCon.Visible          = false;
                    lblErrorCamposVacios.Visible = false;
                    lblConNueva.Visible          = false;
                    txtConNueva.Visible          = false;
                    lblConVieja.Visible          = false;
                    txtConVieja.Visible          = false;
                    btnGuardarCon.Visible        = false;
                    btnCambiarContraseña.Enabled = true;
                    btnCancelar.Visible          = false;
                }
                else
                {
                    lblErrorCon.Visible = true;
                }
            }
        }