public Response AddNewStaticPage(StaticPage p) { _response = new Response(); var staticPage = _repo.AddNewStaticPage(p); if (staticPage != null) { _response.Success = true; _response.StaticPage = staticPage; } return _response; }
public Response EditBlogPost(BlogPost b) { _response = new Response(); var blogPost = _repo.EditBlogPost(b); if (blogPost != null) { _response.Success = true; _response.BlogPost = blogPost; } return _response; }
public Response AddRoleToUser(string userId, string roleId) { _response = new Response(); var user = _repo.AddRoleToUser(userId, roleId); if (user != null && user.Roles.First().RoleId == roleId) { _response.Success = true; _response.User = user; } return _response; }
public Response GetHashtagById(int hashtagId) { _response = new Response(); var hashtag = _repo.GetHashtagById(hashtagId); if (hashtag != null) { _response.Success = true; _response.Hashtag = hashtag; } return _response; }
public Response UpdateUserAccountStatus(string userId, AccountStatus status) { _response = new Response(); var user = _repo.UpdateUserAccountStatus(userId, status); if (user != null && user.AccountStatus == status) { _response.Success = true; _response.User = user; } return _response; }
public Response GetAllHashtags() { _response = new Response(); var hashtags = _repo.GetAllHashtags(); if (hashtags != null) { _response.Success = true; _response.Hashtags = hashtags; } return _response; }
public void TestUpdateStaticPageStatus() { _response = _ops.UpdateStaticPageStatus(1, PageStatus.Approved); Assert.AreEqual(true, _response.Success); }
public void TestGetUserById() { _response = _ops.GetUserById("2ee5771a-f120-453f-8995-de7652ddd30d"); Assert.AreEqual(true, _response.Success); }
public void TestGetHashtagsByBlogPostId() { _response = _ops.GetHashtagsByBlogPostId(1); Assert.AreEqual(true, _response.Success); }
public void TestGetBlogPostById() { _response = _ops.GetBlogPostById(1); Assert.AreEqual(true, _response.Success); }
public Response EditStaticPage(StaticPage page) { _response = new Response(); var staticPage = _repo.EditStaticPage(page); if (staticPage != null) { _response.Success = true; _response.StaticPage = staticPage; } return _response; }
public Response GetCategoryById(int categoryId) { _response = new Response(); var category = _repo.GetCategoryById(categoryId); if (category != null) { _response.Success = true; _response.Category = category; } return _response; }
public Response GetBlogStats() { _response = new Response(); var blogStats = _repo.GetBlogStats(); if (blogStats != null) { _response.Success = true; _response.BlogStats = _repo.GetBlogStats(); } return _response; }
public Response GetBlogPostById(int blogPostId) { _response = new Response(); var blogPost = _repo.GetBlogPostById(blogPostId); if (blogPost != null) { _response.Success = true; _response.BlogPost = blogPost; } return _response; }
public Response GetAllUsers() { _response = new Response(); var users = _repo.GetAllUsers(); if (users != null) { _response.Success = true; _response.Users = users; } return _response; }
public Response GetAllStaticPages() { _response = new Response(); var staticPages = _repo.GetAllStaticPages(); if (staticPages != null) { _response.Success = true; _response.StaticPages = staticPages; } return _response; }
public Response GetAllRoles() { _response = new Response(); var idRoles = _repo.GetAllRoles(); if (idRoles != null) { _response.Success = true; _response.IdRoles = idRoles; } return _response; }
public BlogOperations() { _response = new Response(); _repo = new BlogRepository(); }
public Response GetHashtagsByBlogPostId(int blogPostId) { _response = new Response(); var hashtags = _repo.GetHashtagByBlogPostId(blogPostId); if (hashtags != null) { _response.Success = true; _response.Hashtags = hashtags; } return _response; }
public void TestGetAllUsers() { _response = _ops.GetAllUsers(); Assert.AreEqual(true, _response.Success); }
public Response GetStaticPageById(int staticPageId) { _response = new Response(); var staticPage = _repo.GetStaticPageById(staticPageId); if (staticPage != null) { _response.Success = true; _response.StaticPage = staticPage; } return _response; }
public void TestGetCategoryById() { _response = _ops.GetCategoryById(1); Assert.AreEqual(true, _response.Success); }
public Response GetUserById(string userId) { _response = new Response(); var user = _repo.GetUserById(userId); if (user != null) { _response.Success = true; _response.User = user; } return _response; }
public void TestGetStaticPageById() { _response = _ops.GetStaticPageById(1); Assert.AreEqual(true, _response.Success); }
public Response UpdateBlogPostStatus(int blogPostId, PageStatus updatedStatus) { _response = new Response(); var blogPost = _repo.UpdateBlogPostStatus(blogPostId, updatedStatus); if (blogPost != null) { _response.Success = true; _response.BlogPost = blogPost; _response.Message = "Blog post status was successfully updated"; } _response.Message = "Your blog post status could not be updated"; return _response; }
public void TestUpdateRoleByUserId() { _response = _ops.UpdateRoleByUserId("74e60034-4ccf-4421-96cd-847d1aa2908a", "1"); Assert.AreEqual(true, _response.Success); }
public Response UpdateStaticPageStatus(int staticPageId, PageStatus updatedStaticPageStatus) { _response = new Response(); var staticPage = _repo.UpdateStaticPageStatus(staticPageId, updatedStaticPageStatus); if (staticPage != null) { _response.Success = true; _response.StaticPage = staticPage; _response.Message = "Static page status was successfully updated"; } _response.Message = "Your static page status could not be updated"; return _response; }
public void TestUpdateUserAccountStatus() { _response =_ops.UpdateUserAccountStatus("74e60034-4ccf-4421-96cd-847d1aa2908a", AccountStatus.Active); Assert.AreEqual(true, _response.Success); }
public Response GetAllCategories() { _response = new Response(); var categories = _repo.GetAllCategories(); if (categories != null) { _response.Success = true; _response.Categories = categories; } return _response; }