1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Try
If DataGridView1.IsCurrentCellDirty Then
DataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
Dim i As Integer = Me.DataGridView1.CurrentRow.Index
If Not IsDBNull(Me.DataGridView1.Rows(i).Cells("DET_DEV_REMISE").Value) Then
Dim PUNET As Double
Dim remise As Double
remise = (100 - Val(Me.DataGridView1.Rows(i).Cells("DET_DEV_REMISE").Value)) / 100
PUNET = Val(Me.DataGridView1.Rows(i).Cells("DET_DEV_PUHT").Value) * remise
Me.DataGridView1.Rows(i).Cells("DET_DEV_PUNET").Value = Math.Round(PUNET, 2)
Dim MONT_HT As Double
MONT_HT = Val(Me.DataGridView1.Rows(i).Cells("DET_DEV_QTE").Value) * Val(Me.DataGridView1.Rows(i).Cells("DET_DEV_PUNET").Value)
Me.DataGridView1.Rows(i).Cells("DET_DEV_MONT").Value = Math.Round(MONT_HT, 2)
End If
Catch ex As Exception
MsgBox("Exception :" & ex.Message)
End Try |