public void SetUp() { Createrepo = new Create(); Readrepo = new Read(); Deleterepo = new Delete(); Updaterepo = new Update(); dropdownrepo = new DropDown(); userID = "b75da91b - e39a - 42ce - b2f0 - 4834eda139e1"; }
public void EditPost(Post post) { // Overwrite post with edited data var update = new Update(); update.EditPost(post); // Delete all hashtags associated with post from PostsXTags table var delete = new Delete(); delete.DeleteAllTagsByPostID(post.PostID); // Split up tags string from UI into individual hashtags. Then remove all # symbols. // Afterwards, only tags that contain characters are added to the HashTags list. if (post.Tags != null) { var hashtags = post.Tags.Replace("#", "").Split(','); foreach (var hashtag in hashtags) { if (hashtag != "") { var p = new HashTag(); p.ActualHashTag = hashtag; post.HashTags.Add(p); } } } // Iterate: Check if hashtag is in Tags table. If not, create a new record in that table // before creating a new record in PostsXTags. Else, just create new record in PostsXTags. if (post.HashTags.Count() != 0) { var create = new Create(); foreach (var tag in post.HashTags) { create.AddTag((int)post.PostID, tag); } } }
public void DeletePage(int staticPageID) { var delete = new Delete(); delete.DeletePage(staticPageID); }
public void DeletePost(int postID) { var delete = new Delete(); delete.DeletePost(postID); }
public void DeleteAllTagsByPostID(int postID) { var delete = new Delete(); delete.DeleteAllTagsByPostID(postID); }