Public Class Form1
Private Sub cmdRemplir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRemplir.Click
Dim Continuer As String
Dim Tableau(9, 3) As Object
Dim Article As String
Dim PrixUnitaire, Quantité, TotalArticle As Integer
Dim Total, Transport, Ristourne, APayer As Single
Dim i, j, k, l As Integer
Continuer = "O"
For l = 0 To 9
Tableau(l, 0) = ""
Tableau(l, 1) = 0
Tableau(l, 2) = 0
Tableau(l, 3) = 0
Next l
Do While Continuer.ToUpper = "O"
Article = InputBox("Entrez le nom de l'article", "Article")
PrixUnitaire = InputBox("Entrez le prix unitaire", "Prix unitaire")
Quantité = InputBox("Entrez la quantité", "Quantité")
TotalArticle = PrixUnitaire * Quantité
Tableau(i, 0) = Article
Tableau(i, 1) = PrixUnitaire
Tableau(i, 2) = Quantité
Tableau(i, 3) = Tableau(i, 1) * Tableau(i, 2)
Continuer = InputBox("Un autre Article ? O/N")
i = i + 1
Loop
For j = 0 To i - 1
lblArticle.Text = lblArticle.Text & vbCrLf & Tableau(j, 0)
lblPU.Text = lblPU.Text & vbCrLf & CStr(Tableau(j, 1)) & "€"
lblQty.Text = lblQty.Text & vbCrLf & CStr(Tableau(j, 2))
lblTotalArt.Text = lblTotalArt.Text & vbCrLf & CStr(Tableau(j, 3))
Next j
For k = 0 To 9
Total = Total + Tableau(k, 3)
Next
If Total > 150 Then
Transport = 0
Else
Transport = 10
End If
If Total > 300 Then
Ristourne = Total * 0.3
Else
Ristourne = 0
End If
APayer = Total + Transport - Ristourne
lblTotal.Text = "Total: " & vbCrLf & "Transport: " & vbCrLf & "Ristourne: " & vbCrLf & "A payer: "
lblAPayer.Text = CStr(Total) & vbCrLf & CStr(Transport) & vbCrLf & CStr(Ristourne) & vbCrLf & CStr(APayer)
End Sub
Private Sub cmdQuitter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdQuitter.Click
End
End Sub
End Class