Reconfigure for GIT

This commit is contained in:
2017-03-26 20:00:03 +02:00
commit 00637826ab
8056 changed files with 535977 additions and 0 deletions
@@ -0,0 +1,32 @@
Partial Class QuestionVC
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
MyClass.New()
'Required for Windows.Forms Class Composition Designer support
Container.Add(Me)
End Sub
'Component overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Component Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,72 @@
Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.ExpressApp.Filtering
Imports DevExpress.ExpressApp.Web.SystemModule
Imports DevExpress.ExpressApp.SystemModule
Public Class QuestionVC
Inherits SISBusiness.Module.QuestionVC 'Module.Web
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Id = "Question_ListView_Customers" Then
Frame.GetController(Of QuestionVC).aViewQuestionInfo.Active.SetItemValue("", True)
Frame.GetController(Of QuestionVC).aCreateWorkSheetfromQuestion.Active.SetItemValue("", False)
Frame.GetController(Of RefreshController).Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", False)
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", False)
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", False)
End If
If View.Id = "Question_ListView_User" Then
Frame.GetController(Of QuestionVC).aViewQuestionInfo.Active.SetItemValue("", True)
Frame.GetController(Of QuestionVC).aCreateWorkSheetfromQuestion.Active.SetItemValue("", False)
Frame.GetController(Of RefreshController).Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", False)
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", False)
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", False)
End If
If View.Id = "Installation_InstallationDocumentations_ListView_Support" Then
Frame.GetController(Of QuestionVC).aViewQuestionInfo.Active.SetItemValue("", False)
Frame.GetController(Of QuestionVC).aCreateWorkSheetfromQuestion.Active.SetItemValue("", False)
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", False)
End If
If View.Id = "Question_DetailView_User" Then
Frame.GetController(Of DetailViewController).Active.SetItemValue("", False)
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of QuestionVC).aCreateQuestion.Active.SetItemValue("", True)
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", False)
End If
If View.Id = "Question_DetailView_Info" Then
Frame.GetController(Of DetailViewController).Active.SetItemValue("", False)
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", False)
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", False)
If View.Id = "Question_DetailView_User" Then
Frame.GetController(Of DetailViewController).Active.SetItemValue("", True)
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", True)
Frame.GetController(Of QuestionVC).aCreateQuestion.Active.SetItemValue("", False)
End If
If View.Id = "Question_DetailView_Info" Then
Frame.GetController(Of DetailViewController).Active.SetItemValue("", True)
End If
End Sub
End Class
@@ -0,0 +1,71 @@
Partial Class Support_VC
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
MyClass.New()
'Required for Windows.Forms Class Composition Designer support
Container.Add(Me)
End Sub
'Component overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Component Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.aSupportNavigationDisable = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
Me.aSupportNavigationEnable = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
'
'aSupportNavigationDisable
'
Me.aSupportNavigationDisable.AcceptButtonCaption = Nothing
Me.aSupportNavigationDisable.CancelButtonCaption = Nothing
Me.aSupportNavigationDisable.Caption = "aSupport Navigation Disable"
Me.aSupportNavigationDisable.ConfirmationMessage = Nothing
Me.aSupportNavigationDisable.Id = "aSupportNavigationDisable"
Me.aSupportNavigationDisable.ImageName = Nothing
Me.aSupportNavigationDisable.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject
Me.aSupportNavigationDisable.Shortcut = Nothing
Me.aSupportNavigationDisable.Tag = Nothing
Me.aSupportNavigationDisable.TargetObjectsCriteria = Nothing
Me.aSupportNavigationDisable.TargetObjectType = GetType(SISBusiness.[Module].SupportRoles)
Me.aSupportNavigationDisable.TargetViewId = Nothing
Me.aSupportNavigationDisable.ToolTip = Nothing
Me.aSupportNavigationDisable.TypeOfView = Nothing
'
'aSupportNavigationEnable
'
Me.aSupportNavigationEnable.AcceptButtonCaption = Nothing
Me.aSupportNavigationEnable.CancelButtonCaption = Nothing
Me.aSupportNavigationEnable.Caption = "aSupport Navigation Enable"
Me.aSupportNavigationEnable.ConfirmationMessage = Nothing
Me.aSupportNavigationEnable.Id = "aSupportNavigationEnable"
Me.aSupportNavigationEnable.ImageName = Nothing
Me.aSupportNavigationEnable.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject
Me.aSupportNavigationEnable.Shortcut = Nothing
Me.aSupportNavigationEnable.Tag = Nothing
Me.aSupportNavigationEnable.TargetObjectsCriteria = Nothing
Me.aSupportNavigationEnable.TargetObjectType = GetType(SISBusiness.[Module].SupportRoles)
Me.aSupportNavigationEnable.TargetViewId = Nothing
Me.aSupportNavigationEnable.ToolTip = Nothing
Me.aSupportNavigationEnable.TypeOfView = Nothing
End Sub
Friend WithEvents aSupportNavigationDisable As DevExpress.ExpressApp.Actions.PopupWindowShowAction
Friend WithEvents aSupportNavigationEnable As DevExpress.ExpressApp.Actions.PopupWindowShowAction
End Class
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="aSupportNavigationDisable.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="aSupportNavigationEnable.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>218, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,308 @@
Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.ExpressApp.Web.SystemModule
Public Class Support_VC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Id = "SupportRoles_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", False)
End If
If View.Id = "CRM_Opportunities_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", False)
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User = ?", _ocur.GetObject(SecuritySystem.CurrentUser)))
If _Contacts IsNot Nothing Then
If _Contacts.Customers IsNot Nothing Then
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("Customers.Oid = ?", _Contacts.Customers.Oid)
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
End If
If View.Id = "OfferOutHeader_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", False)
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User = ?", _ocur.GetObject(SecuritySystem.CurrentUser)))
If _Contacts IsNot Nothing Then
If _Contacts.Customers IsNot Nothing Then
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("Customers.Oid = ?", _Contacts.Customers.Oid)
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
End If
If View.Id = "WorkSheet_Header_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", False)
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User = ?", _ocur.GetObject(SecuritySystem.CurrentUser)))
If _Contacts IsNot Nothing Then
If _Contacts.Customers IsNot Nothing Then
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("Customers.Oid = ?", _Contacts.Customers.Oid)
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
End If
If View.Id = "Contracts_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", False)
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User = ?", _ocur.GetObject(SecuritySystem.CurrentUser)))
If _Contacts IsNot Nothing Then
If _Contacts.Customers IsNot Nothing Then
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("Customers.Oid = ?", _Contacts.Customers.Oid)
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
End If
If View.Id = "PCIGroup_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", False)
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User = ?", _ocur.GetObject(SecuritySystem.CurrentUser)))
If _Contacts IsNot Nothing Then
If _Contacts.Customers IsNot Nothing Then
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("Customers.Oid = ?", _Contacts.Customers.Oid)
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
Else
TryCast(View, ListView).CollectionSource.Criteria("ByPartner") = CriteriaOperator.Parse("1=2")
End If
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
If View.Id = "SupportRoles_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", True)
End If
If View.Id = "CRM_Opportunities_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", True)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", True)
End If
If View.Id = "OfferOutHeader_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", True)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", True)
End If
If View.Id = "WorkSheet_Header_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", True)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", True)
End If
If View.Id = "Contracts_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", True)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", True)
End If
If View.Id = "PCIGroup_ListView_Support" Then
Frame.GetController(Of ListViewController).EditAction.Active.SetItemValue("", True)
Frame.GetController(Of ListViewProcessCurrentObjectController).Active.SetItemValue("", True)
End If
End Sub
Private Sub aSupportNavigationEnable_CustomizePopupWindowParams(sender As Object, e As DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventArgs) Handles aSupportNavigationEnable.CustomizePopupWindowParams
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _uow As New UnitOfWork(_onew.Session.DataLayer)
Dim _MasterKey As Guid = SecuritySystem.CurrentUserId
Dim _ModelNavigation_Collection As New XPCollection(Of ModelNavigation)(_uow, CriteriaOperator.Parse("MasterKey=?", _MasterKey))
_uow.Delete(_ModelNavigation_Collection)
_uow.CommitChanges()
If View.SelectedObjects.Count = 1 Then
Dim _SupportRoles As SupportRoles = TryCast(View.SelectedObjects(0), SupportRoles)
If _SupportRoles IsNot Nothing Then
Dim _NavigationItemRole_Collection As New XPCollection(Of NavigationItemRole)(_onew.Session, CriteriaOperator.Parse("SupportRoles.Oid=?", _SupportRoles.Oid))
Dim _NavigationItemRole As NavigationItemRole
Dim _ModelNavigation As ModelNavigation
Dim _IModelNavigationItems As IModelNavigationItems
Dim _IModelNavigationItem As IModelNavigationItem
Dim _NavigationItems As IModelRootNavigationItems = DirectCast(Application.Model, IModelApplicationNavigationItems).NavigationItems
_IModelNavigationItems = TryCast(_NavigationItems.Items, IModelNavigationItems)
For Each _IModelNavigationItem In _IModelNavigationItems
RecursiveAddModelNavigation(_uow, _MasterKey, Nothing, _IModelNavigationItem)
Next
_uow.CommitChanges()
Dim _CS As CollectionSource = New CollectionSource(_onew, GetType(ModelNavigation))
_CS.BeginUpdateCriteria()
_CS.Criteria.Add("Filter1", CriteriaOperator.Parse("MasterKey=?", _MasterKey))
_CS.EndUpdateCriteria()
_CS.Sorting.Add(New SortProperty("Index", DB.SortingDirection.Ascending))
For Each _ModelNavigation In _CS.Collection
For Each _NavigationItemRole In _NavigationItemRole_Collection
If _NavigationItemRole.ChoiceActionItemId = _ModelNavigation.Name Then
RecursiveDeny(_ModelNavigation)
End If
Next
Next
e.View = Application.CreateListView("ModelNavigation_ListView", _CS, False)
If _SupportRoles IsNot Nothing Then
e.View.Caption += " (" & _SupportRoles.ShortName & ")"
End If
End If
End If
End Sub
Private Sub aSupportNavigationEnable_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs) Handles aSupportNavigationEnable.Execute
Dim _ModelNavigation As ModelNavigation
Dim _NavigationItemRole As NavigationItemRole
Dim _ocur As IObjectSpace = View.ObjectSpace
Dim _SupportRoles As SupportRoles
For Each _SupportRoles In View.SelectedObjects
For Each _ModelNavigation In e.PopupWindow.View.SelectedObjects
_NavigationItemRole = _ocur.FindObject(Of NavigationItemRole)(CriteriaOperator.Parse("SupportRoles.Oid=? and ChoiceActionItemId=?", _SupportRoles.Oid, _ModelNavigation.Name))
If _NavigationItemRole IsNot Nothing Then
_ocur.Delete(_NavigationItemRole)
End If
Next
Next
_ocur.CommitChanges()
End Sub
Private Sub aSupportNavigationDisable_CustomizePopupWindowParams(sender As Object, e As DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventArgs) Handles aSupportNavigationDisable.CustomizePopupWindowParams
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _uow As New UnitOfWork(_onew.Session.DataLayer)
Dim _MasterKey As Guid = SecuritySystem.CurrentUserId
Dim _ModelNavigation_Collection As New XPCollection(Of ModelNavigation)(_uow, CriteriaOperator.Parse("MasterKey=?", _MasterKey))
_uow.Delete(_ModelNavigation_Collection)
_uow.CommitChanges()
If View.SelectedObjects.Count = 1 Then
Dim _SupportRoles As SupportRoles = TryCast(View.SelectedObjects(0), SupportRoles)
If _SupportRoles IsNot Nothing Then
Dim _NavigationItemRole_Collection As New XPCollection(Of NavigationItemRole)(_onew.Session, CriteriaOperator.Parse("SupportRoles.Oid=?", _SupportRoles.Oid))
Dim _NavigationItemRole As NavigationItemRole
Dim _ModelNavigation As ModelNavigation
Dim _IModelNavigationItems As IModelNavigationItems
Dim _IModelNavigationItem As IModelNavigationItem
Dim _NavigationItems As IModelRootNavigationItems = DirectCast(Application.Model, IModelApplicationNavigationItems).NavigationItems
_IModelNavigationItems = TryCast(_NavigationItems.Items, IModelNavigationItems)
For Each _IModelNavigationItem In _IModelNavigationItems
RecursiveAddModelNavigation(_uow, _MasterKey, Nothing, _IModelNavigationItem)
Next
_uow.CommitChanges()
Dim _CS As CollectionSource = New CollectionSource(_onew, GetType(ModelNavigation))
_CS.BeginUpdateCriteria()
_CS.Criteria.Add("Filter1", CriteriaOperator.Parse("MasterKey=?", _MasterKey))
_CS.EndUpdateCriteria()
_CS.Sorting.Add(New SortProperty("Index", DB.SortingDirection.Ascending))
For Each _ModelNavigation In _CS.Collection
For Each _NavigationItemRole In _NavigationItemRole_Collection
If _NavigationItemRole.ChoiceActionItemId = _ModelNavigation.Name Then
RecursiveDeny(_ModelNavigation)
End If
Next
Next
e.View = Application.CreateListView("ModelNavigation_ListView", _CS, False)
If _SupportRoles IsNot Nothing Then
e.View.Caption += " (" & _SupportRoles.ShortName & ")"
End If
End If
End If
End Sub
Private Sub aSupportNavigationDisable_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs) Handles aSupportNavigationDisable.Execute
Dim _ModelNavigation As ModelNavigation
Dim _NavigationItemRole As NavigationItemRole
Dim _ocur As IObjectSpace = View.ObjectSpace
Dim _SupportRoles As SupportRoles
For Each _SupportRoles In View.SelectedObjects
For Each _ModelNavigation In e.PopupWindow.View.SelectedObjects
_NavigationItemRole = _ocur.FindObject(Of NavigationItemRole)(CriteriaOperator.Parse("SupportRoles.Oid=? and ChoiceActionItemId=?", _SupportRoles.Oid, _ModelNavigation.Name))
If _NavigationItemRole Is Nothing Then
_NavigationItemRole = _ocur.CreateObject(Of NavigationItemRole)()
_NavigationItemRole.SupportRoles = _ocur.GetObject(_SupportRoles)
_NavigationItemRole.ChoiceActionItemId = _ModelNavigation.Name
End If
Next
Next
_ocur.CommitChanges()
End Sub
Sub RecursiveAddModelNavigation(_uow As UnitOfWork, _MasterKey As Guid, _ModelNavigationParent As ModelNavigation, _IModelNavigationItem As IModelNavigationItem)
Dim _ModelNavigation As ModelNavigation
Dim _IModelNavigationItem_Child As IModelNavigationItem
_ModelNavigation = New ModelNavigation(_uow)
_ModelNavigation.Parent = _ModelNavigationParent
_ModelNavigation.Name = _IModelNavigationItem.Id
_ModelNavigation.Navigation_Caption = _IModelNavigationItem.Caption
_ModelNavigation.Navigation_ImageName = _IModelNavigationItem.ImageName
_ModelNavigation.MasterKey = _MasterKey
_uow.CommitChanges()
If _IModelNavigationItem.Items.Count > 0 Then
For Each _IModelNavigationItem_Child In _IModelNavigationItem.Items
RecursiveAddModelNavigation(_uow, _MasterKey, _ModelNavigation, _IModelNavigationItem_Child)
Next
End If
End Sub
Sub RecursiveDeny(_ModelNavigation As ModelNavigation)
Dim _ModelNavigation_Children As ModelNavigation
_ModelNavigation.Navigation_Enabled = False
If _ModelNavigation.Children.Count > 0 Then
For Each _ModelNavigation_Children In _ModelNavigation.Children
RecursiveDeny(_ModelNavigation_Children)
Next
End If
End Sub
End Class