Esempio n. 1
0
        public Response AddNewStaticPage(StaticPage p)
        {
            _response = new Response();
            var staticPage = _repo.AddNewStaticPage(p);

            if (staticPage != null)
            {
                _response.Success = true;
                _response.StaticPage = staticPage;
            }

            return _response;
        }
Esempio n. 2
0
        public Response EditBlogPost(BlogPost b)
        {
            _response = new Response();
            var blogPost = _repo.EditBlogPost(b);

            if (blogPost != null)
            {
                _response.Success = true;
                _response.BlogPost = blogPost;
            }

            return _response;
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        public Response GetHashtagById(int hashtagId)
        {
            _response = new Response();
            var hashtag = _repo.GetHashtagById(hashtagId);

            if (hashtag != null)
            {
                _response.Success = true;
                _response.Hashtag = hashtag;
            }

            return _response;
        }
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
        public Response GetAllHashtags()
        {
            _response = new Response();
            var hashtags = _repo.GetAllHashtags();

            if (hashtags != null)
            {
                _response.Success = true;
                _response.Hashtags = hashtags;
            }

            return _response;
        }
Esempio n. 7
0
        public void TestUpdateStaticPageStatus()
        {
            _response = _ops.UpdateStaticPageStatus(1, PageStatus.Approved);

            Assert.AreEqual(true, _response.Success);
        }
Esempio n. 8
0
 public void TestGetUserById()
 {
     _response = _ops.GetUserById("2ee5771a-f120-453f-8995-de7652ddd30d");
     Assert.AreEqual(true, _response.Success);
 }
Esempio n. 9
0
        public void TestGetHashtagsByBlogPostId()
        {
            _response = _ops.GetHashtagsByBlogPostId(1);

            Assert.AreEqual(true, _response.Success);
        }
Esempio n. 10
0
        public void TestGetBlogPostById()
        {
            _response = _ops.GetBlogPostById(1);

            Assert.AreEqual(true, _response.Success);
        }
Esempio n. 11
0
        public Response EditStaticPage(StaticPage page)
        {
            _response = new Response();
            var staticPage = _repo.EditStaticPage(page);

            if (staticPage != null)
            {
                _response.Success = true;
                _response.StaticPage = staticPage;
            }

            return _response;
        }
Esempio n. 12
0
        public Response GetCategoryById(int categoryId)
        {
            _response = new Response();
            var category = _repo.GetCategoryById(categoryId);

            if (category != null)
            {
                _response.Success = true;
                _response.Category = category;
            }

            return _response;
        }
Esempio n. 13
0
        public Response GetBlogStats()
        {
            _response = new Response();

            var blogStats = _repo.GetBlogStats();

            if (blogStats != null)
            {
                _response.Success = true;
                _response.BlogStats = _repo.GetBlogStats();
            }

            return _response;
        }
Esempio n. 14
0
        public Response GetBlogPostById(int blogPostId)
        {
            _response = new Response();
            var blogPost = _repo.GetBlogPostById(blogPostId);

            if (blogPost != null)
            {
                _response.Success = true;
                _response.BlogPost = blogPost;
            }

            return _response;
        }
Esempio n. 15
0
        public Response GetAllUsers()
        {
            _response = new Response();
            var users = _repo.GetAllUsers();

            if (users != null)
            {
                _response.Success = true;
                _response.Users = users;
            }

            return _response;
        }
Esempio n. 16
0
        public Response GetAllStaticPages()
        {
            _response = new Response();
            var staticPages = _repo.GetAllStaticPages();

            if (staticPages != null)
            {
                _response.Success = true;
                _response.StaticPages = staticPages;
            }

            return _response;
        }
Esempio n. 17
0
        public Response GetAllRoles()
        {
            _response = new Response();
            var idRoles = _repo.GetAllRoles();

            if (idRoles != null)
            {
                _response.Success = true;
                _response.IdRoles = idRoles;
            }

            return _response;
        }
Esempio n. 18
0
 public BlogOperations()
 {
     _response = new Response();
     _repo = new BlogRepository();
 }
Esempio n. 19
0
        public Response GetHashtagsByBlogPostId(int blogPostId)
        {
            _response = new Response();
            var hashtags = _repo.GetHashtagByBlogPostId(blogPostId);

            if (hashtags != null)
            {
                _response.Success = true;
                _response.Hashtags = hashtags;
            }

            return _response;
        }
Esempio n. 20
0
 public void TestGetAllUsers()
 {
     _response = _ops.GetAllUsers();
     Assert.AreEqual(true, _response.Success);
 }
Esempio n. 21
0
        public Response GetStaticPageById(int staticPageId)
        {
            _response = new Response();
            var staticPage = _repo.GetStaticPageById(staticPageId);

            if (staticPage != null)
            {
                _response.Success = true;
                _response.StaticPage = staticPage;
            }

            return _response;
        }
Esempio n. 22
0
 public void TestGetCategoryById()
 {
     _response = _ops.GetCategoryById(1);
     Assert.AreEqual(true, _response.Success);
 }
Esempio n. 23
0
        public Response GetUserById(string userId)
        {
            _response = new Response();
            var user = _repo.GetUserById(userId);

            if (user != null)
            {
                _response.Success = true;
                _response.User = user;
            }

            return _response;
        }
Esempio n. 24
0
        public void TestGetStaticPageById()
        {
            _response = _ops.GetStaticPageById(1);

            Assert.AreEqual(true, _response.Success);
        }
Esempio n. 25
0
        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;
        }
Esempio n. 26
0
        public void TestUpdateRoleByUserId()
        {
            _response = _ops.UpdateRoleByUserId("74e60034-4ccf-4421-96cd-847d1aa2908a", "1");

            Assert.AreEqual(true, _response.Success);
        }
Esempio n. 27
0
        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;
        }
Esempio n. 28
0
        public void TestUpdateUserAccountStatus()
        {
            _response =_ops.UpdateUserAccountStatus("74e60034-4ccf-4421-96cd-847d1aa2908a", AccountStatus.Active);

            Assert.AreEqual(true, _response.Success);
        }
Esempio n. 29
0
        public Response GetAllCategories()
        {
            _response = new Response();
            var categories = _repo.GetAllCategories();

            if (categories != null)
            {
                _response.Success = true;
                _response.Categories = categories;
            }

            return _response;
        }