Exemplo n.º 1
0
        public UserVotingsViewModel(User user)
        {
            VotingsFeed  = new _ContentFeedViewModel();
            PreviosPolls = new _PollStatusViewModel();
            if (user != null)
            {
                UserName = user.FullName;
                UserId   = user.Id;
                var newVotings = (from _group in user.GroupMembers.Select(x => x.Group)
                                  join content in DataService.PerThread.ContentSet.OfType <Poll>() on _group.Id equals content.GroupId
                                  where content.State == (byte)ContentState.Approved && !content.IsFinished
                                  select content).OfType <Content>();

                var finishedVotings = (from _group in user.GroupMembers.Select(x => x.Group)
                                       join content in DataService.PerThread.ContentSet.OfType <Poll>() on _group.Id equals content.GroupId
                                       where content.State == (byte)ContentState.Approved && content.IsFinished
                                       select content).Take(10).ToList();

                VotingsFeed  = new _ContentFeedViewModel(newVotings, UserId);
                PreviosPolls = new _PollStatusViewModel(finishedVotings, user.Id);
            }
        }
Exemplo n.º 2
0
        public UserVotingsViewModel(User user)
        {
            VotingsFeed = new _ContentFeedViewModel();
            PreviosPolls = new _PollStatusViewModel();
            if (user != null)
            {
                UserName = user.FullName;
                UserId = user.Id;
                var newVotings = (from _group in user.GroupMembers.Select(x => x.Group)
                                    join content in DataService.PerThread.ContentSet.OfType<Poll>() on _group.Id equals content.GroupId
                                    where content.State == (byte)ContentState.Approved && !content.IsFinished
                                    select content).OfType<Content>();

                var finishedVotings = (from _group in user.GroupMembers.Select(x => x.Group)
                                    join content in DataService.PerThread.ContentSet.OfType<Poll>() on _group.Id equals content.GroupId
                                    where content.State == (byte)ContentState.Approved && content.IsFinished
                                    select content).Take(10).ToList();

                VotingsFeed = new _ContentFeedViewModel(newVotings, UserId);
                PreviosPolls = new _PollStatusViewModel(finishedVotings, user.Id);
            }
        }
Exemplo n.º 3
0
 public UserVotingsViewModel()
 {
     VotingsFeed  = new _ContentFeedViewModel();
     PreviosPolls = new _PollStatusViewModel();
 }
Exemplo n.º 4
0
 public UserVotingsViewModel()
 {
     VotingsFeed = new _ContentFeedViewModel();
     PreviosPolls = new _PollStatusViewModel();
 }