Exemple #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);
 }
        public CongressVotingComment AddComment(CongressVoting voting, Citizen citizen, string message)
        {
            CongressVotingComment comment = new CongressVotingComment()
            {
                Citizen        = citizen,
                CongressVoting = voting,
                Day            = GameHelper.CurrentDay,
                Time           = DateTime.Now,
                Message        = message
            };

            congressVotingRepository.AddComment(comment);
            congressVotingRepository.SaveChanges();

            return(comment);
        }
Exemple #3
0
 public void AddComment(CongressVotingComment comment)
 {
     context.CongressVotingComments.Add(comment);
 }