1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| '.........
articlesconso.Add(New articleconso With {.reference = parts(0), .quantite = parts(4), .designation = parts(1), .couleur = parts(2), .conditionnement = parts(3)})
Dim grouped = articlesconso _
.GroupBy(Function(articleconso) New With {Key articleconso.reference, Key articleconso.designation, Key articleconso.couleur, Key articleconso.conditionnement}) _
.Select(Function(selected) New With {.Name = selected.Key.reference, .design = selected.Key.designation, .Color = selected.Key.couleur, .condi = selected.Key.conditionnement, .Quantity = selected.Sum(Function(it) it.quantite)})
For Each group In grouped
Dim LVI As ListViewItem = lvconso.Items.Add(group.Name)
LVI.SubItems.Add(group.Color)
LVI.SubItems.Add(group.condi)
LVI.SubItems.Add(group.design)
LVI.SubItems.Add(group.Quantity)
Next |