Multiselect
This commit is contained in:
@@ -2,7 +2,12 @@
|
||||
Imports System.Text
|
||||
Imports DD_LIB_Standards
|
||||
Public Class frmDocRecordLink
|
||||
Dim ENTITY_LOAD_ACTIVE As Boolean = False
|
||||
|
||||
Public Property Documents As New List(Of ClassWindreamDocGrid.WindreamDoc)
|
||||
|
||||
Private CURRENT_LINK_ENTITY_ID As Integer = 0
|
||||
Private ENTITY_LOAD_ACTIVE As Boolean = False
|
||||
|
||||
Private Class ClassEntity
|
||||
Public title As String
|
||||
Public id As Integer
|
||||
@@ -58,71 +63,140 @@ Public Class frmDocRecordLink
|
||||
grvwGrid.BestFitColumns()
|
||||
End Sub
|
||||
Private Sub frmDocRecordLink_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
ENTITY_LOAD_ACTIVE = True
|
||||
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
|
||||
txtFileInfo.Text = ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_PATH")
|
||||
Else
|
||||
txtFileInfo.Text = String.Format("{0} files selected for linking to record", ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count)
|
||||
End If
|
||||
Try
|
||||
If IsNothing(CURRENT_DT_ENTITY_RECORDS) Then
|
||||
Me.Close()
|
||||
End If
|
||||
If CURRENT_LINK_ENTITY_ID = 0 Then
|
||||
Refresh_Grid_Data(True, Nothing)
|
||||
CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID
|
||||
' OLD WAY
|
||||
If Documents.Count = 0 Then
|
||||
ENTITY_LOAD_ACTIVE = True
|
||||
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
|
||||
txtFileInfo.Text = ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_PATH")
|
||||
Else
|
||||
Dim DT_RESULT As DataTable
|
||||
If CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID Then
|
||||
DT_RESULT = CURRENT_DT_ENTITY_RECORDS
|
||||
txtFileInfo.Text = String.Format("{0} files selected for linking to record", ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count)
|
||||
End If
|
||||
Try
|
||||
If IsNothing(CURRENT_DT_ENTITY_RECORDS) Then
|
||||
Me.Close()
|
||||
End If
|
||||
If CURRENT_LINK_ENTITY_ID = 0 Then
|
||||
Refresh_Grid_Data(True, Nothing)
|
||||
CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID
|
||||
Else
|
||||
DT_RESULT = ReturnDataforEntity(CURRENT_LINK_ENTITY_ID)
|
||||
Dim DT_RESULT As DataTable
|
||||
If CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID Then
|
||||
DT_RESULT = CURRENT_DT_ENTITY_RECORDS
|
||||
Else
|
||||
DT_RESULT = ReturnDataforEntity(CURRENT_LINK_ENTITY_ID)
|
||||
End If
|
||||
|
||||
If Not IsNothing(DT_RESULT) Then
|
||||
Refresh_Grid_Data(False, DT_RESULT)
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not IsNothing(DT_RESULT) Then
|
||||
Refresh_Grid_Data(False, DT_RESULT)
|
||||
|
||||
Dim DT_ENTITIES As DataTable = GetENTITIES()
|
||||
Dim oSelectedIndex As Integer = 0
|
||||
|
||||
If DT_ENTITIES.Rows.Count = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Dim DT_ENTITIES As DataTable = GetENTITIES()
|
||||
Dim oSelectedIndex As Integer = 0
|
||||
|
||||
If DT_ENTITIES.Rows.Count = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim oCount = 0
|
||||
For Each row As DataRow In DT_ENTITIES.Rows
|
||||
Dim entity As New ClassEntity
|
||||
entity.title = row.Item("FORM_TITLE")
|
||||
entity.id = row.Item("FORM_ID")
|
||||
cmbConstructorForms.Items.Add(entity)
|
||||
If CURRENT_LINK_ENTITY_ID = entity.id Then
|
||||
txtcurrSichtData.Text = entity.title
|
||||
oSelectedIndex = oCount
|
||||
Dim oCount = 0
|
||||
For Each row As DataRow In DT_ENTITIES.Rows
|
||||
Dim entity As New ClassEntity
|
||||
entity.title = row.Item("FORM_TITLE")
|
||||
entity.id = row.Item("FORM_ID")
|
||||
cmbConstructorForms.Items.Add(entity)
|
||||
If CURRENT_LINK_ENTITY_ID = entity.id Then
|
||||
txtcurrSichtData.Text = entity.title
|
||||
oSelectedIndex = oCount
|
||||
End If
|
||||
oCount += 1
|
||||
Next
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
Me.Text = CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " Datei(en) mit Datensatz verknüpfen:"
|
||||
Else
|
||||
Me.Text = "Link " & CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " files with record:"
|
||||
End If
|
||||
oCount += 1
|
||||
Next
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
Me.Text = CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " Datei(en) mit Datensatz verknüpfen:"
|
||||
' Den index der aktuell geöffneten ConstructorForm setzen
|
||||
cmbConstructorForms.SelectedIndex = oSelectedIndex
|
||||
|
||||
Catch ex As Exception
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDocRecordLink_Load", ex.Message, ex.StackTrace)
|
||||
End Try
|
||||
|
||||
Load_DocGrid_Layout()
|
||||
bsiInfo.Caption = "Waiting for record-Selection....."
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If Documents.Count > 0 Then
|
||||
ENTITY_LOAD_ACTIVE = True
|
||||
If Documents.Count = 1 Then
|
||||
txtFileInfo.Text = Documents.First.DocPath
|
||||
Else
|
||||
Me.Text = "Link " & CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " files with record:"
|
||||
txtFileInfo.Text = String.Format("{0} files selected for linking to record", Documents.Count)
|
||||
End If
|
||||
' Den index der aktuell geöffneten ConstructorForm setzen
|
||||
cmbConstructorForms.SelectedIndex = oSelectedIndex
|
||||
Try
|
||||
If IsNothing(CURRENT_DT_ENTITY_RECORDS) Then
|
||||
Me.Close()
|
||||
End If
|
||||
If CURRENT_LINK_ENTITY_ID = 0 Then
|
||||
Refresh_Grid_Data(True, Nothing)
|
||||
CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID
|
||||
Else
|
||||
Dim DT_RESULT As DataTable
|
||||
If CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID Then
|
||||
DT_RESULT = CURRENT_DT_ENTITY_RECORDS
|
||||
Else
|
||||
DT_RESULT = ReturnDataforEntity(CURRENT_LINK_ENTITY_ID)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDocRecordLink_Load", ex.Message, ex.StackTrace)
|
||||
End Try
|
||||
If Not IsNothing(DT_RESULT) Then
|
||||
Refresh_Grid_Data(False, DT_RESULT)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Dim DT_ENTITIES As DataTable = GetENTITIES()
|
||||
Dim oSelectedIndex As Integer = 0
|
||||
|
||||
If DT_ENTITIES.Rows.Count = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim oCount = 0
|
||||
For Each row As DataRow In DT_ENTITIES.Rows
|
||||
Dim entity As New ClassEntity
|
||||
entity.title = row.Item("FORM_TITLE")
|
||||
entity.id = row.Item("FORM_ID")
|
||||
cmbConstructorForms.Items.Add(entity)
|
||||
If CURRENT_LINK_ENTITY_ID = entity.id Then
|
||||
txtcurrSichtData.Text = entity.title
|
||||
oSelectedIndex = oCount
|
||||
End If
|
||||
oCount += 1
|
||||
Next
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
Me.Text = CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " Datei(en) mit Datensatz verknüpfen:"
|
||||
Else
|
||||
Me.Text = "Link " & CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " files with record:"
|
||||
End If
|
||||
' Den index der aktuell geöffneten ConstructorForm setzen
|
||||
cmbConstructorForms.SelectedIndex = oSelectedIndex
|
||||
|
||||
Catch ex As Exception
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDocRecordLink_Load", ex.Message, ex.StackTrace)
|
||||
End Try
|
||||
|
||||
Load_DocGrid_Layout()
|
||||
bsiInfo.Caption = "Waiting for record-Selection....."
|
||||
|
||||
End If
|
||||
|
||||
Load_DocGrid_Layout()
|
||||
bsiInfo.Caption = "Waiting for record-Selection....."
|
||||
End Sub
|
||||
Private Function GetENTITIES() As DataTable
|
||||
Try
|
||||
Dim SQL As String = String.Format("SELECT DISTINCT FORM_ID,FORM_TITLE,SEQUENCE FROM VWPMO_CONSTRUCTOR_FORMS where CONSTRUCT_ID in " &
|
||||
"(SELECT CONSTRUCT_ID FROM TBPMO_CONSTRUCTOR_USER WHERE USER_ID = {0}) ORDER BY SEQUENCE", USER_GUID)
|
||||
Dim dt As DataTable = MYDB_ECM.GetDatatable(sql)
|
||||
Dim dt As DataTable = MYDB_ECM.GetDatatable(SQL)
|
||||
Return dt
|
||||
Catch ex As Exception
|
||||
MsgBox("Entities could not be loaded in LinkToRecord: " & vbNewLine & ex.Message)
|
||||
|
||||
Reference in New Issue
Block a user