Example #1
0
        public ActionResult RemoveUser(string userID)
        {
            //delete all tags user has created, unless adopted by another user
            List <Tag> userTags = tagSql.GetTagsByCreatorID(userID);

            foreach (Tag tag in userTags)
            {
                if (tag.UserIDs.Count <= 1)
                {
                    tagSql.DeleteTag(tag.TagID);
                }
            }

            userSql.RemoveUser(userID);
            TempData["account-deleted"] = true;
            return(RedirectToAction("Logout"));
        }