Files
2017-03-26 20:00:03 +02:00

48 lines
2.3 KiB
VB.net

Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Data.Filtering
Public Class SISShowNavigationItemController
Inherits ShowNavigationItemController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub ShowNavigationItem(args As DevExpress.ExpressApp.Actions.SingleChoiceActionExecuteEventArgs)
If args.SelectedChoiceActionItem IsNot Nothing AndAlso args.SelectedChoiceActionItem.Enabled = True Then
If args.SelectedChoiceActionItem.Id = "@OrderInToDispose" Then
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _UserCreated = _onew.GetObjectByKey(Of User)(_onew.GetKeyValue(SecuritySystem.CurrentUser))
Dim _OrderInToDispose As OrderInToDispose = _onew.FindObject(Of OrderInToDispose)(CriteriaOperator.Parse("UserCreated=?", _UserCreated))
If _OrderInToDispose Is Nothing Then
_OrderInToDispose = _onew.CreateObject(Of OrderInToDispose)()
_onew.CommitChanges()
End If
args.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "OrderInToDispose_DetailView", True, _OrderInToDispose)
ElseIf args.SelectedChoiceActionItem.Id = "@ProductFinder" Then
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ProductFinder As ProductFinder = _onew.CreateObject(Of ProductFinder)()
_ProductFinder.MasterKey = Guid.NewGuid
args.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "ProductFinder_DetailView", True, _ProductFinder)
ElseIf args.SelectedChoiceActionItem.Id = "@ServiceFinder" Then
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ServiceFinder As ServiceFinder = _onew.CreateObject(Of ServiceFinder)()
_ServiceFinder.MasterKey = Guid.NewGuid
args.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "ServiceFinder_DetailView", True, _ServiceFinder)
Else
MyBase.ShowNavigationItem(args)
End If
End If
End Sub
End Class