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 PublishPost(Post post) { var update = new Update(); update.PublishPost(post); }
public void EditPage(StaticPage staticPage) { var update = new Update(); update.EditPage(staticPage); }
public void PublishPage(int staticPageID) { var update = new Update(); update.PublishPage(staticPageID); }