47 lines
2.4 KiB
VB.net
47 lines
2.4 KiB
VB.net
Imports Microsoft.VisualBasic
|
|
Imports System
|
|
Imports System.Collections.Generic
|
|
Imports System.ComponentModel
|
|
Imports DevExpress.ExpressApp.Win
|
|
Imports SISBusiness.Module
|
|
Partial Public Class SISBusinessWindowsFormsApplication
|
|
Inherits WinApplication
|
|
Public Sub New()
|
|
InitializeComponent()
|
|
DelayedViewItemsInitialization = True
|
|
End Sub
|
|
|
|
Private Sub SISBusinessWindowsFormsApplication_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 OnLoggedOn(args As DevExpress.ExpressApp.LogonEventArgs)
|
|
Dim connstr As String = Me.ConnectionString
|
|
Dim _ChangeLogon As ChangeLogon
|
|
Dim _plattform As String = ""
|
|
|
|
MyBase.OnLoggedOn(args)
|
|
|
|
GLOBAL_ConnectionString = connstr
|
|
GLOBAL_WINFormCaption = "SISBusiness Framework version: " & Application.ProductVersion
|
|
'GLOBAL_WINFormCaption += ", (" & _plattform & ") Server: " & UCase(_ChangeLogon.SQLServer) & ", Database: " & UCase(_ChangeLogon.DBConnection)
|
|
GLOBAL_ApplicationStartupPath = Application.StartupPath & "\"
|
|
End Sub
|
|
End Class
|