1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| If Session("nbMesure") IsNot Nothing Then
Integer.TryParse(Session("nbMesure").ToString, nbMesure)
Dim lstMsr As List(Of Mesure) = CType(Session("lstMesureAj"), List(Of Mesure))
If Integer.TryParse(Session("nbMesure").ToString(), nbMesure) Then
'If String.IsNullOrEmpty(s) Then
nbMesure += 1
Session("nbMesure") = nbMesure
'End If
For i As Integer = 0 To nbMesure - 1
Dim msr As Mesure = Nothing
'TODO : ajouter textbox pour commentaire de la mesure
Dim tbTitreMesur As TextBox = New TextBox()
Dim tbExpl As TextBox = New TextBox()
Dim btsup As Button = New Button()
Dim tbCommentaire As TextBox = New TextBox()
Dim lit As LiteralControl = New LiteralControl("<br />")
If lstMsr IsNot Nothing Then
If lstMsr.Count > 0 AndAlso i <= lstMsr.Count - 1 Then
msr = lstMsr(i)
End If
End If
tbCommentaire.ID = "textareaCom" & i & "_" & i
tbCommentaire.TextMode = TextBoxMode.MultiLine
tbCommentaire.Width = 200
tbCommentaire.Height = 300
tbExpl.ID = "textarea" & i & "_" & i
tbExpl.TextMode = TextBoxMode.MultiLine
tbExpl.Width = 200
tbExpl.Height = 300
tbTitreMesur.ID = "textbox" & i & "_" & i
If msr IsNot Nothing Then
tbTitreMesur.Text = msr.Titre
If _descrMesure.Count > 0 AndAlso _descrMesure.Count < i Then
tbExpl.Text = _descrMesure(i) 'msr.Description
End If
End If
btsup.Text = "supprimer"
btsup.CssClass = "linkButton_button"
btsup.Font.Size = 11
btsup.ForeColor = Drawing.Color.Red
btsup.ID = "btsup" & i & "_" & i
AddHandler btsup.Click, AddressOf Me.btSupClick
placeHolderMesure.Controls.Add(tbTitreMesur)
placeHolderMesure.Controls.Add(btsup)
placeHolderMesure.Controls.Add(lit)
placeHolderMesure.Controls.Add(tbExpl)
placeHolderMesure.Controls.Add(tbCommentaire)
placeHolderMesure.Controls.Add(lit)
Next i
End If
End If |
Partager