I have a button that will give a 15% discount to each line item in a datagridview - Off the "TotalPrice" Column.
The problem is when I press the button in the beginning of the transaction, it just keeps adding the discount to the first line item until the price reaches Zero.
If I click the button at the end of the transaction, once everything is rung up, then it works fine and applys the discount to each line item
Here My code:
The problem is when I press the button in the beginning of the transaction, it just keeps adding the discount to the first line item until the price reaches Zero.
If I click the button at the end of the transaction, once everything is rung up, then it works fine and applys the discount to each line item
Here My code:
Code:
If isMember = True Then
MsgBox("Member Found")
For Each DGVRow As DataGridViewRow In TransactionsScreen.ItemGridView.Rows
Dim DiscountPrice As Decimal
Dim TotalPriceBefore As Decimal = DGVRow.Cells("TotalPrice").Value
DiscountPrice = TotalPriceBefore - (0.15 * TotalPriceBefore)
DGVRow.Cells("TotalPrice").Value = DiscountPrice
Exit For
Next
Else
MsgBox("Member Not Added")
End If