MS_29012016

This commit is contained in:
SchreiberM
2016-01-29 14:46:32 +01:00
parent 3cc10569ad
commit 66b70f44b9
28 changed files with 3998 additions and 1981 deletions

View File

@@ -2,14 +2,12 @@
Imports DevExpress.XtraBars.Ribbon
Imports DevExpress.XtraBars
Imports System.ComponentModel
Imports System.Threading
Imports System.Globalization
Public Class frmMain
'Ausgelagert in ModuleMySettings.vb
'Dim sql_User_Login As String = "UPDATE TBDD_USER SET LOGGED_IN = @LogInOut, LOGGED_WHERE = '@ANGEMELDETWO' WHERE (LOWER(USERNAME) = LOWER('@user'))"
'Dim sql_UserID As String = "SELECT GUID FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('@user'))"
'Private USER_GUID
Public Shared TIMER_SCAN As New Timer
Public Shared TIMER_SCAN As New System.Windows.Forms.Timer
Public Shared Sub RUN_TIMER()
Try
@@ -21,7 +19,7 @@ Public Class frmMain
Catch ex As Exception
MsgBox("Unexpected Error in RUN_TIMER:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Shared Sub Scan_TickHandler(sender As Object, e As EventArgs)
Try
@@ -64,6 +62,11 @@ Public Class frmMain
' Form Titel setzen
ClassWindowLocation.LoadFormLocationSize(Me, 1, CURRENT_SCREEN_ID, "frmMain")
Dim i = My.Application.UICulture.ToString()
'Dim splash As New frmSplash()
'splash.ShowDialog()
Me.Text = Application.ProductName
LabelVersion.Caption = String.Format("Version {0}", My.Application.Info.Version.ToString)
LabelUser.Caption = Environment.UserName
@@ -80,10 +83,6 @@ Public Class frmMain
End Sub
Sub Load_Connection_Dep_Data()
SetBackground()
Dim splash As New frmSplash()
splash.ShowDialog()
If ERROR_INIT = "NONE" Then
If USER_IS_ADMIN = True Then
pageAdmin.Visible = True
@@ -99,8 +98,8 @@ Public Class frmMain
End If
VWPMO_WF_USER_ACTIVETableAdapter.Connection.ConnectionString = MyConnectionString
VWPMO_WF_USER_ACTIVETableAdapter.Connection.ConnectionString = MyConnectionString
End Sub
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Try
@@ -196,44 +195,14 @@ Public Class frmMain
End If
End Sub
Public Sub LoadQuickStartItems()
Try
Dim SQL2 As String = String.Format("SELECT GUID, dbo.FNPMO_GETOBJECTCAPTION('{0}', 'CONSTR_MENUE' + CONVERT(VARCHAR(5), GUID), {1}) AS FORM_TITLE, SEQUENCE_MENU, ADDED_WHO, ADDED_WHEN, CHANGED_WHO," & _
"CHANGED_WHEN, MENU_IMG, SHORT_TITLE, LANGUAGE " & _
"FROM TBPMO_FORM_CONSTRUCTOR ORDER BY SEQUENCE_MENU", USER_LANGUAGE, CURRENT_SCREEN_ID)
"CHANGED_WHEN, MENU_IMG, SHORT_TITLE, LANGUAGE, " & _
"'CONSTR_MENUE' + CONVERT(VARCHAR(5), GUID) as OBECTNAME FROM TBPMO_FORM_CONSTRUCTOR ORDER BY SEQUENCE_MENU", USER_LANGUAGE, CURRENT_SCREEN_ID)
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL2)
Dim image2 As Bitmap = LoadNoImage()
'Do While 0 < groupQuickAccess.ItemLinks.Count
' groupQuickAccess.ItemLinks.Remove(groupQuickAccess.ItemLinks(0))
'Loop
'If dt.Rows.Count <> 0 Then
' For Each row As DataRow In dt.Rows
' If Not IsDBNull(row.Item("MENU_IMG")) Then
' Dim bimg() As Byte = row.Item("MENU_IMG")
' Dim bitmap As Bitmap = ByteArrayToBitmap(bimg)
' image2 = bitmap
' End If
' Dim title As String = row.Item("FORM_TITLE")
' Dim index As Integer = row.Item("SEQUENCE_MENU")
' Dim tag As Integer = row.Item("GUID")
' Dim item As New BarButtonItem(ribbonMain.Manager, title)
' item.RibbonStyle = RibbonItemStyles.Large
' item.Caption = title
' item.Tag = tag
' item.Glyph = image2
' AddHandler item.ItemClick, AddressOf ToolbarButtonItemClick
' groupQuickAccess.ItemLinks.Add(item)
' Next
'End If
Try
If Not IsNothing(groupQuickAccessForm) Then
Do While 0 < groupQuickAccessForm.ItemLinks.Count
@@ -243,8 +212,8 @@ Public Class frmMain
Catch ex As Exception
End Try
If dt.Rows.Count <> 0 Then
@@ -254,8 +223,18 @@ Public Class frmMain
Dim bitmap As Bitmap = ByteArrayToBitmap(bimg)
image2 = bitmap
End If
Dim title = row.Item("FORM_TITLE")
If title = "CAPTION (OBJ) NOT TRANSLATED" Then
Dim objectname = row.Item("OBECTNAME")
Dim objectname_temp = String.Format("Object {0} not translated", objectname)
Dim ins = String.Format("INSERT INTO TBPMO_LANGUAGE_OBJECT (LANGUAGE_TYPE,SCREEN_ID,PMO_OBJECT_NAME,CAPTION) VALUES " & _
"('{0}',{1},'{2}', '{3}')", USER_LANGUAGE, CURRENT_SCREEN_ID, objectname, objectname_temp)
If ClassDatabase.Execute_non_Query(ins) = True Then
title = objectname_temp
End If
End If
Dim title As String = row.Item("FORM_TITLE")
Dim index As Integer = row.Item("SEQUENCE_MENU")
Dim tag As Integer = row.Item("GUID")
Dim item As New BarButtonItem(ribbonMain.Manager, title)
@@ -273,7 +252,7 @@ Public Class frmMain
Catch ex As Exception
MsgBox("Unexpected Error in Load QuickStart-Items:" & vbNewLine & ex.Message)
End Try
End Sub
@@ -358,7 +337,7 @@ Public Class frmMain
Me.BackgroundImageLayout = ImageLayout.Center
End If
End Sub
Sub Refresh_TaskReminder()
Try
Me.VWPMO_WF_USER_ACTIVETableAdapter.Fill(Me.DD_DMSDataSet.VWPMO_WF_USER_ACTIVE, Environment.UserName)
@@ -507,6 +486,10 @@ Public Class frmMain
End Sub
Sub Load_ConfigBasic()
frmConfig_Basic.ShowDialog()
If LANGUAGE_CHANGED = True Then
MsgBox("Application will restart now!", MsgBoxStyle.Information)
Application.Restart()
End If
If CONNECTION_CHANGED = True Then
Load_Connection_Dep_Data()
End If
@@ -599,4 +582,22 @@ Public Class frmMain
End Try
End Select
End Sub
Private Sub BarButtonItem18_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonItem18.ItemClick
Close_Maximized_Forms()
Dim frm As New frmLanguage_Translator
frm.MdiParent = Me
frm.Show()
End Sub
Public Sub New()
Dim splash As New frmSplash()
splash.ShowDialog()
Thread.CurrentThread.CurrentUICulture = New CultureInfo(USER_LANGUAGE)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
End Sub
End Class