This commit is contained in:
SchreiberM
2016-01-14 17:01:52 +01:00
parent 3fe8d1cd74
commit 058ae78435
19 changed files with 488 additions and 303 deletions

View File

@@ -49,17 +49,7 @@ Public Class frmMain
LoadQuickStartItems()
VWPMO_WF_USER_ACTIVETableAdapter.Connection.ConnectionString = MyConnectionString
VWPMO_WF_USER_ACTIVETableAdapter.Connection.ConnectionString = MyConnectionString
Try
Dim sql1 As String = String.Format("select * from TBPMO_FILES_USER where HANDLE_TYPE = 'SCAN' and WORKED = 0 AND UPPER(USER_WORK) = '{0}'", Environment.UserName)
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql1, "Load ScanFiles")
If Not IsNothing(DT) Then
If DT.Rows.Count > 0 Then
frmScanFiles.Show()
End If
End If
Catch ex As Exception
MsgBox("Error in Load InBox Scan:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Try
@@ -157,69 +147,80 @@ Public Class frmMain
End Sub
Public Sub LoadQuickStartItems()
Dim SQL2 As String = "SELECT * FROM TBPMO_FORM_CONSTRUCTOR ORDER BY SEQUENCE_MENU"
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL2)
Dim image2 As Bitmap = LoadNoImage()
Try
Dim SQL2 As String = "SELECT * FROM TBPMO_FORM_CONSTRUCTOR ORDER BY SEQUENCE_MENU"
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
'Do While 0 < groupQuickAccess.ItemLinks.Count
' groupQuickAccess.ItemLinks.Remove(groupQuickAccess.ItemLinks(0))
'Loop
'If dt.Rows.Count <> 0 Then
'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
' 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
' 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
' AddHandler item.ItemClick, AddressOf ToolbarButtonItemClick
' groupQuickAccess.ItemLinks.Add(item)
' groupQuickAccess.ItemLinks.Add(item)
' Next
' Next
'End If
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
Try
If Not IsNothing(groupQuickAccessForm) Then
Do While 0 < groupQuickAccessForm.ItemLinks.Count
groupQuickAccessForm.ItemLinks.Remove(groupQuickAccessForm.ItemLinks(0))
Loop
End If
Catch ex As Exception
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
End Try
AddHandler item.ItemClick, AddressOf ToolbarButtonItemClick
groupQuickAccess.ItemLinks.Add(item)
If dt.Rows.Count <> 0 Then
Next
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
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
groupQuickAccessForm.ItemLinks.Add(item)
Next
End If
Catch ex As Exception
MsgBox("Unexpected Error in Load QuickStart-Items:" & vbNewLine & ex.Message)
End Try
End Sub
@@ -356,6 +357,7 @@ Public Class frmMain
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Refresh_TaskReminder()
Timer1.Start()
TimerScan.Start()
If Sett_ConstructorStart <> 0 Then
Cursor = Cursors.WaitCursor
OpenFormConstructor(Sett_ConstructorStart)
@@ -542,4 +544,41 @@ Public Class frmMain
End Try
End Select
End Sub
Private Sub TimerScan_Tick(sender As Object, e As EventArgs) Handles TimerScan.Tick
Check_Scan()
End Sub
Sub Check_scan()
Try
Dim sql1 As String = String.Format("select * from TBPMO_FILES_USER where HANDLE_TYPE = 'SCAN' and WORKED = 0 AND UPPER(USER_WORK) = '{0}'", Environment.UserName)
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql1, "Load ScanFiles")
If Not IsNothing(DT) Then
If DT.Rows.Count > 0 Then
Dim open As Boolean = False
For Each form In My.Application.OpenForms
If (form.name = frmScanFiles.Name) Then
'form is loaded so can do work
'if you need to check whether it is actually visible
If form.Visible Then
open = True
'do work when visible
If My.Settings.User_InBoxScan_NotinFront = False Then
frmScanFiles.BringToFront()
End If
Else
End If
End If
Next
If open = False Then
Dim frm As New frmScanFiles
frm = frmScanFiles.Instance()
frm.Show()
End If
End If
End If
Catch ex As Exception
MsgBox("Error in Load InBox Scan:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
End Class