Advertisement
Guest User

Untitled

a guest
Apr 4th, 2012
900
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7.  
  8. namespace Projet___TestConnaissances.Pages
  9. {
  10. public partial class WebForm2 : System.Web.UI.Page
  11. {
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. List<Questionnaire> questionnaires = BLL.Users.GetQuestionnairesAffectésNonPassés(BLL.Users.GetConnectedUser(Session));
  15. RadioButtonList_Choix_Questionnaire.Items.Clear();
  16.  
  17. // Teste le nombre de questionnaires que l'utilisateur doit passer
  18. if ( questionnaires.Count() >= 1 )
  19. {
  20. foreach (Questionnaire q in questionnaires)
  21. {
  22. ListItem li = new ListItem(q.libelle, q.id.ToString());
  23. RadioButtonList_Choix_Questionnaire.Items.Add(li);
  24. }
  25. }
  26. else
  27. {
  28. RadioButtonList_Choix_Questionnaire.Visible = false;
  29. Button_OK.Visible = false;
  30. Label_Msg.Text = "Erreur lors du chargement du questionnaire. Veuillez contacter l'administrateur";
  31. }
  32.  
  33. if (questionnaires.Count() == 1)
  34. {
  35. RadioButtonList_Choix_Questionnaire.SelectedIndex = 0;
  36. //SUBMIT THE FORM <--------
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement