예제 #1
0
        /// <summary>
        /// 重建缩略图
        /// </summary>
        /// <returns></returns>
        public ActionResult RebuildingThumbnails()
        {
            IEnumerable <TenantAttachmentSettings> tenantAttachmentSettings = TenantAttachmentSettings.GetAll();

            ViewData["TenantAttachmentSettings"] = tenantAttachmentSettings;
            ViewData["TenantLogoSettings"]       = TenantLogoSettings.GetAll();

            IStoreProvider storeProvider = DIContainer.Resolve <IStoreProvider>();
            string         rootPath      = WebUtility.GetPhysicalFilePath("~");
            string         uploadsPath   = storeProvider.StoreRootPath;

            if (storeProvider.StoreRootPath.StartsWith(rootPath))
            {
                uploadsPath = uploadsPath.Replace(rootPath, "");
            }
            ViewData["uploadsPath"] = uploadsPath;
            Dictionary <string, string> ApplicationName = new Dictionary <string, string>();

            TenantTypeService        tenantTypeService = new TenantTypeService();
            IEnumerable <TenantType> tenantTypes       = tenantTypeService.Gets(null, null);

            foreach (var item in tenantTypes)
            {
                TenantType type = tenantTypeService.Get(item.TenantTypeId);
                ApplicationName[item.TenantTypeId] = type != null ? type.Name : item.Name;
            }

            ViewData["ApplicationName"] = ApplicationName;

            return(View());
        }
예제 #2
0
        public ActionResult ManageTags(string keyword, string tenantTypeId, bool?isFeatured, AuditStatus?auditStatus = null, int pageIndex = 1, int pageSize = 20)
        {
            pageResourceManager.InsertTitlePart("标签管理");

            TagService tagService = new TagService(tenantTypeId);

            PubliclyAuditStatus?publiclyAuditStatus = null;

            if (auditStatus != null)
            {
                publiclyAuditStatus = (PubliclyAuditStatus?)auditStatus;
            }
            TagQuery tagQuery = new TagQuery();

            tagQuery.PubliclyAuditStatus = publiclyAuditStatus;
            tagQuery.Keyword             = keyword;
            tagQuery.TenantTypeId        = tenantTypeId;
            if (isFeatured.HasValue)
            {
                tagQuery.IsFeatured = isFeatured.Value;
            }
            PagingDataSet <Tag> tags = tagService.GetTags(tagQuery, pageIndex, pageSize);

            //所属下拉框
            List <TenantType> tenantTypesList = tenantTypeService.Gets(MultiTenantServiceKeys.Instance().Tag()).ToList <TenantType>();

            tenantTypesList.Insert(0, new TenantType {
                ApplicationId = 0, Name = "不限", TenantTypeId = ""
            });

            SelectList tenants = new SelectList(tenantTypesList.Select(n => new { text = n.Name, value = n.TenantTypeId }), "value", "text", tenantTypeId);

            ViewData["tenants"] = tenants;

            //所属名称
            Dictionary <string, string> tenantsDictionary = tenantTypesList.ToDictionary(n => n.TenantTypeId, n => n.Name);

            ViewData["tenantsDictionary"] = tenantsDictionary;

            return(View(tags));
        }
예제 #3
0
        /// <summary>
        /// 日志管理
        /// </summary>
        /// <param name="auditStatus">审批状态</param>
        /// <param name="categoryId">日志类别id</param>
        /// <param name="subjectKeywords">标题关键字</param>
        /// <param name="isEssential">是否加精</param>
        /// <param name="userId">作者id</param>
        /// <param name="pageSize">分页大小</param>
        /// <param name="pageIndex">页码</param>
        public ActionResult ManageBlogs(AuditStatus?auditStatus = null, long?categoryId = null, string subjectKeywords = null, bool?isEssential = null, string userId = null, string tenantTypeId = null, int pageSize = 20, int pageIndex = 1)
        {
            long?blogUserId = null;

            if (!string.IsNullOrEmpty(userId))
            {
                userId = userId.Trim(',');
                if (!string.IsNullOrEmpty(userId))
                {
                    blogUserId = long.Parse(userId);
                }
            }

            //获取类别
            IEnumerable <Category> categorys    = categoryService.GetOwnerCategories(0, TenantTypeIds.Instance().BlogThread());
            SelectList             categoryList = new SelectList(categorys.Select(n => new { text = n.CategoryName, value = n.CategoryId }), "value", "text", categoryId);

            ViewData["categoryList"] = categoryList;

            //组装是否加精
            List <SelectListItem> selectListIsEssential = new List <SelectListItem> {
                new SelectListItem {
                    Text = "是", Value = true.ToString()
                }, new SelectListItem {
                    Text = "否", Value = false.ToString()
                }
            };

            ViewData["isEssential"] = new SelectList(selectListIsEssential, "Value", "Text", isEssential);
            ViewData["userId"]      = blogUserId;

            //获取租户类型
            IEnumerable <TenantType> tenantTypes = tenantTypeService.Gets(MultiTenantServiceKeys.Instance().Blog());
            SelectList tenants = null;

            tenants                  = new SelectList(tenantTypes.Select(n => new { text = n.Name, value = n.TenantTypeId }), "value", "text", tenantTypeId);
            ViewData["tenants"]      = tenants;
            ViewData["tenantscount"] = tenantTypes.Count();

            PagingDataSet <BlogThread> blogs = blogService.GetsForAdmin(null, auditStatus, categoryId, isEssential, blogUserId, subjectKeywords, pageSize, pageIndex);

            pageResourceManager.InsertTitlePart("日志管理");

            return(View(blogs));
        }