Exemplo n.º 1
0
        /// <summary>
        /// 添加BBTag实体
        /// </summary>
        /// <param name="htmlTemplate">html模板</param>
        /// <param name="attachment">带替换附件</param>
        /// <returns>BBTag实体</returns>
        private BBTag AddBBTag(string htmlTemplate, Attachment attachment)
        {
            PointCategory pointCategory = new PointService().GetPointCategory(PointCategoryKeys.Instance().TradePoints());
            string        categoryName  = pointCategory != null ? pointCategory.CategoryName : "金币";

            BBAttribute bbAttribute = new BBAttribute("attachTemplate", "",
                                                      n =>
            {
                return(string.Format(htmlTemplate,
                                     attachment.FriendlyFileName,
                                     attachment.FriendlyFileLength,
                                     attachment.Price > 0 ? ",<em>需要" + attachment.Price + categoryName + "</em>" : "",
                                     attachment.DownloadCount,
                                     attachment.AttachmentId));
            },
                                                      HtmlEncodingMode.UnsafeDontEncode);

            return(new BBTag("attach:" + attachment.AttachmentId, "${attachTemplate}", "", false, BBTagClosingStyle.LeafElementWithoutContent, null, bbAttribute));
        }
Exemplo n.º 2
0
        public ActionResult _RewardUsers(long?userId = null)
        {
            IEnumerable <long> userIds = Request.QueryString.Gets <long>("CheckBoxGroup", new List <long>());

            if (userId.HasValue)
            {
                //userIds.Union(new List<long> { userId.Value });
                List <long> tempList = userIds.ToList();
                tempList.Add(userId.Value);
                userIds = tempList.AsEnumerable();
            }
            ViewData["userIds"] = userIds;

            pageResourceManager.InsertTitlePart("奖惩用户");
            PointCategory experiencePoints = pointService.GetPointCategory(PointCategoryKeys.Instance().ExperiencePoints());
            PointCategory reputationPoints = pointService.GetPointCategory(PointCategoryKeys.Instance().ReputationPoints());
            PointCategory tradePoints      = pointService.GetPointCategory(PointCategoryKeys.Instance().TradePoints());

            ViewData["experiencePoints"] = experiencePoints;
            ViewData["reputationPoints"] = reputationPoints;
            ViewData["tradePoints"]      = tradePoints;
            return(View());
        }