'commit to the database
For Each oRow As DataRow In Me.RadGridView1.DataSource.rows
If oRow.RowState = DataRowState.Deleted Then
intRowID = oRow("lRowID", DataRowVersion.Original)
Else
intRowID = oRow("lRowID")
strItemNumber = oRow("vchrItemNumberGP")
strUofM = oRow("vchrUnitOfMeasureGP")
decQuantity = oRow("intQuantity")
strBaseUofM = oRow("sBaseUofM")
decBaseUofMQuantity = oRow("fltBaseUofMQuantity")
decCalculatedQty = oRow("intCalculatedQty")
decTaxAmount = oRow("curTaxAmount")
strWarehouse = oRow("vchrLocationCodeGP")
strItemLot = oRow("vchrLotnmbrGP")
strNotes = oRow("txtItemNotes")
decExtendedPrice = oRow("curExtendedPrice")
bInactive = oRow("inactive")
decGPPrice = oRow("curGPPrice")
decItemPrice = oRow("curItemPrice")
decItemPriceUofM = oRow("curItemPriceUofM")
End If
Select Case oRow.RowState
Case DataRowState.Added
DynData.SPs.FP_MasterOrderItems_INS(_UUID.ToString, strItemNumber, "",
"", "", "", "", strUofM, strBaseUofM, decBaseUofMQuantity, decQuantity, decQuantity / decBaseUofMQuantity,
Me.txtReqShipDate.Value, decGPPrice, decItemPrice,
decItemPriceUofM, decExtendedPrice, decTaxAmount,
strWarehouse, strItemLot, False,
strNotes, appUser.UserName, appUser.Db).execute()
Case DataRowState.Deleted
DynData.SPs.FP_MasterOrderItems_DEL_byRowID(intRowID, 0, appUser.UserName, appUser.Db).execute()
Case DataRowState.Modified
Dim intRetVal As Int32 = DynData.SPs.FP_MasterOrderItems_UPD_byRowID2("", strUofM,
strBaseUofM, decBaseUofMQuantity, decQuantity, decCalculatedQty,
Me.txtReqShipDate.Value, decItemPrice, decItemPriceUofM,
decExtendedPrice, decTaxAmount,
strWarehouse, strItemLot, strNotes,
intRowID, 0, appUser.UserName, bInactive, appUser.Db).execute
End Select
Next
Me.RadGridView1.DataSource.AcceptChanges()