public void fuckedUpTest() { var repository = DependencyResolver.Current.GetService <ICitizenRepository>(); var citizen = repository.First(); for (int i = 0; i < 20; ++i) { YesVoters.Add(new CongressVotingVoterViewModel(citizen)); } for (int i = 0; i < 20; ++i) { NoVoters.Add(new CongressVotingVoterViewModel(citizen)); } }
public ViewVotingBaseViewModel(Entities.CongressVoting voting, bool isPlayerCongressman, bool canVote) : base(voting.Country) { VotingID = voting.ID; CreatorName = voting.Citizen.Entity.Name; CreatorID = voting.Citizen.ID; CommentRestriction = (CommentRestrictionEnum)voting.CommentRestrictionID; ApplyCommentRestriction(isPlayerCongressman); CreatorMessage = voting.CreatorMessage; foreach (var votes in voting.CongressVotes) { if (votes.VoteTypeID == (int)VoteTypeEnum.Yes) { YesVoters.Add(new CongressVotingVoterViewModel(votes.Citizen)); } else if (votes.VoteTypeID == (int)VoteTypeEnum.No) { NoVoters.Add(new CongressVotingVoterViewModel(votes.Citizen)); } } VotingStatus = (VotingStatusEnum)voting.VotingStatusID; MoreNoVotersCount = NoVoters.Count - 5; MoreYesVotersCount = YesVoters.Count - 5; var timeLeft = voting.GetTimeLeft(GameHelper.CurrentDay); if (timeLeft.TotalSeconds > 0) { TimeLeft = string.Format("{0:00}:{1:00}:{2:00}", (int)timeLeft.TotalHours, (int)timeLeft.Minutes, timeLeft.Seconds); WaitingForResolve = false; } else { TimeLeft = "00:00:00"; WaitingForResolve = true; } CanVote = canVote && WaitingForResolve == false; }