Thanks for sharing the code converted to VB.NET - I'm sure it will help some people.
On that note, I think it's time you were educated on the Code tag which you can use in your posts to post code snippets so they are formatted correctly.
The toolbar above the post content area has a button labelled "Code":
- CodeButton.PNG (5.38 KiB) Viewed 449 times
When you click that, it adds the [
code] and [
/code] BBCode tags. Text you place between those tags will be formatted as such:
- Code: Select all
Public Sub Setup(ByVal JiwaBusinessLogic As JiwaApplication.IJiwaBusinessLogic, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaBusinessLogicPlugin.Setup
If TypeOf JiwaBusinessLogic Is JiwaSales.SalesOrder.SalesOrder Then
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast(JiwaBusinessLogic, JiwaSales.SalesOrder.SalesOrder)
AddHandler salesOrder.BackorderProcessStart, AddressOf SalesOrder_BackorderProcessStart
End If
End Sub
Private Sub SalesOrder_BackorderProcessStart(sender As Object,ByVal InvoiceLineID As String, ByVal QuantityToFulfill As Decimal)
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast(sender, JiwaSales.SalesOrder.SalesOrder)
AddHandler SalesOrder.CreatedNewSnapshot, AddressOf SalesOrder_CreatedNewSnapshot
End Sub
Private Sub SalesOrder_CreatedNewSnapshot(sender As Object, e As System.EventArgs)
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast(sender, JiwaSales.SalesOrder.SalesOrder)
msgbox ("in Create new snapshot-Mike")
Dim SalesOrderH As JiwaSales.SalesOrder.SalesOrderHistory = salesOrder.SalesOrderHistorys(salesorder.CurrentHistoryNo)
' // If we Get here, Then it's because the backorder process ended up creating a new snapshot for the sales order
' // We don't get in here when a new snapshot is created manually because we only add a handler for the CreatedNewSnapshot event inside a BackorderProcessStart handler.
End Sub
It makes it more readable - which can only be a good thing!