MS UserItemsReplace
This commit is contained in:
@@ -200,11 +200,7 @@ Public Class frmMain
|
||||
Else
|
||||
'itemRefreshProxy.Visibility = BarItemVisibility.Never
|
||||
End If
|
||||
Dim msg = "Anzahl Angemeldete User: " & USERS_LOGGED_IN.ToString()
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "#User logged in: " & USERS_LOGGED_IN.ToString()
|
||||
End If
|
||||
LabelLoggedIn.Caption = msg
|
||||
LoggedIn()
|
||||
|
||||
'LoadMenuItems()
|
||||
LoadMenuItems2()
|
||||
@@ -216,6 +212,20 @@ Public Class frmMain
|
||||
End If
|
||||
Load_TasksforUser()
|
||||
End Sub
|
||||
Sub LoggedIn()
|
||||
Try
|
||||
Dim oSQL = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Record-Organizer') AND CLIENT_ID = {0}", CLIENT_SELECTED)
|
||||
Dim anzahl = ClassDatabase.Execute_Scalar(oSQL, False)
|
||||
USERS_LOGGED_IN = CInt(anzahl)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
Dim msg = "Anzahl Angemeldete User: " & USERS_LOGGED_IN.ToString()
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "#User logged in: " & USERS_LOGGED_IN.ToString()
|
||||
End If
|
||||
LabelLoggedIn.Caption = msg
|
||||
End Sub
|
||||
Sub Display_ConString()
|
||||
Try
|
||||
Dim connection As New SqlClient.SqlConnection(MyConnectionString) 'csb.ConnectionString)
|
||||
@@ -530,6 +540,7 @@ Public Class frmMain
|
||||
|
||||
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles TimerTasks.Tick
|
||||
Refresh_TaskReminder()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub frmMain_Resize(sender As Object, e As EventArgs) Handles Me.Resize
|
||||
@@ -550,6 +561,7 @@ Public Class frmMain
|
||||
End If
|
||||
|
||||
RUN_TIMER()
|
||||
Timer5mins.Start()
|
||||
|
||||
If Sett_ConstructorStart <> 0 Then
|
||||
Cursor = Cursors.WaitCursor
|
||||
@@ -1029,7 +1041,7 @@ Public Class frmMain
|
||||
Dim dt2 As DataTable = CURRENT_TBPMO_CONN_SWITCH
|
||||
Dim drActive As DataRow() = dt2.Select("ACTIVE = 1")
|
||||
Dim drInActive As DataRow() = dt2.Select("ACTIVE = 0")
|
||||
Dim name = ""
|
||||
Dim oSQLDescription = ""
|
||||
Dim oSqlcon = ""
|
||||
Dim oSqlcon_Proxy = ""
|
||||
Dim oWM_ALIAS = ""
|
||||
@@ -1037,7 +1049,7 @@ Public Class frmMain
|
||||
Dim oACTIVE_GUID
|
||||
For Each row As DataRow In drInActive
|
||||
oINACTIVE_GUID = row.Item("GUID")
|
||||
name = row.Item("DESCRIPTION")
|
||||
oSQLDescription = row.Item("DESCRIPTION")
|
||||
oSqlcon = row.Item("SQL_CONNECTION")
|
||||
oSqlcon_Proxy = row.Item("SQL_CONNECTION_PROXY")
|
||||
oWM_ALIAS = row.Item("WM_ALIAS")
|
||||
@@ -1047,20 +1059,21 @@ Public Class frmMain
|
||||
Next
|
||||
|
||||
|
||||
If name <> "" Then
|
||||
If oSQLDescription <> "" Then
|
||||
Dim oresult As MsgBoxResult
|
||||
Dim msg = "Wollen Sie die Verbindungs-Konfiguration nun auf '" & name & "' ändern?"
|
||||
Dim msg = "Wollen Sie die Verbindungs-Konfiguration nun auf '" & oSQLDescription & "' ändern?"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "Would You like to change the Connection-configuration to '" & name & "'?"
|
||||
msg = "Would You like to change the Connection-configuration to '" & oSQLDescription & "'?"
|
||||
End If
|
||||
oresult = MessageBox.Show(msg, "Confirmation:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If oresult = MsgBoxResult.Yes Then
|
||||
BarButtonItemSwitchCon.Caption = "Switch Connection to: " & name
|
||||
BarButtonItemSwitchCon.Caption = "Switch Connection to: " & oSQLDescription
|
||||
Try
|
||||
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\A.I.S. GmbH\windream\3.6\ServerShareSelector", "CurrentAlias", oWM_ALIAS)
|
||||
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\A.I.S. GmbH\windream\3.6\ServerShareSelector", "VFSAlias", oWM_ALIAS)
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected error in Changing WMAlias: " & ex.Message, True)
|
||||
MsgBox("Unexpected error in Changing WMAlias: " & ex.Message, MsgBoxStyle.Critical)
|
||||
Exit Sub
|
||||
End Try
|
||||
Try
|
||||
@@ -1069,6 +1082,7 @@ Public Class frmMain
|
||||
IndexService.Start
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected error in Restarting IndexService: " & ex.Message, True)
|
||||
MsgBox("Unexpected error in Restarting IndexService: " & ex.Message, MsgBoxStyle.Critical)
|
||||
Exit Sub
|
||||
End Try
|
||||
Try
|
||||
@@ -1077,6 +1091,7 @@ Public Class frmMain
|
||||
ControlCenter.StartVFSService(1)
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected error in Restarting ControlCenter: " & ex.Message, True)
|
||||
MsgBox("Unexpected error in Restarting ControlCenter: " & ex.Message, MsgBoxStyle.Critical)
|
||||
Exit Sub
|
||||
End Try
|
||||
|
||||
@@ -1093,13 +1108,28 @@ Public Class frmMain
|
||||
If ClassInit.InitDatabase = True Then
|
||||
ClassInit.InitUserLogin()
|
||||
Load_Connection_Dep_Data()
|
||||
msg = "Die Client-Verbindung wurde erfolgreich gewechselt!"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "The Client-Connection was changed successfully!"
|
||||
|
||||
sql = String.Format("UPDATE TBPMO_CLIENT_CONN_SWITCH_USER SET ACTIVE = 1 WHERE UPPER(CONN_NAME) = UPPER('{0}') AND USER_ID = {1}", oSQLDescription, USER_GUID)
|
||||
Dim oSuccess As Boolean = False
|
||||
If ClassDatabase.Execute_non_Query(sql) = True Then
|
||||
oSuccess = True
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Information)
|
||||
sql = String.Format("UPDATE TBPMO_CLIENT_CONN_SWITCH_USER SET ACTIVE = 1 WHERE DESCRIPTION = {0} AND USER_ID = {1}", name, USER_GUID)
|
||||
ClassDatabase.Execute_Scalar(sql)
|
||||
If oSuccess = True Then
|
||||
msg = "Die Client-Verbindung wurde erfolgreich gewechselt!"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "The Client-Connection was changed successfully!"
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Information)
|
||||
Else
|
||||
msg = "Die Client-Verbindung konnte nicht erfolgreich gewechselt werden!"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "The Client-Connection could not be changed!"
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Critical)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ClassInit.Init_CONN_SWITCH()
|
||||
CONN_Manager()
|
||||
End If
|
||||
@@ -1110,4 +1140,8 @@ Public Class frmMain
|
||||
MsgBox("Unexpected error in BarButtonItemSwitchCon.ItemClick: " & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub Timer5mins_Tick(sender As Object, e As EventArgs) Handles Timer5mins.Tick
|
||||
LoggedIn()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user