public ActionResult ManagePosts(string spaceKey, ManagePostsEditModel model, int pageIndex = 1)
        {
            long       sectionId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            BarSection section   = barSectionService.Get(sectionId);

            if (!new Authorizer().BarSection_Manage(section))
            {
                return(Redirect(SiteUrls.Instance().SystemMessage(TempData, new SystemMessageViewModel
                {
                    Title = "没有权限",
                    Body = "您可能没有权限编辑此帖吧"
                })));
            }

            var group = groupService.Get(spaceKey);

            pageResourceManager.InsertTitlePart(group.GroupName);

            pageResourceManager.InsertTitlePart("回帖管理");

            BarPostQuery query = model.AsBarPostQuery();

            query.SectionId = section.SectionId;

            model.SectionId = section.SectionId;

            ViewData["BarPosts"] = barPostService.Gets(TenantTypeIds.Instance().Group(), query, model.PageSize ?? 20, pageIndex);
            return(View(model));
        }
Example #2
0
        public ActionResult ManagePosts(ManagePostsEditModel model, int pageIndex = 1, string tenantTypeId = null)
        {
            if (string.IsNullOrEmpty(tenantTypeId))
            {
                tenantTypeId = TenantTypeIds.Instance().Bar();
            }

            ViewData["TenantType"] = tenantTypeService.Get(tenantTypeId);

            pageResourceManager.InsertTitlePart("回帖管理");



            ViewData["BarPosts"] = barPostService.Gets(tenantTypeId, model.AsBarPostQuery(), model.PageSize ?? 20, pageIndex);
            return(View(model));
        }
        public ActionResult ManagePosts(ManagePostsEditModel model, int pageIndex = 1)
        {
            if (!authorizer.BarSection_Manage(model.SectionId ?? 0))
            {
                return Redirect(SiteUrls.Instance().SystemMessage(TempData, new SystemMessageViewModel
                {
                    Title = "没有权限",
                    Body = "您可能没有权限编辑此帖吧",
                    StatusMessageType = StatusMessageType.Hint
                }));
            }





            pageResourceManager.InsertTitlePart("回帖管理");
            ViewData["BarPosts"] = barPostService.Gets(TenantTypeIds.Instance().Bar(), model.AsBarPostQuery(), model.PageSize ?? 20, pageIndex);
            return View(model);
        }
        public ActionResult ManagePosts(ManagePostsEditModel model, int pageIndex = 1, string tenantTypeId = null)
        {
            if (string.IsNullOrEmpty(tenantTypeId))
                tenantTypeId = TenantTypeIds.Instance().Bar();

            ViewData["TenantType"] = tenantTypeService.Get(tenantTypeId);

            pageResourceManager.InsertTitlePart("回帖管理");

            ViewData["BarPosts"] = barPostService.Gets(tenantTypeId, model.AsBarPostQuery(), model.PageSize ?? 20, pageIndex);
            return View(model);
        }
Example #5
0
        public ActionResult ManagePosts(string spaceKey, ManagePostsEditModel model, int pageIndex = 1)
        {
            long sectionId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            BarSection section = barSectionService.Get(sectionId);

            if (!authorizer.BarSection_Manage(section))
            {
                return Redirect(SiteUrls.Instance().SystemMessage(TempData, new SystemMessageViewModel
                {
                    Title = "û��Ȩ��",
                    Body = "������û��Ȩ�ޱ༭������"
                }));
            }

            var group = groupService.Get(spaceKey);
            pageResourceManager.InsertTitlePart(group.GroupName);

            pageResourceManager.InsertTitlePart("��������");

            BarPostQuery query = model.AsBarPostQuery();
            query.SectionId = section.SectionId;

            model.SectionId = section.SectionId;

            ViewData["BarPosts"] = barPostService.Gets(TenantTypeIds.Instance().Group(), query, model.PageSize ?? 20, pageIndex);
            return View(model);
        }
        public ActionResult ManagePosts(string spaceKey, ManagePostsEditModel model, int pageIndex = 1)
        {
            long sectionId = TopicIdToTopicKeyDictionary.GetTopicId(spaceKey);
            BarSection section = barSectionService.Get(sectionId);

            if (!authorizer.BarSection_Manage(section))
            {
                return Redirect(SiteUrls.Instance().SystemMessage(TempData, new SystemMessageViewModel
                {
                    Title = "没有权限",
                    Body = "您可能没有权限编辑此帖吧"
                }));
            }

            var topic = topicService.Get(spaceKey);
            pageResourceManager.InsertTitlePart(topic.TopicName);

            pageResourceManager.InsertTitlePart("回帖管理");

            BarPostQuery query = model.AsBarPostQuery();
            query.SectionId = section.SectionId;

            model.SectionId = section.SectionId;

            ViewData["BarPosts"] = barPostService.Gets(TenantTypeIds.Instance().Topic(), query, model.PageSize ?? 20, pageIndex);
            return View(model);
        }