First create solution
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.ExpressApp.Security
|
||||
|
||||
Imports DevExpress.Persistent.AuditTrail
|
||||
Imports Microsoft.VisualBasic
|
||||
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
|
||||
Imports DevExpress.ExpressApp.Model.Core
|
||||
Imports DevExpress.ExpressApp.Model
|
||||
Imports Nuvolar.Module
|
||||
Imports DevExpress.ExpressApp.Web
|
||||
|
||||
Public Class UserStore
|
||||
Inherits ModelDifferenceStore
|
||||
Private Shared ReadOnly xmlHeader As String = "<?xml version=""1.0"" encoding=""utf-8""?>" & System.Environment.NewLine
|
||||
Private application As WebApplication
|
||||
|
||||
Public Overrides ReadOnly Property Name() As String
|
||||
Get
|
||||
Return "UserStore"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(ByVal WebApplication As WebApplication)
|
||||
application = WebApplication
|
||||
End Sub
|
||||
|
||||
Private Function FindStoreByAspect(ByVal stores As XPCollection(Of XmlStore), ByVal aspect As String) As XmlStore
|
||||
For Each store As XmlStore In stores
|
||||
If store.Aspect = aspect Then
|
||||
Return store
|
||||
End If
|
||||
Next store
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Private Function FindXmlUserByCurrentUser() As XmlUser
|
||||
Dim objectSpace As IObjectSpace = application.CreateObjectSpace()
|
||||
Dim currentUser As DevExpress.Persistent.BaseImpl.User = objectSpace.GetObject(CType(SecuritySystem.CurrentUser, DevExpress.Persistent.BaseImpl.User))
|
||||
Dim user As XmlUser = Nothing
|
||||
Try
|
||||
user = objectSpace.FindObject(Of XmlUser)(CriteriaOperator.Parse("User=?", currentUser), True)
|
||||
Catch
|
||||
End Try
|
||||
Return user
|
||||
End Function
|
||||
|
||||
Public Overrides Sub Load(ByVal model As ModelApplicationBase)
|
||||
Dim xmlReader As New ModelXmlReader()
|
||||
Dim user As XmlUser = FindXmlUserByCurrentUser()
|
||||
If user IsNot Nothing Then
|
||||
For Each store As XmlStore In user.Aspects
|
||||
xmlReader.ReadFromString(model, store.Aspect, store.XmlData)
|
||||
Next store
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub SaveDifference(ByVal model As ModelApplicationBase)
|
||||
Dim objectSpace As IObjectSpace = application.CreateObjectSpace()
|
||||
Dim user As XmlUser = objectSpace.GetObject(FindXmlUserByCurrentUser())
|
||||
If user Is Nothing Then
|
||||
user = New XmlUser(TryCast(objectSpace, Xpo.XPObjectSpace).Session)
|
||||
user.User = objectSpace.GetObject(CType(SecuritySystem.CurrentUser, DevExpress.Persistent.BaseImpl.User))
|
||||
End If
|
||||
For i As Integer = 0 To model.AspectCount - 1
|
||||
Dim xmlWriter As New ModelXmlWriter()
|
||||
Dim aspect As String = model.GetAspect(i)
|
||||
Dim xmlContent As String = xmlWriter.WriteToString(model, i)
|
||||
If (Not String.IsNullOrEmpty(xmlContent)) Then
|
||||
Dim store As XmlStore = FindStoreByAspect(user.Aspects, aspect)
|
||||
If store Is Nothing Then
|
||||
store = New XmlStore(TryCast(objectSpace, Xpo.XPObjectSpace).Session)
|
||||
End If
|
||||
store.User = user
|
||||
store.Aspect = aspect
|
||||
store.XmlData = xmlHeader & xmlContent
|
||||
End If
|
||||
Next i
|
||||
objectSpace.CommitChanges()
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
</root>
|
||||
@@ -0,0 +1,199 @@
|
||||
Imports Microsoft.VisualBasic
|
||||
Imports System
|
||||
Imports System.Collections.Generic
|
||||
Imports System.ComponentModel
|
||||
Imports DevExpress.ExpressApp.Web
|
||||
Imports DevExpress.ExpressApp.Xpo
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Partial Public Class NuvolarAspNetApplication
|
||||
Inherits WebApplication
|
||||
Private module1 As DevExpress.ExpressApp.SystemModule.SystemModule
|
||||
Private module2 As DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule
|
||||
Private module3 As Nuvolar.Module.NuvolarModule
|
||||
Private module4 As Nuvolar.Module.Web.NuvolarAspNetModule
|
||||
Private module5 As DevExpress.ExpressApp.Validation.ValidationModule
|
||||
Private module6 As DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule
|
||||
Private securityModule1 As DevExpress.ExpressApp.Security.SecurityModule
|
||||
Friend WithEvents AuditTrailModule1 As DevExpress.ExpressApp.AuditTrail.AuditTrailModule
|
||||
Friend WithEvents CloneObjectModule1 As DevExpress.ExpressApp.CloneObject.CloneObjectModule
|
||||
Friend WithEvents ConditionalAppearanceModule1 As DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule
|
||||
Friend WithEvents ViewVariantsModule1 As DevExpress.ExpressApp.ViewVariantsModule.ViewVariantsModule
|
||||
Friend WithEvents AuthenticationStandard1 As DevExpress.ExpressApp.Security.AuthenticationStandard
|
||||
Friend WithEvents SecurityComplex1 As DevExpress.ExpressApp.Security.SecurityComplex
|
||||
Friend WithEvents ChartAspNetModule1 As DevExpress.ExpressApp.Chart.Web.ChartAspNetModule
|
||||
Friend WithEvents ChartModule1 As DevExpress.ExpressApp.Chart.ChartModule
|
||||
Friend WithEvents FileAttachmentsAspNetModule1 As DevExpress.ExpressApp.FileAttachments.Web.FileAttachmentsAspNetModule
|
||||
Friend WithEvents HtmlPropertyEditorAspNetModule1 As DevExpress.ExpressApp.HtmlPropertyEditor.Web.HtmlPropertyEditorAspNetModule
|
||||
Friend WithEvents KpiModule1 As DevExpress.ExpressApp.Kpi.KpiModule
|
||||
Friend WithEvents PivotChartAspNetModule1 As DevExpress.ExpressApp.PivotChart.Web.PivotChartAspNetModule
|
||||
Friend WithEvents PivotChartModuleBase1 As DevExpress.ExpressApp.PivotChart.PivotChartModuleBase
|
||||
Friend WithEvents PivotGridAspNetModule1 As DevExpress.ExpressApp.PivotGrid.Web.PivotGridAspNetModule
|
||||
Friend WithEvents PivotGridModule1 As DevExpress.ExpressApp.PivotGrid.PivotGridModule
|
||||
Friend WithEvents ReportsAspNetModule1 As DevExpress.ExpressApp.Reports.Web.ReportsAspNetModule
|
||||
Friend WithEvents ReportsModule1 As DevExpress.ExpressApp.Reports.ReportsModule
|
||||
Friend WithEvents SchedulerAspNetModule1 As DevExpress.ExpressApp.Scheduler.Web.SchedulerAspNetModule
|
||||
Friend WithEvents SchedulerModuleBase1 As DevExpress.ExpressApp.Scheduler.SchedulerModuleBase
|
||||
Friend WithEvents TreeListEditorsAspNetModule1 As DevExpress.ExpressApp.TreeListEditors.Web.TreeListEditorsAspNetModule
|
||||
Friend WithEvents TreeListEditorsModuleBase1 As DevExpress.ExpressApp.TreeListEditors.TreeListEditorsModuleBase
|
||||
|
||||
Private sqlConnection1 As System.Data.SqlClient.SqlConnection
|
||||
|
||||
Public Sub New()
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Private Sub NuvolarAspNetApplication_DatabaseVersionMismatch(ByVal sender As Object, ByVal e As DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs) Handles MyBase.DatabaseVersionMismatch
|
||||
#If EASYTEST Then
|
||||
e.Updater.Update()
|
||||
e.Handled = True
|
||||
#Else
|
||||
If System.Diagnostics.Debugger.IsAttached Then
|
||||
e.Updater.Update()
|
||||
e.Handled = True
|
||||
Else
|
||||
Throw New InvalidOperationException(
|
||||
"The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application." & Constants.vbCrLf &
|
||||
"This error occurred because the automatic database update was disabled when the application was started without debugging." & Constants.vbCrLf &
|
||||
"To avoid this error, you should either start the application under Visual Studio in debug mode, or modify the " &
|
||||
"source code of the 'DatabaseVersionMismatch' event handler to enable automatic database update, " &
|
||||
"or manually create a database using the 'DBUpdater' tool." & Constants.vbCrLf &
|
||||
"Anyway, refer to the 'Update Application and Database Versions' help topic at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2795.htm " &
|
||||
"for more detailed information. If this doesn't help, please contact our Support Team at http://www.devexpress.com/Support/Center/")
|
||||
End If
|
||||
#End If
|
||||
End Sub
|
||||
Protected Overrides Sub CreateDefaultObjectSpaceProvider(args As CreateCustomObjectSpaceProviderEventArgs)
|
||||
args.ObjectSpaceProvider = New XPObjectSpaceProvider(args.ConnectionString, args.Connection, True)
|
||||
End Sub
|
||||
Private Sub InitializeComponent()
|
||||
Me.module1 = New DevExpress.ExpressApp.SystemModule.SystemModule()
|
||||
Me.module2 = New DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule()
|
||||
Me.module3 = New Nuvolar.[Module].NuvolarModule()
|
||||
Me.module4 = New Nuvolar.[Module].Web.NuvolarAspNetModule()
|
||||
Me.module5 = New DevExpress.ExpressApp.Validation.ValidationModule()
|
||||
Me.module6 = New DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule()
|
||||
Me.securityModule1 = New DevExpress.ExpressApp.Security.SecurityModule()
|
||||
Me.sqlConnection1 = New System.Data.SqlClient.SqlConnection()
|
||||
Me.AuditTrailModule1 = New DevExpress.ExpressApp.AuditTrail.AuditTrailModule()
|
||||
Me.CloneObjectModule1 = New DevExpress.ExpressApp.CloneObject.CloneObjectModule()
|
||||
Me.ConditionalAppearanceModule1 = New DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule()
|
||||
Me.ViewVariantsModule1 = New DevExpress.ExpressApp.ViewVariantsModule.ViewVariantsModule()
|
||||
Me.AuthenticationStandard1 = New DevExpress.ExpressApp.Security.AuthenticationStandard()
|
||||
Me.SecurityComplex1 = New DevExpress.ExpressApp.Security.SecurityComplex()
|
||||
Me.ChartAspNetModule1 = New DevExpress.ExpressApp.Chart.Web.ChartAspNetModule()
|
||||
Me.ChartModule1 = New DevExpress.ExpressApp.Chart.ChartModule()
|
||||
Me.FileAttachmentsAspNetModule1 = New DevExpress.ExpressApp.FileAttachments.Web.FileAttachmentsAspNetModule()
|
||||
Me.HtmlPropertyEditorAspNetModule1 = New DevExpress.ExpressApp.HtmlPropertyEditor.Web.HtmlPropertyEditorAspNetModule()
|
||||
Me.KpiModule1 = New DevExpress.ExpressApp.Kpi.KpiModule()
|
||||
Me.PivotChartAspNetModule1 = New DevExpress.ExpressApp.PivotChart.Web.PivotChartAspNetModule()
|
||||
Me.PivotChartModuleBase1 = New DevExpress.ExpressApp.PivotChart.PivotChartModuleBase()
|
||||
Me.PivotGridAspNetModule1 = New DevExpress.ExpressApp.PivotGrid.Web.PivotGridAspNetModule()
|
||||
Me.PivotGridModule1 = New DevExpress.ExpressApp.PivotGrid.PivotGridModule()
|
||||
Me.ReportsAspNetModule1 = New DevExpress.ExpressApp.Reports.Web.ReportsAspNetModule()
|
||||
Me.ReportsModule1 = New DevExpress.ExpressApp.Reports.ReportsModule()
|
||||
Me.SchedulerAspNetModule1 = New DevExpress.ExpressApp.Scheduler.Web.SchedulerAspNetModule()
|
||||
Me.SchedulerModuleBase1 = New DevExpress.ExpressApp.Scheduler.SchedulerModuleBase()
|
||||
Me.TreeListEditorsAspNetModule1 = New DevExpress.ExpressApp.TreeListEditors.Web.TreeListEditorsAspNetModule()
|
||||
Me.TreeListEditorsModuleBase1 = New DevExpress.ExpressApp.TreeListEditors.TreeListEditorsModuleBase()
|
||||
CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
'
|
||||
'module5
|
||||
'
|
||||
Me.module5.AllowValidationDetailsAccess = True
|
||||
'
|
||||
'sqlConnection1
|
||||
'
|
||||
Me.sqlConnection1.ConnectionString = "Data Source=(local);Initial Catalog=Nuvolar;Integrated Security=SSPI;Pooling=" &
|
||||
"false"
|
||||
Me.sqlConnection1.FireInfoMessageEventOnUserErrors = False
|
||||
'
|
||||
'AuditTrailModule1
|
||||
'
|
||||
Me.AuditTrailModule1.AuditDataItemPersistentType = GetType(DevExpress.Persistent.BaseImpl.AuditDataItemPersistent)
|
||||
'
|
||||
'ViewVariantsModule1
|
||||
'
|
||||
Me.ViewVariantsModule1.GenerateVariantsNode = True
|
||||
Me.ViewVariantsModule1.ShowAdditionalNavigation = False
|
||||
'
|
||||
'AuthenticationStandard1
|
||||
'
|
||||
'Me.AuthenticationStandard1.LogonParametersType = GetType(DevExpress.ExpressApp.Security.AuthenticationStandardLogonParameters)
|
||||
Me.AuthenticationStandard1.LogonParametersType = GetType(Nuvolar.Module.ChangeLogon)
|
||||
'
|
||||
'SecurityComplex1
|
||||
'
|
||||
Me.SecurityComplex1.Authentication = Me.AuthenticationStandard1
|
||||
Me.SecurityComplex1.RoleType = GetType(DevExpress.Persistent.BaseImpl.Role)
|
||||
Me.SecurityComplex1.UserType = GetType(DevExpress.Persistent.BaseImpl.User)
|
||||
'
|
||||
'PivotChartModuleBase1
|
||||
'
|
||||
Me.PivotChartModuleBase1.ShowAdditionalNavigation = False
|
||||
'
|
||||
'ReportsModule1
|
||||
'
|
||||
Me.ReportsModule1.EnableInplaceReports = True
|
||||
Me.ReportsModule1.ReportDataType = GetType(DevExpress.Persistent.BaseImpl.ReportData)
|
||||
'
|
||||
'NuvolarAspNetApplication
|
||||
'
|
||||
Me.ApplicationName = "Nuvolar"
|
||||
Me.Connection = Me.sqlConnection1
|
||||
Me.Modules.Add(Me.module1)
|
||||
Me.Modules.Add(Me.module2)
|
||||
Me.Modules.Add(Me.module6)
|
||||
Me.Modules.Add(Me.AuditTrailModule1)
|
||||
Me.Modules.Add(Me.CloneObjectModule1)
|
||||
Me.Modules.Add(Me.ConditionalAppearanceModule1)
|
||||
Me.Modules.Add(Me.module5)
|
||||
Me.Modules.Add(Me.ViewVariantsModule1)
|
||||
Me.Modules.Add(Me.securityModule1)
|
||||
Me.Modules.Add(Me.module3)
|
||||
Me.Modules.Add(Me.ChartModule1)
|
||||
Me.Modules.Add(Me.ChartAspNetModule1)
|
||||
Me.Modules.Add(Me.FileAttachmentsAspNetModule1)
|
||||
Me.Modules.Add(Me.HtmlPropertyEditorAspNetModule1)
|
||||
Me.Modules.Add(Me.KpiModule1)
|
||||
Me.Modules.Add(Me.PivotChartModuleBase1)
|
||||
Me.Modules.Add(Me.PivotChartAspNetModule1)
|
||||
Me.Modules.Add(Me.PivotGridModule1)
|
||||
Me.Modules.Add(Me.PivotGridAspNetModule1)
|
||||
Me.Modules.Add(Me.ReportsModule1)
|
||||
Me.Modules.Add(Me.ReportsAspNetModule1)
|
||||
Me.Modules.Add(Me.SchedulerModuleBase1)
|
||||
Me.Modules.Add(Me.SchedulerAspNetModule1)
|
||||
Me.Modules.Add(Me.module4)
|
||||
Me.Modules.Add(Me.TreeListEditorsModuleBase1)
|
||||
Me.Modules.Add(Me.TreeListEditorsAspNetModule1)
|
||||
Me.Security = Me.SecurityComplex1
|
||||
CType(Me, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnLoggedOn(args As DevExpress.ExpressApp.LogonEventArgs)
|
||||
MyBase.OnLoggedOn(args)
|
||||
CType(MyBase.ShowViewStrategy, ShowViewStrategy).CollectionsEditMode =
|
||||
DevExpress.ExpressApp.Editors.ViewEditMode.Edit
|
||||
|
||||
Dim _onew As Xpo.XPObjectSpace = Me.ObjectSpaceProvider.CreateObjectSpace()
|
||||
Dim _uow As New UnitOfWork(_onew.Session.DataLayer)
|
||||
Dim _User As DevExpress.Persistent.BaseImpl.User = _onew.FindObject(Of DevExpress.Persistent.BaseImpl.User)(CriteriaOperator.Parse("Oid=?", SecuritySystem.CurrentUserId))
|
||||
Nuvolar.Module.LockingModule.ReleaseAllLocking(_uow, _User)
|
||||
End Sub
|
||||
Protected Overrides Sub OnLoggingOff(args As LoggingOffEventArgs)
|
||||
|
||||
'Dim _onew As Xpo.XPObjectSpace = Me.ObjectSpaceProvider.CreateObjectSpace()
|
||||
'Dim _uow As New UnitOfWork(_onew.Session.DataLayer)
|
||||
'Dim _User As DevExpress.Persistent.BaseImpl.User = _onew.FindObject(Of DevExpress.Persistent.BaseImpl.User)(CriteriaOperator.Parse("Oid=?", SecuritySystem.CurrentUserId))
|
||||
'Nuvolar.Module.LockingModule.ReleaseAllLocking(_uow, _User)
|
||||
|
||||
'MyBase.OnLoggingOff(args)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
Imports Microsoft.VisualBasic
|
||||
Imports System
|
||||
Imports System.Collections.Generic
|
||||
Imports System.ComponentModel
|
||||
Imports DevExpress.ExpressApp.Web
|
||||
Imports Nuvolar.Module.Web
|
||||
Imports System.Web
|
||||
Imports DevExpress.Xpo.DB.Helpers
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports Nuvolar.Module
|
||||
Imports System.Web.Security
|
||||
Imports DevExpress.Xpo.DB
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.ExpressApp.Security
|
||||
Imports System.Net
|
||||
Imports System.IO
|
||||
|
||||
Partial Public Class NuvolarAspNetApplication
|
||||
Inherits WebApplication
|
||||
Protected Overrides Sub ReadSecuredLogonParameters()
|
||||
MyBase.ReadSecuredLogonParameters() ' the "UserName" is restored in the base method.
|
||||
End Sub
|
||||
Private canReadSecuredLogonParameters_Renamed As Boolean = True
|
||||
Protected Overrides Function CanReadSecuredLogonParameters() As Boolean
|
||||
If (Not canReadSecuredLogonParameters_Renamed) Then
|
||||
Return False
|
||||
End If
|
||||
Return MyBase.CanReadSecuredLogonParameters()
|
||||
End Function
|
||||
Protected Overrides Function OnLogonFailed(ByVal logonParameters As Object, ByVal e As Exception) As Boolean
|
||||
If CanReadSecuredLogonParameters() Then
|
||||
FormsAuthentication.SignOut()
|
||||
canReadSecuredLogonParameters_Renamed = False
|
||||
Try
|
||||
Start()
|
||||
Finally
|
||||
canReadSecuredLogonParameters_Renamed = True
|
||||
End Try
|
||||
Return True
|
||||
Else
|
||||
Return MyBase.OnLogonFailed(logonParameters, e)
|
||||
End If
|
||||
End Function
|
||||
Protected Overrides Sub ReadLastLogonParametersCore(ByVal storage As DevExpress.ExpressApp.Utils.SettingsStorage, ByVal logonObject As Object)
|
||||
Dim standardLogonParameters As AuthenticationStandardLogonParameters = TryCast(logonObject, AuthenticationStandardLogonParameters)
|
||||
If (standardLogonParameters IsNot Nothing) AndAlso String.IsNullOrEmpty(standardLogonParameters.UserName) Then
|
||||
MyBase.ReadLastLogonParametersCore(storage, logonObject)
|
||||
Try
|
||||
TryCast(logonObject, ChangeLogon).DBConnection = TryCast(storage, DevExpress.ExpressApp.Utils.SettingsStorageOnCookies).LoadOption("", "DBConnection")
|
||||
TryCast(logonObject, ChangeLogon).SQLServer = TryCast(storage, DevExpress.ExpressApp.Utils.SettingsStorageOnCookies).LoadOption("", "SQLServer")
|
||||
TryCast(logonObject, ChangeLogon).Company = TryCast(storage, DevExpress.ExpressApp.Utils.SettingsStorageOnCookies).LoadOption("", "Company")
|
||||
Select Case TryCast(storage, DevExpress.ExpressApp.Utils.SettingsStorageOnCookies).LoadOption("", "SQLType")
|
||||
Case "MSSQL"
|
||||
TryCast(logonObject, ChangeLogon).SQLType = eSQLType.MSSQL
|
||||
Case "PostgreSQL"
|
||||
TryCast(logonObject, ChangeLogon).SQLType = eSQLType.PostgreSQL
|
||||
Case "MySQL"
|
||||
TryCast(logonObject, ChangeLogon).SQLType = eSQLType.MySQL
|
||||
End Select
|
||||
Catch
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub OnLoggingOn(ByVal args As LogonEventArgs)
|
||||
Dim connstr As String = ""
|
||||
Dim _ChangeLogon As ChangeLogon
|
||||
Dim _plattform As String = ""
|
||||
MyBase.OnLoggingOn(args)
|
||||
|
||||
_ChangeLogon = TryCast(args.LogonParameters, ChangeLogon)
|
||||
|
||||
GLOBAL_Company = _ChangeLogon.Company
|
||||
|
||||
Me.ConnectionString = GetSISSecurity()
|
||||
|
||||
End Sub
|
||||
Private Function GetSISSecurity() As String
|
||||
Dim _ConnectionString As String = ""
|
||||
Try
|
||||
|
||||
Dim _url = "http://nuvolar.azurewebsites.net/SISSecuritySSL.ashx?id=" & UCase(GLOBAL_Company)
|
||||
Dim _request As HttpWebRequest = TryCast(WebRequest.Create(_url), HttpWebRequest)
|
||||
Dim _response As HttpWebResponse = TryCast(_request.GetResponse, HttpWebResponse)
|
||||
Dim _reader As StreamReader = New StreamReader(_response.GetResponseStream())
|
||||
_ConnectionString = _reader.ReadToEnd
|
||||
|
||||
_ConnectionString = Encoding.UTF8.GetString(Convert.FromBase64String(_ConnectionString))
|
||||
_ConnectionString = AESDecrypt(_ConnectionString, "HrX12!!0Zm7764W2", "vXm657YS+!0@mmT")
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
Return _ConnectionString
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user