deleteAllComments() public méthode

public deleteAllComments ( ) : bool
Résultat bool
Exemple #1
0
    protected void Close_Account(object sender, EventArgs e)
    {
        try
        {
            MembershipUser user = Membership.GetUser();
            Boolean result = Membership.ValidateUser(user.UserName, closePassword.Text);

            if (result)
            {
                //delete all comments by this user
                FuddleUser fUser = new FuddleUser(user.UserName);
                fUser.deleteAllComments();
                //delete all votes and cuddles
                fUser.removeVoteAndCuddlesForUser();
                //delete user
                Membership.DeleteUser(user.UserName);
                FormsAuthentication.SignOut();
                Response.Redirect(FormsAuthentication.LoginUrl);
            }
            else
                Msg2.Text = "Wrong password. Try again.";
        }
        catch (Exception err)
        {
            Msg2.Text = "Account deletion failed.";
        }
    }
Exemple #2
0
 protected void DeleteUser(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(UserNameText.Text))
     {
         //delete all comments by this user
         FuddleUser fUser = new FuddleUser(UserNameText.Text);
         fUser.deleteAllComments();
         //delete all votes and cuddles
         fUser.removeVoteAndCuddlesForUser();
         //delete user
         Membership.DeleteUser(UserNameText.Text);
         UserGrid.DataBind();
     }
 }