Пример #1
0
        private IList <CommonModelInfo> GetCommonList(int startIndex, int pageSize)
        {
            IList <CommonModelInfo> commonModelInfoList = new List <CommonModelInfo>();

            switch (base.CreateMethod)
            {
            case CreateContentType.CreateLatest:
                commonModelInfoList = ContentManage.GetCommonModelInfoList(this.m_NodeIdArray, pageSize);
                break;

            case CreateContentType.CreateByUpdateTime:
                commonModelInfoList = ContentManage.GetCommonModelInfoList(this.m_NodeIdArray, this.m_ContentBeginTime, this.m_ContentEndTime, startIndex, pageSize);
                break;

            case CreateContentType.CreateBetweenId:
                commonModelInfoList = ContentManage.GetCommonModelInfoList(this.m_NodeIdArray, this.m_ContentMinId, this.m_ContentMaxId, startIndex, pageSize);
                break;

            case CreateContentType.CreateByGeneralId:
                commonModelInfoList = ContentManage.GetCommonModelInfoList(this.m_NodeIdArray, this.m_ContentGeneralIdArray);
                break;

            case CreateContentType.CreateByNotCreate:
                commonModelInfoList = ContentManage.CreateByNotCreate(this.m_NodeIdArray, startIndex, pageSize);
                break;

            case CreateContentType.CreateAll:
                commonModelInfoList = ContentManage.CreateAll(this.m_NodeIdArray, startIndex, pageSize);
                break;

            case CreateContentType.CreateAuto:
                commonModelInfoList = ContentManage.CreateAll(this.m_NodeIdArray, 0, 20);
                break;
            }
            if (base.CreateMethod == CreateContentType.CreateByGeneralId)
            {
                this.CreateCount = commonModelInfoList.Count;
                return(commonModelInfoList);
            }
            if (base.CreateMethod == CreateContentType.CreateLatest)
            {
                if (this.CreateCount == 0)
                {
                    this.CreateCount = this.m_LatestNumber;
                }
                return(commonModelInfoList);
            }
            if (this.CreateCount == 0)
            {
                this.CreateCount = ContentManage.GetTotalOfCommonModelInfo(0, ContentSortType.DayHitsAsc, 0x63);
            }
            return(commonModelInfoList);
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_Administrator = PEContext.Current.Admin.IsSuperAdmin;
     if (!this.m_Administrator)
     {
         this.m_arrNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, EasyOne.Enumerations.OperateCode.NodeContentManage);
     }
     if (string.IsNullOrEmpty(base.Title))
     {
         base.Title = "待审核内容";
     }
     this.EgvContent.DataSource = ContentManage.GetCommonModelInfoList(0, this.PageSize, this.NodeId, (ContentSortType)this.ListType, this.Status);
     this.EgvContent.DataBind();
     base.Subtitle = "共" + ContentManage.GetTotalOfCommonModelInfo(this.NodeId, (ContentSortType)this.ListType, this.Status).ToString() + "条";
     base.TitleUrl = base.BasePath + SiteConfig.SiteOption.ManageDir + "/Contents/ContentManage.aspx?Status=0";
 }
Пример #3
0
 protected void BtnClear_Click(object sender, EventArgs e)
 {
     if (this.nodeId > 0)
     {
         ContentManage.DeleteByNodeId(Nodes.GetCacheNodeById(this.nodeId).ArrChildId, -3);
         AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ContentRecycle.aspx?NodeID=" + this.nodeId);
     }
     else
     {
         StringBuilder sb = new StringBuilder();
         foreach (CommonModelInfo info2 in ContentManage.GetCommonModelInfoList(0, 0, -1, ContentSortType.None, -3))
         {
             StringHelper.AppendString(sb, info2.GeneralId.ToString());
         }
         ContentManage.Delete(sb.ToString());
         AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ContentRecycle.aspx");
     }
 }
        private void DeleteHtml(string generalId)
        {
            IList <CommonModelInfo> commonModelInfoList = ContentManage.GetCommonModelInfoList(BasePage.RequestString("NodeID"), generalId);
            string str = base.Server.MapPath("~/" + VirtualPathUtility.AppendTrailingSlash(SiteConfig.SiteOption.CreateHtmlPath));

            foreach (CommonModelInfo info2 in commonModelInfoList)
            {
                string file = str;
                if (info2.CreateTime.HasValue && (info2.CreateTime.Value >= info2.UpdateTime))
                {
                    NodeInfo cacheNodeById = Nodes.GetCacheNodeById(info2.NodeId);
                    file = file + ContentManage.ContentHtmlName(info2, cacheNodeById, 0);
                    if (FileSystemObject.IsExist(file, FsoMethod.File))
                    {
                        FileSystemObject.Delete(file, FsoMethod.File);
                    }
                    DateTime?createTime = null;
                    ContentManage.UpdateCreateTime(info2.GeneralId, createTime);
                }
            }
        }