Esempio n. 1
0
        public bool UpdateForum(AuthUser operatorUser, int forumID, string codeName, string forumName, ForumType forumType, string password, string logoSrc
                                , string readme, string description, string themeID, int columnSpan, int sortOrder, ForumExtendedAttribute forumExtendedDatas)
        {
            if (!AllSettings.Current.BackendPermissions.Can(operatorUser, BackendPermissions.Action.Manage_Forum))
            {
                ThrowError <NoPermissionManageForumError>(new NoPermissionManageForumError(forumID));
                return(false);
            }

            if (false == ValidateForumParams(codeName, forumName, null, forumType, password, logoSrc, themeID))
            {
                return(false);
            }

            int result = ForumDaoV5.Instance.UpdateForum(forumID, codeName, forumName, forumType, password, logoSrc, readme, description, themeID, columnSpan, sortOrder, forumExtendedDatas);

            switch (result)
            {
            case 13:
                ThrowError <DuplicateForumCodeNameError>(new DuplicateForumCodeNameError("codename", codeName));
                return(false);

            default: break;
            }

            ClearAllCache();
            ThreadCachePool.ClearAllCache();

            return(true);
        }
Esempio n. 2
0
        public bool CreateForum(AuthUser operatorUser, string codeName, string forumName, int parentID, ForumType forumType, string password, string logoSrc
                                , string themeID, string readme, string description, ThreadCatalogStatus threadCatalogStaus, int columnSpan, int sortOrder
                                , ForumExtendedAttribute forumExtendedDatas, out int forumID)
        {
            forumID = 0;
            if (!AllSettings.Current.BackendPermissions.Can(operatorUser, BackendPermissions.Action.Manage_Forum))
            {
                ThrowError <NoPermissionManageForumError>(new NoPermissionManageForumError(0));
                return(false);
            }


            if (false == ValidateForumParams(codeName, forumName, parentID, forumType, password, logoSrc, themeID))
            {
                return(false);
            }
            int result = ForumDaoV5.Instance.CreateForum(codeName, forumName, parentID, forumType, password, logoSrc, themeID, readme, description, threadCatalogStaus, columnSpan, sortOrder, forumExtendedDatas, out forumID);

            switch (result)
            {
            case 13:
                ThrowError <DuplicateForumCodeNameError>(new DuplicateForumCodeNameError("codename", codeName));
                return(false);

            case -1:
                ThrowError <ParentForumNotExistsError>(new ParentForumNotExistsError("parentID"));
                return(false);

            default: break;
            }

            ClearAllCache();
            ThreadCachePool.ClearAllCache();

            return(true);
        }