Esempio n. 1
0
        /// <summary>
        /// 搜索
        /// </summary>
        /// <returns></returns>
        public IPageList<EContents> SearchContents(int? nodeId, DateTime? startTime, DateTime? endTime, EnumContentStatus? contentStatus, string searchKeyword, string searchType, string orderName, string orderType, int pageIndex, int pageSize)
        {
            Spec<EContents> sp = new Spec<EContents>();
            if (searchKeyword.HasValue())
            {
                sp.And(p => p.Title.Like(searchKeyword));
            }

            if (nodeId.HasValue)
            {
                sp.And(p => p.NodeId == nodeId);
            }

            if (startTime.HasValue)
            {
                sp.And(p => p.LastUpdateTime > startTime);
            }

            if (endTime.HasValue)
            {
                sp.And(p => p.LastUpdateTime < endTime);
            }

            if (contentStatus.HasValue)
            {
                sp.And(p => p.ContentStatus == (EnumContentStatus)contentStatus);
            }

            CSpec<EContents> cp = new CSpec<EContents>();

            if (orderType.HasValue())
            {
                cp.And(orderName, orderType);
            }

            return _rep.GetPageList<EContents>(pageIndex, pageSize, sp, cp);
        }
Esempio n. 2
0
 /// <summary>
 /// 审核内容
 /// </summary>
 public void AuditContentsByIds(string ids, EnumContentStatus contentsStatus, int auditUserId, string auditUserName)
 {
     var contents = new EContents()
     {
         ContentStatus = contentsStatus,
         AuditTime = DateTime.Now,
         AuditUserId = auditUserId,
         AuditUserName = auditUserName
     };
     _rep.Save(contents, p => p.Id.In(ids), p => new Columns(p.ContentStatus, p.AuditUserName, p.AuditUserId, p.AuditTime));
 }