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
    Friend WithEvents NotificationsModule1 As Notifications.NotificationsModule
    Friend WithEvents WebCSharpModule1 As Nuvolar.Module.Web.CSharp.WebCSharpModule
    Friend WithEvents ValidationAspNetModule1 As Validation.Web.ValidationAspNetModule
    Friend WithEvents NuvolarModule1 As Nuvolar.Module.NuvolarModule
    Friend WithEvents NotificationsAspNetModule1 As Notifications.Web.NotificationsAspNetModule
    Friend WithEvents MapsAspNetModule1 As Maps.Web.MapsAspNetModule
    Friend WithEvents ReportsModuleV21 As ReportsV2.ReportsModuleV2
    Friend WithEvents ReportsAspNetModuleV21 As ReportsV2.Web.ReportsAspNetModuleV2
    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()
        Me.NotificationsModule1 = New DevExpress.ExpressApp.Notifications.NotificationsModule()
        Me.WebCSharpModule1 = New Nuvolar.[Module].Web.CSharp.WebCSharpModule()
        Me.ValidationAspNetModule1 = New DevExpress.ExpressApp.Validation.Web.ValidationAspNetModule()
        Me.NuvolarModule1 = New Nuvolar.[Module].NuvolarModule()
        Me.NotificationsAspNetModule1 = New DevExpress.ExpressApp.Notifications.Web.NotificationsAspNetModule()
        Me.MapsAspNetModule1 = New DevExpress.ExpressApp.Maps.Web.MapsAspNetModule()
        Me.ReportsModuleV21 = New DevExpress.ExpressApp.ReportsV2.ReportsModuleV2()
        Me.ReportsAspNetModuleV21 = New DevExpress.ExpressApp.ReportsV2.Web.ReportsAspNetModuleV2()
        CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
        '
        'module5
        '
        Me.module5.AllowValidationDetailsAccess = True
        Me.module5.IgnoreWarningAndInformationRules = False
        '
        'sqlConnection1
        '
        Me.sqlConnection1.ConnectionString = "Data Source=(local);Initial Catalog=Nuvolar;Integrated Security=SSPI;Pooling=fals" &
    "e"
        Me.sqlConnection1.FireInfoMessageEventOnUserErrors = False
        '
        'AuditTrailModule1
        '
        Me.AuditTrailModule1.AuditDataItemPersistentType = GetType(DevExpress.Persistent.BaseImpl.AuditDataItemPersistent)
        '
        'AuthenticationStandard1
        '
        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)
        '
        'NotificationsModule1
        '
        Me.NotificationsModule1.NotificationsRefreshInterval = System.TimeSpan.Parse("00:05:00")
        Me.NotificationsModule1.NotificationsStartDelay = System.TimeSpan.Parse("00:00:05")
        Me.NotificationsModule1.ShowNotificationsWindow = True
        '
        'MapsAspNetModule1
        '
        'Me.MapsAspNetModule1.ClientLibrariesLocation = DevExpress.ExpressApp.Maps.Web.ClientLibrariesLocations.Embedded
        '
        'ReportsModuleV21
        '
        Me.ReportsModuleV21.EnableInplaceReports = True
        Me.ReportsModuleV21.ReportDataType = GetType(DevExpress.Persistent.BaseImpl.ReportDataV2)
        '
        'ReportsAspNetModuleV21
        '
        'ReportsAspNetModuleV21.ClientLibrariesLocation = DevExpress.ExpressApp.ReportsV2.Web.ClientLibrariesLocations.Embedded
        '
        '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.KpiModule1)
        Me.Modules.Add(Me.NotificationsModule1)
        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.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.TreeListEditorsModuleBase1)
        Me.Modules.Add(Me.TreeListEditorsAspNetModule1)
        Me.Modules.Add(Me.module4)
        Me.Modules.Add(Me.ValidationAspNetModule1)
        Me.Modules.Add(Me.WebCSharpModule1)
        Me.Modules.Add(Me.ReportsModuleV21)
        Me.Modules.Add(Me.NotificationsAspNetModule1)
        Me.Modules.Add(Me.MapsAspNetModule1)
        Me.Modules.Add(Me.ReportsAspNetModuleV21)
        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


