public string BlogFaveComment(int userID, string postGuid) { SueetieBlogComment sueetieBlogComment = SueetieBlogs.GetSueetieBlogComment(postGuid); if (userID > 0) { if (sueetieBlogComment.SueetieCommentID > 0) { string result = "You tagged this comment by " + sueetieBlogComment.Author + " as a favorite!"; UserContent userContent = new UserContent { ContentID = sueetieBlogComment.ContentID, UserID = userID }; int favoriteID = SueetieUsers.CreateFavorite(userContent); if (favoriteID < 0) { result = "You already tagged this comment as a favorite."; } return(result); } else { return("Sorry, we added favorites after this comment was written. Please consider tagging more recent comments as favorites."); } } else { return("Please login or become a member to tag this comment as a favorite"); } }
public string BlogFavePost(int userID, string postGuid) { SueetieBlogPost sueetieBlogPost = SueetieBlogs.GetSueetieBlogPost(postGuid); if (userID > 0) { if (sueetieBlogPost.SueetiePostID > 0) { string result = "You have tagged " + sueetieBlogPost.Title + " as a favorite!"; UserContent userContent = new UserContent { ContentID = sueetieBlogPost.ContentID, UserID = userID }; int favoriteID = SueetieUsers.CreateFavorite(userContent); if (favoriteID < 0) { result = "You already tagged this post as a favorite."; } return(result); } else { return("Sorry, we added favorites after this post was published. Please consider tagging more recent posts as favorites."); } } else { return("Please login or become a member to tag this post as a favorite"); } }
public static UserContent DeleteFavorite(UserContent userContent) { var provider = SueetieDataProvider.LoadProvider(); var _userContent = provider.DeleteFavorite(userContent); ClearFavoriteContentListCache(userContent.UserID); return(_userContent); }
public static int CreateFavorite(UserContent userContent) { var provider = SueetieDataProvider.LoadProvider(); var favoriteID = provider.CreateFavorite(userContent); ClearFavoriteContentListCache(userContent.UserID); return(favoriteID); }
public static UserContent UserContentIDs(int userid, int contentid) { var _userContent = new UserContent { UserID = userid, ContentID = contentid }; return(_userContent); }
public static bool IsAFave(UserContent userContent) { var _isFave = false; var favoriteID = SueetieUsers.GetFavoriteID(userContent); if (favoriteID > 0) { _isFave = true; } return(_isFave); }
public string ForumFaveMessage(int userID, int messageID, int applicationID) { SueetieForumContent sueetieForumContent = new SueetieForumContent { MessageID = messageID, ContentTypeID = (int)SueetieContentType.ForumMessage, ApplicationID = applicationID }; SueetieForumMessage sueetieForumMessage = SueetieForums.GetSueetieForumMessage(sueetieForumContent); if (userID > 0) { if (sueetieForumMessage.ContentID > 0) { string result = "You tagged this message by " + sueetieForumMessage.DisplayName + " as a favorite!"; UserContent userContent = new UserContent { ContentID = sueetieForumMessage.ContentID, UserID = userID }; int favoriteID = SueetieUsers.CreateFavorite(userContent); if (favoriteID < 0) { result = "You already tagged this forums message as a favorite."; } return(result); } else { return("Dang it. This forums message cannot be tagged as a favorite for some reason. Sorry."); } } else { return("Please login or become a member to tag this forums message as a favorite"); } }
public static int GetFavoriteID(UserContent userContent) { var provider = SueetieDataProvider.LoadProvider(); return(provider.GetFavoriteID(userContent)); }
public UserContent DeleteFavorite(int favoriteID) { UserContent userContent = SueetieUsers.DeleteFavorite(favoriteID); return(userContent); }