private void LastVotation() { this.ProgressBarVisibility = true; if (m_network.isNetworkAvailable == true) { m_picaFlorService.GetSessions(0, 1, true, (sessions) => { var lastSession = sessions.FirstOrDefault(); if (lastSession != null) { foreach (VotingFull vote in lastSession.Votes) { m_picaFlorService.GetVoteFullByUri(vote.ResourceUri, (votingFull) => { var voteObj = votingFull.Votes.Where(x => x.MemberId == m_thisParlamentary.Id).FirstOrDefault(); string voteValue = string.Empty; if (voteObj != null) { voteValue = voteObj.VoteValue; } this.Votes.Add(new ParlamentaryVote() { Title = votingFull.Title, Vote = voteValue, Description = votingFull.RecordText }); this.VotesShowed = new ObservableCollection <ParlamentaryVote>(m_votes); this.ProgressBarVisibility = false; }, GenericError); } } }, GenericError); } else { this.MessageText = AppResources.NoNetworkData; } }
private void LoadData() { this.ProgressBarVisibility = true; if (m_network.isNetworkAvailable == true) { m_picaFlorService.GetSessions(30, 0, false, (sessions) => { m_sessiones = sessions; this.SessionesShowed = new ObservableCollection <Session>(m_sessiones.OrderBy(x => x.Date).Reverse().ToList()); }, (error) => { this.MessageText = AppResources.ConectError; }); } else { this.MessageText = AppResources.NoNetworkData; } }