This repository has been archived by the owner on Jun 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebApplication.vb
89 lines (84 loc) · 4.81 KB
/
WebApplication.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports DevExpress.ExpressApp.Web
Imports DevExpress.ExpressApp.Xpo
Imports DevExpress.ExpressApp
Namespace AdditionalCommands.Web
Partial Public Class AdditionalCommandsAspNetApplication
Inherits WebApplication
Private module1 As DevExpress.ExpressApp.SystemModule.SystemModule
Private module2 As DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule
Private module3 As AdditionalCommands.Module.AdditionalCommandsModule
Private module4 As AdditionalCommands.Module.Web.AdditionalCommandsAspNetModule
Private securityModule1 As DevExpress.ExpressApp.Security.SecurityModule
Private securitySimple1 As DevExpress.ExpressApp.Security.SecuritySimple
Private module6 As DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule
Private authenticationActiveDirectory1 As DevExpress.ExpressApp.Security.AuthenticationActiveDirectory
Private sqlConnection1 As System.Data.SqlClient.SqlConnection
Private module5 As DevExpress.ExpressApp.Validation.ValidationModule
Public Sub New()
InitializeComponent()
End Sub
Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs)
args.ObjectSpaceProvider = New XPObjectSpaceProvider(ConnectionString, Connection)
End Sub
Private Sub AdditionalCommandsAspNetApplication_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
Private Sub InitializeComponent()
Me.module1 = New DevExpress.ExpressApp.SystemModule.SystemModule()
Me.module2 = New DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule()
Me.module3 = New AdditionalCommands.Module.AdditionalCommandsModule()
Me.module4 = New AdditionalCommands.Module.Web.AdditionalCommandsAspNetModule()
Me.module5 = New DevExpress.ExpressApp.Validation.ValidationModule()
Me.module6 = New DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule()
Me.securityModule1 = New DevExpress.ExpressApp.Security.SecurityModule()
Me.securitySimple1 = New DevExpress.ExpressApp.Security.SecuritySimple()
Me.authenticationActiveDirectory1 = New DevExpress.ExpressApp.Security.AuthenticationActiveDirectory()
Me.sqlConnection1 = New System.Data.SqlClient.SqlConnection()
CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
'
' securitySimple1
'
Me.securitySimple1.Authentication = Me.authenticationActiveDirectory1
Me.securitySimple1.UserType = GetType(DevExpress.Persistent.BaseImpl.SimpleUser)
'
' authenticationActiveDirectory1
'
Me.authenticationActiveDirectory1.CreateUserAutomatically = True
Me.authenticationActiveDirectory1.UserType = GetType(DevExpress.Persistent.BaseImpl.SimpleUser)
'
' sqlConnection1
'
Me.sqlConnection1.ConnectionString = "Data Source=(local);Initial Catalog=AdditionalCommands;Integrated Security=SSPI;Pooling=false"
Me.sqlConnection1.FireInfoMessageEventOnUserErrors = False
'
' AdditionalCommandsAspNetApplication
'
Me.ApplicationName = "AdditionalCommands"
Me.Connection = Me.sqlConnection1
Me.Modules.Add(Me.module1)
Me.Modules.Add(Me.module2)
Me.Modules.Add(Me.module3)
Me.Modules.Add(Me.module4)
Me.Modules.Add(Me.module5)
Me.Modules.Add(Me.module6)
Me.Modules.Add(Me.securityModule1)
Me.Security = Me.securitySimple1
' Me.DatabaseVersionMismatch += New System.EventHandler(Of DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs)(Me.AdditionalCommandsAspNetApplication_DatabaseVersionMismatch);
CType(Me, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
End Class
End Namespace