示例#1
0
 public Topic(Entity.Topic topic)
 {
     ID                = topic.ID;
     ForumID           = topic.ForumID;
     ForumTitle        = topic.Forum.Title;
     Gravatar          = Helpers.Gravatar.GetAvatarURL(topic.User.Gravatar, 180);
     Nickname          = Helpers.ColorName.GetNicknameHtml(topic.User.Nickname, topic.User.Ratings.Sum(x => x.Credit) + 1500);
     RepliesCount      = topic.Replies.Count;
     Time              = Helpers.Time.ToTimeTip(topic.Time);
     Title             = HttpUtility.HtmlEncode(topic.Title);
     Top               = topic.Top;
     UserID            = topic.UserID;
     HasReply          = topic.Replies.Count == 0 ? false : true;
     LastReplyNickname = topic.Replies.Count == 0 ? null : (Helpers.ColorName.GetNicknameHtml(topic.Replies.OrderBy(x => x.Time).Last().User.Nickname, topic.Replies.OrderBy(x => x.Time).Last().User.Ratings.Sum(x => x.Credit) + 1500));
     LastReplyTime     = topic.Replies.Count == 0 ? null : (Helpers.Time.ToTimeTip(topic.Replies.OrderBy(x => x.Time).Last().Time));
     LastReplyUserID   = topic.Replies.Count == 0 ? null : (int?)(topic.Replies.OrderBy(x => x.Time).Last().UserID);
 }
示例#2
0
        public TopicResult(Entity.Topic topic)
        {
            Id           = topic.Id;
            Title        = topic.Title;
            Status       = topic.Status;
            Deadline     = topic.Deadline;
            Description  = topic.Description;
            Requirements = topic.Requirements;
            CreatedAt    = topic.CreatedAt;
            UpdatedAt    = topic.UpdatedAt;

            if (topic.CreatedBy != null)
            {
                CreatedBy = new UserResult(topic.CreatedBy);
            }

            // TODO this.CreatedBy = topic.UpdatedBy;
        }
示例#3
0
 public HomeNews(Entity.Topic topic)
 {
     ID    = topic.ID;
     Title = topic.Title;
     Time  = topic.Time;
 }