Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub BuildTableTitulaire(ByVal Str_College As String)
- Dim Row As TableRow 'TR = Ligne
- Dim Cell As TableCell 'TD -> Cellule
- Dim tblHead As TableHeaderCell 'Header
- Dim PredicatListCount As Integer
- Dim MaxCountListe As Integer
- oF_EelecCandidatS.LoadByPoste("myBDD", oF_EelecCandidatS, "Titulaire")
- oF_EelecCandidatS.LoadListeMax("myBDD", MaxCountListe, "Titulaire")
- Row = New TableRow ' Nouvelle Ligne
- 'Construction des entêtes du tableau :
- For Each candidat As F_EelecCandidat In oF_EelecCandidatS
- If (candidat.CAN_College = Str_College) Then
- If (Not LstCandidat.Contains(candidat.CAN_Liste)) Then
- LstCandidat.Add(candidat.CAN_Liste)
- tblHead = New TableHeaderCell
- tblHead.Text = "Liste " & candidat.CAN_Liste
- Row.Cells.Add(tblHead)
- InfosTable.Rows.Add(Row)
- End If
- End If
- Next
- 'Dim Str_Machine As String = Environment.MachineName
- 'Dim Str_NameUserMachine As String = Environment.UserName
- '______________________________________
- Dim Indice As Integer = 0
- For Index As Integer = 0 To LstCandidat.Count - 1 'Nombre de colonne crée
- PredicatListCount = oF_EelecCandidatS.LongCount(Function(candidat) candidat.CAN_Liste = LstCandidat(Index))
- For IndexRow As Integer = 0 To MaxCountListe 'Creation des lignes
- Row = New TableRow ' Nouvelle Ligne
- InfosTable.Rows.Add(Row)
- Next
- For IndexRow As Integer = 1 To PredicatListCount 'Création des cellules dans les lignes
- If (Not oF_EelecCandidatS.ElementAtOrDefault(Indice) Is Nothing) Then
- Cell = New TableCell
- chkBox = New CheckBox
- chkBox.ID = oF_EelecCandidatS(Indice).CAN_Liste & IndexRow
- chkBox.InputAttributes.Add("Value", oF_EelecCandidatS(Indice).cbMarq)
- chkBox.Text = " " & oF_EelecCandidatS(Indice).CAN_Nom & " " & oF_EelecCandidatS(Indice).CAN_Prenom & " Liste : " & oF_EelecCandidatS(Indice).CAN_Liste
- chkBox.AutoPostBack = True
- AddHandler chkBox.CheckedChanged, AddressOf CheckedChanged
- Cell.Controls.Add(chkBox)
- InfosTable.Rows(IndexRow).Cells.Add(Cell)
- Indice += 1
- If (IndexRow = PredicatListCount And IndexRow < MaxCountListe) Then
- For IndexTest As Integer = IndexRow + 1 To MaxCountListe
- Cell = New TableCell
- InfosTable.Rows(IndexTest).Cells.Add(Cell)
- Next
- End If
- End If
- Next
- Next
- End Sub
Add Comment
Please, Sign In to add comment