Plugin that kills performance
When I enabled the attached plugin, the system grinds to a halt.
Imports JiwaFinancials.Jiwa
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Data.SqlClient
Imports System.Drawing
Imports System.Data
Public Class FormPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaFormPlugin
Private salesOrderForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub SetupBeforeHandlers(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.SetupBeforeHandlers
End Sub
Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
salesOrderForm = DirectCast(JiwaForm, JiwaSalesUI.SalesOrder.SalesOrderEntryForm)
AddHandler salesOrderForm.SalesOrder.SaveEnd , AddressOf SalesOrderSaveEnd
End Sub
Private Sub SalesOrderSaveEnd(sender As Object, e As System.EventArgs )
If salesOrderForm.SalesOrder.SalesOrderLines.Count > 0 Then
For Each salesOrderLine As JiwaSales.SalesOrder.SalesOrderLine In salesOrderForm.SalesOrder.SalesOrderLines
If salesOrderLine.CostIn <> 0 Then
salesOrderLine.UserDefinedFloat1 = (((salesOrderLine.LineTotal/salesOrderLine.QuantityThisDelivery) - salesOrderLine.CostIn)/ salesOrderLine.CostIn)*100
Else
salesOrderLine.UserDefinedFloat1 = 0
End If
Next
salesOrderForm.SalesOrder.Save
End If
End Sub
End Class
Public Class BusinessLogicPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaBusinessLogicPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub Setup(ByVal JiwaBusinessLogic As JiwaApplication.IJiwaBusinessLogic, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaBusinessLogicPlugin.Setup
End Sub
End Class
Public Class ApplicationManagerPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaApplicationManagerPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub Setup(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaApplicationManagerPlugin.Setup
End Sub
End Class
Public Class CustomFieldPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaCustomFieldPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.FormatCell
End Sub
Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.ReadData
End Sub
Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.ButtonClicked
End Sub
End Class
Public Class LineCustomFieldPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaLineCustomFieldPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.FormatCell
End Sub
Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.ReadData
End Sub
Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.ButtonClicked
End Sub
End Class
Public Class SystemSettingPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaSystemSettingPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.FormatCell
End Sub
Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.ReadData
End Sub
Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.ButtonClicked
End Sub
End Class
Public Class ScheduledExecutionPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaScheduledExecutionPlugin
Public Sub Execute(ByVal Plugin As JiwaApplication.Plugin.Plugin, ByVal Schedule As JiwaApplication.Schedule.Schedule) Implements JiwaApplication.IJiwaScheduledExecutionPlugin.Execute
End Sub
Public Sub OnServiceStart(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaScheduledExecutionPlugin.OnServiceStart
End Sub
Public Sub OnServiceStopping(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaScheduledExecutionPlugin.OnServiceStopping
End Sub
End Class
Imports JiwaFinancials.Jiwa
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Data.SqlClient
Imports System.Drawing
Imports System.Data
Public Class FormPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaFormPlugin
Private salesOrderForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub SetupBeforeHandlers(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.SetupBeforeHandlers
End Sub
Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
salesOrderForm = DirectCast(JiwaForm, JiwaSalesUI.SalesOrder.SalesOrderEntryForm)
AddHandler salesOrderForm.SalesOrder.SaveEnd , AddressOf SalesOrderSaveEnd
End Sub
Private Sub SalesOrderSaveEnd(sender As Object, e As System.EventArgs )
If salesOrderForm.SalesOrder.SalesOrderLines.Count > 0 Then
For Each salesOrderLine As JiwaSales.SalesOrder.SalesOrderLine In salesOrderForm.SalesOrder.SalesOrderLines
If salesOrderLine.CostIn <> 0 Then
salesOrderLine.UserDefinedFloat1 = (((salesOrderLine.LineTotal/salesOrderLine.QuantityThisDelivery) - salesOrderLine.CostIn)/ salesOrderLine.CostIn)*100
Else
salesOrderLine.UserDefinedFloat1 = 0
End If
Next
salesOrderForm.SalesOrder.Save
End If
End Sub
End Class
Public Class BusinessLogicPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaBusinessLogicPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub Setup(ByVal JiwaBusinessLogic As JiwaApplication.IJiwaBusinessLogic, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaBusinessLogicPlugin.Setup
End Sub
End Class
Public Class ApplicationManagerPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaApplicationManagerPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub Setup(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaApplicationManagerPlugin.Setup
End Sub
End Class
Public Class CustomFieldPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaCustomFieldPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.FormatCell
End Sub
Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.ReadData
End Sub
Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.ButtonClicked
End Sub
End Class
Public Class LineCustomFieldPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaLineCustomFieldPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.FormatCell
End Sub
Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.ReadData
End Sub
Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.ButtonClicked
End Sub
End Class
Public Class SystemSettingPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaSystemSettingPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.FormatCell
End Sub
Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.ReadData
End Sub
Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.ButtonClicked
End Sub
End Class
Public Class ScheduledExecutionPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaScheduledExecutionPlugin
Public Sub Execute(ByVal Plugin As JiwaApplication.Plugin.Plugin, ByVal Schedule As JiwaApplication.Schedule.Schedule) Implements JiwaApplication.IJiwaScheduledExecutionPlugin.Execute
End Sub
Public Sub OnServiceStart(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaScheduledExecutionPlugin.OnServiceStart
End Sub
Public Sub OnServiceStopping(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaScheduledExecutionPlugin.OnServiceStopping
End Sub
End Class