Reconfigure for GIT
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
Imports Microsoft.VisualBasic
|
||||
Imports System
|
||||
Imports System.Collections.Generic
|
||||
Imports System.ComponentModel
|
||||
Imports DevExpress.ExpressApp.Win
|
||||
Imports SISBusiness.Module.Win
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.XtraBars.Alerter
|
||||
Imports DevExpress.ExpressApp.Utils
|
||||
Imports DevExpress.ExpressApp.Xpo
|
||||
|
||||
Partial Public Class SISBusinessWindowsFormsApplication
|
||||
Inherits WinApplication
|
||||
Public Sub New()
|
||||
InitializeComponent()
|
||||
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." & vbCrLf & _
|
||||
"This error occurred because the automatic database update was disabled when the application was started without debugging." & 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." & 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 Function GetTraceLogDirectory() As String
|
||||
Return MyBase.GetTraceLogDirectory()
|
||||
End Function
|
||||
Protected Overrides Function CreateLogonWindowControllers() As System.Collections.Generic.List(Of DevExpress.ExpressApp.Controller)
|
||||
Dim _result As System.Collections.Generic.List(Of DevExpress.ExpressApp.Controller)
|
||||
Dim _CreateLogonWindowsControllerVC As New CreateLogonWindowsControllerVC
|
||||
_result = MyBase.CreateLogonWindowControllers()
|
||||
_result.Add(_CreateLogonWindowsControllerVC)
|
||||
Return _result
|
||||
End Function
|
||||
Protected Overrides Sub CreateDefaultObjectSpaceProvider(args As CreateCustomObjectSpaceProviderEventArgs)
|
||||
args.ObjectSpaceProvider = New XPObjectSpaceProvider(args.ConnectionString, args.Connection)
|
||||
End Sub
|
||||
Protected Overrides Sub OnLoggedOn(args As DevExpress.ExpressApp.LogonEventArgs)
|
||||
MyBase.OnLoggedOn(args)
|
||||
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))
|
||||
SISBusiness.Module.LockingModule.ReleaseAllLocking(_uow, _User)
|
||||
End Sub
|
||||
Protected Overrides Sub OnLoggingOff(args As DevExpress.ExpressApp.LoggingOffEventArgs)
|
||||
MyBase.OnLoggingOff(args)
|
||||
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))
|
||||
SISBusiness.Module.LockingModule.ReleaseAllLocking(_uow, _User)
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user