public CongressVotingCommentViewModel(CongressVotingComment comment) { Message = comment.Message; Ago = AgoHelper.Ago(GameHelper.CurrentDay, DateTime.Now, comment.Day, comment.Time); AuthorName = comment.Citizen.Entity.Name; AuthorAvatar = new ImageViewModel(comment.Citizen.Entity.ImgUrl); }
public ViewMessageViewModel(Message message) { Content = new Markdown().Transform(message.Content); AuthorAvatar = new SmallEntityAvatarViewModel(message?.AuthorID, message?.Author?.Name, message?.Author?.ImgUrl); DateTooltip = string.Format("Day {0} {1}", message.Day, message.Date.ToString("HH:mm")); Date = AgoHelper.Ago(GameHelper.CurrentDay, DateTime.Now, message.Day, message.Date); }
public CongressVotingsItemViewModel(CongressVoting voting) { ProposalName = string.Format("Proposal #{0} : {1}", voting.ID, ((VotingTypeEnum)voting.VotingTypeID).ToHumanReadable()); CreatorName = voting.Citizen.Entity.Name; CreatorID = voting.CreatorID; Ago = AgoHelper.DayAgo(GameHelper.CurrentDay, voting.StartDay); ID = voting.ID; StatusHumanReadable = ((VotingStatusEnum)voting.VotingStatusID).ToHumanReadable(); }