public static bool Delete(string generalId)
        {
            DeleteHtmlFile(generalId);
            if (!DataValidator.IsValidId(generalId))
            {
                return(false);
            }
            bool flag = dal.Delete(generalId);

            if (flag)
            {
                Votes.Delete(generalId);
            }
            foreach (string str in generalId.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
            {
                int num = DataConverter.CLng(str);
                Comment.DeleteByGeneralId(num);
                Special.DeleteSpecialInfos(num);
                PermissionContent.Delete(num);
                SignInContent.Delete(num);
                SignInLog.Delete(num);
            }
            return(flag);
        }
Esempio n. 2
0
        public bool CheckPermission()
        {
            int  permissionType;
            bool flag = true;
            ContentPermissionInfo contentPermissionInfoById = PermissionContent.GetContentPermissionInfoById(DataConverter.CLng(HttpContext.Current.Request["id"]));

            if (contentPermissionInfoById == null)
            {
                permissionType = 0;
            }
            else
            {
                permissionType = contentPermissionInfoById.PermissionType;
            }
            switch (permissionType)
            {
            case 0:
                switch (this.m_NodeInfo.PurviewType)
                {
                case 1:
                case 2:
                    if (!this.CheckIsAuthenticated())
                    {
                        flag = false;
                    }
                    if (string.IsNullOrEmpty(this.m_ErrMsg))
                    {
                        if (this.m_NodeInfo.ParentId > 0)
                        {
                            if (!UserPermissions.AccessCheck(OperateCode.NodeContentPreview, this.m_NodeInfo.ParentPath + "," + this.m_NodeInfo.NodeId))
                            {
                                flag = false;
                            }
                        }
                        else if (!UserPermissions.AccessCheck(OperateCode.NodeContentPreview, this.m_NodeInfo.NodeId))
                        {
                            flag = false;
                        }
                        if (!flag)
                        {
                            this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_PurviewCheckedErr;
                        }
                    }
                    return(flag);
                }
                return(flag);

            case 1:
                if (!this.CheckIsAuthenticated())
                {
                    flag = false;
                }
                return(flag);

            case 2:
                if (!this.CheckIsAuthenticated())
                {
                    flag = false;
                }
                if (!StringHelper.FoundCharInArr(contentPermissionInfoById.ArrGroupId, PEContext.Current.User.GroupId.ToString()))
                {
                    this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_PurviewCheckedErr2;
                    flag          = false;
                }
                return(flag);
            }
            return(flag);
        }