예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
        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();
        }