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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| Public Function BuildTableauFrais(ByRef tbLFrais As Table, ByVal tbDFrais As Table, ByVal sNumBorderau As String) As Boolean
Dim rSql As String = ""
Dim da As New DBAccess
Dim ds As New DataSet
Dim bln As Boolean
da.Connect()
ds = da.ExecuteDataSet(rSql)
If (ds.Tables.Count > 0) Then
If (ds.Tables(0).Rows.Count > 0) Then
Dim tbRow As DataRow
Dim sCodeBk As String =""
For Each tbRow In ds.Tables(0).Rows
Dim lngCom As Double = 0
Dim lngTPS As Double = 0
Dim lngTotalInteret As Double = 0
Dim lngMontantAgio As Double = 0
' Generate rows and cells.
Dim tbSave As New Table
tbSave = tbDFrais
Dim tbRw As New TableRow
For Each tbRw In tbSave.Rows
Dim tbCel As New TableCell
For Each tbCel In tbRw.Cells
If tbCel.ID = "iDTaux" Then
tbCel.Text = tbRow.Item("TAUX").ToString
ElseIf tbCel.ID = "iDDateRemise" Then
tbCel.Text = FormatDateTime(tbRow.Item("DATE_RECEPTION"), DateFormat.ShortDate)
ElseIf tbCel.ID = "iDDateEcheance" Then
tbCel.Text = FormatDateTime(dDateEcheance, DateFormat.ShortDate)
ElseIf tbCel.ID = "iDNombreDeJour" Then
tbCel.Text = iNbreJour.ToString
ElseIf tbCel.ID = "iDMontant" Then
tbCel.Text = FormatNumber(tbRow.Item("MONTANT_EFFET"), 0, , , TriState.True)
ElseIf tbCel.ID = "iDCommissonBorderau" Then
tbCel.Text = FormatNumber(lngCom, 0, , , TriState.True) 'FormatNumber(lngCom, 0, , , TriState.True)
ElseIf tbCel.ID = "iDFraisFixe" Then
tbCel.Text = "1 500"
ElseIf tbCel.ID = "iDMontantAgio" Then
tbCel.Text = FormatNumber(lngMontantAgio, 0, , , TriState.True)
ElseIf tbCel.ID = "iDTps" Then
tbCel.Text = FormatNumber(lngTPS, 0, , , TriState.True)
ElseIf tbCel.ID = "iDAgio" Then
If tbRow.Item("AGIO") = 1 Then tbCel.Text = "Agio à la charge du tire"
ElseIf tbCel.ID = "iDTotalInteret" Then
tbCel.Text = FormatNumber(lngTotalInteret, 0, , , TriState.True)
ElseIf tbCel.ID = "iDBoutonFixeFrais" Then
'Dim cmdB As New Button
'cmdB.CommandName = tbRow.Item("REFERENCE").ToString
'cmdB.ID = "cmdFixeFraix"
'tbCel.Controls.Add(cmdB)
ElseIf tbCel.ID = "iDHeader" Then
tbCel.Text = "FRAIS EFFET REF: [" & tbRow.Item("REFERENCE").ToString & "]"
End If
Next
Next
Dim tempRow As New TableRow()
Dim tempCell As New TableCell()
Dim tempTB As New Table
tempTB = tbSave
tempTB.ID = tbRow.Item("REFERENCE").ToString
tempCell.Controls.Add(tempTB)
tempRow.Cells.Add(tempCell)
tbLFrais.Controls.Add(tempRow)
Next tbRow
bln = True
End If
End If
ds.Dispose()
ds = Nothing
da.Disconnect()
da.Dispose()
da = Nothing
Return bln
End Function |
Partager