Example #1
0
        /// <summary>
        /// 根據版主Email,查詢版主創版之待審、需重審、審核通過的版面
        /// </summary>
        /// <param name="UserEmail"></param>
        /// <param name="pageOfMod"></param>
        /// <returns></returns>
        public IEnumerable <GetUnauditedForum> GetModForumPage(string UserEmail, AuditForumPageOfManagerAndMod pageOfMod)
        {
            Guid userId = _members.GetAll2().FirstOrDefault(x => x.Email == UserEmail).UserId;

            return(_Forums.GetAll2().Where(x => x.ModeratorId == userId && x.State == pageOfMod.State && string.IsNullOrEmpty(x.RejectMsg) == string.IsNullOrEmpty(pageOfMod.RejectMsg)).OrderByDescending(x => x.CreatedDate).Select(x => new GetUnauditedForum
            {
                ForumId = x.ForumId,
                ForumName = x.ForumName,
                RouteName = x.RouteName,
                Description = x.Description,
                ModeratorName = _members.GetAll2().FirstOrDefault(y => y.UserId == x.ModeratorId).Name,
                ImgLink = x.Img,
                CreatedDate = x.CreatedDate.ToString(),
                RejectMsg = x.RejectMsg,
                State = (bool)x.State
            }));
        }
Example #2
0
        /// <summary>
        /// 查詢管理者的待審、需重審、審核通過版面
        /// </summary>
        /// <returns></returns>
        public IEnumerable <GetUnauditedForum> GetManagerForumPage(AuditForumPageOfManagerAndMod pageOfManager)
        {
            IEnumerable <GetUnauditedForum> Unaudited = (from f in _Forums.GetAll2()
                                                         where f.State == pageOfManager.State && string.IsNullOrEmpty(f.RejectMsg) == string.IsNullOrEmpty(pageOfManager.RejectMsg)
                                                         orderby f.CreatedDate descending
                                                         select new GetUnauditedForum()
            {
                ForumId = f.ForumId,
                ForumName = f.ForumName,
                RouteName = f.RouteName,
                Description = f.Description,
                ModeratorName = _members.GetAll2().FirstOrDefault(x => x.UserId == f.ModeratorId).Name,
                ImgLink = f.Img,
                CreatedDate = f.CreatedDate.ToString(),
                RejectMsg = f.RejectMsg,
                State = (bool)f.State
            });

            return(Unaudited);
        }
Example #3
0
 public IEnumerable <GetUnauditedForum> GetManagerForumPage(AuditForumPageOfManagerAndMod pageOfManager)
 {
     return(_forumservice.GetManagerForumPage(pageOfManager));
 }
Example #4
0
 public IEnumerable <GetUnauditedForum> GetModForumPage(AuditForumPageOfManagerAndMod pageOfMod)
 {
     return(_forumservice.GetModForumPage(User.Identity.Name, pageOfMod));
 }