// Initialiser le Tableau des votes des Personnes OPT17072010 private void initTableauVotesPersonnes(int nbPersonnes, PersonneCollection personnes) { int indexPollVotes = 0; int nbVotes = 0; PollVoteCollection[] tableauPollVotes = new PollVoteCollection[nbPersonnes]; foreach (Personne p in personnes) { tableauPollVotes[indexPollVotes] = Votes.FindByPersonneGUID(p.PersonneGUID); nbVotes += tableauPollVotes[indexPollVotes].Count; indexPollVotes += 1; } TableauVotesPersonnes = tableauPollVotes; NombreVotesPersonnes = nbVotes; }
void CalculerVotants() { PersonneCollection pc = PersonneCollection.GetQuestionnaire(SessionState.Questionnaire.QuestionnaireID); LabelNombreContacts.Text = pc.Count.ToString(); int nbVotant = 0; foreach (Personne p in pc) { //PollVoteCollection pvc = PollVoteCollection.GetPollVotes( SessionState.Questionnaire.QuestionnaireID, p.PersonneGUID ); PollVoteCollection pvc = Votes.FindByPersonneGUID(p.PersonneGUID); // A t il vote pour ce questionnaire ? if (pvc.Count > 0) { nbVotant = nbVotant + 1; } } LabelVotes.Text = nbVotant.ToString(); }