Exemplo n.º 1
0
    protected void btnSaveNewPwd_Click(object sender, ImageClickEventArgs e)
    {
        RegisterUserBLL objUser = new RegisterUserBLL();
        Property objProp = new Property();

        objProp.UserID = txtUserID.Text;
        objProp.OldPassword = txtOldPwd.Text;
        objProp.Password = txtNewPassword.Text;

        string user = (string)Session["User"];

        try
        {
            if (objUser.ChangePassword(objProp, user))
            {
                string str = "alert('Password Changed Successfully...');";
                ScriptManager.RegisterStartupScript(btnSaveNewPwd, typeof(Page), "alert", str, true);
            }
            else
            {
                string str = "alert('Failed to Change Password, Please try again...');";
                ScriptManager.RegisterStartupScript(btnSaveNewPwd, typeof(Page), "alert", str, true);
            }
            ClearControls();
        }
        catch(Exception ex)
        {
            objNLog.Error("Error: " + ex.Message);
        }
    }