MS 3.1.1.0

This commit is contained in:
2024-01-30 15:16:27 +01:00
parent de312ed3f6
commit 8a9bdc2fcd
11 changed files with 310 additions and 168 deletions

View File

@@ -1,6 +1,8 @@
Imports System.IO
Imports System.Text
Imports DD_LIB_Standards
Imports DevExpress.XtraGrid.Columns
Public Class frmDocRecordLink
Public Property Documents As New List(Of ClassWindreamDocGrid.WindreamDoc)
@@ -27,40 +29,49 @@ Public Class frmDocRecordLink
Else
DT_RECORDS = ENTITY_DATATABLE
End If
Try
DT_RECORDS.Columns.Add("already linked", Type.GetType("System.Boolean")).SetOrdinal(0)
DT_RECORDS.Columns("already linked").DefaultValue = False
If CURRENT_LINK_ENTITY_ID = 0 Then
CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID
End If
Try
' DT_RECORDS.Columns.Add("already linked", Type.GetType("System.Boolean")).SetOrdinal(0)
' DT_RECORDS.Columns("already linked").DefaultValue = False
Catch ex As Exception
End Try
'Try
' For Each row As DataRow In CURRENT_DT_SELECTED_FILES.Rows
' Dim DOC_ID = row.Item("DOC_ID")
' Dim sel = String.Format("select T.RECORD_ID FROM TBPMO_DOC_RECORD_LINK T, TBPMO_RECORD T1 WHERE T.RECORD_ID = T1.GUID AND T1.FORM_ID = {0} AND T.DOC_ID = {1}", CURRENT_LINK_ENTITY_ID, DOC_ID)
' Dim DTRECS_LINKED As DataTable = MYDB_ECM.GetDatatable(sel)
' For Each recrow As DataRow In DTRECS_LINKED.Rows
' For Each rowrecsdisplay As DataRow In DT_RECORDS.Rows
' If rowrecsdisplay.Item("Record-ID") = recrow.Item("RECORD_ID") Then
' rowrecsdisplay.Item("already linked") = True
' Else
' rowrecsdisplay.Item("already linked") = False
' End If
' Next
' Next
' Next
'Catch ex As Exception
' ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in displaying already linked", ex.Message, ex.StackTrace)
'End Try
Try
For Each row As DataRow In CURRENT_DT_SELECTED_FILES.Rows
Dim DOC_ID = row.Item("DOC_ID")
Dim sel = String.Format("select T.RECORD_ID FROM TBPMO_DOC_RECORD_LINK T, TBPMO_RECORD T1 WHERE T.RECORD_ID = T1.GUID AND T1.FORM_ID = {0} AND T.DOC_ID = {1}", CURRENT_LINK_ENTITY_ID, DOC_ID)
Dim DTRECS_LINKED As DataTable = MYDB_ECM.GetDatatable(sel)
For Each recrow As DataRow In DTRECS_LINKED.Rows
For Each rowrecsdisplay As DataRow In DT_RECORDS.Rows
If rowrecsdisplay.Item("Record-ID") = recrow.Item("RECORD_ID") Then
rowrecsdisplay.Item("already linked") = True
Else
rowrecsdisplay.Item("already linked") = False
End If
Next
Next
Next
grvwGrid.Columns.Clear()
dgEntityRecords.DataSource = DT_RECORDS
' grvwGrid.Columns.Item("already linked").Fixed = True
grvwGrid.PopulateColumns()
dgEntityRecords.RefreshDataSource()
grvwGrid.OptionsView.ColumnAutoWidth = False
grvwGrid.Columns(0).Fixed = FixedStyle.Left
grvwGrid.BestFitColumns()
Catch ex As Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in displaying already linked", ex.Message, ex.StackTrace)
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in format grid", ex.Message, ex.StackTrace)
End Try
grvwGrid.Columns.Clear()
dgEntityRecords.DataSource = DT_RECORDS
grvwGrid.Columns.Item("already linked").Fixed = True
grvwGrid.PopulateColumns()
dgEntityRecords.RefreshDataSource()
grvwGrid.OptionsView.ColumnAutoWidth = False
grvwGrid.BestFitColumns()
End Sub
Private Sub frmDocRecordLink_Load(sender As Object, e As EventArgs) Handles Me.Load
' OLD WAY
@@ -326,7 +337,7 @@ Public Class frmDocRecordLink
End If
Next
bsiInfo.Caption = $"[{oLinkCount}] records successfully linked - {Now.ToShortTimeString}"
Refresh_Grid_Data(True, Nothing)
Catch ex As Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in Linking Record to file", ex.Message, ex.StackTrace)
End Try