MS 2.7
This commit is contained in:
@@ -2,12 +2,13 @@
|
||||
Public Class frmDoc_Links
|
||||
Private Sub frmDoc_DocLinks_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Try
|
||||
|
||||
Refresh_Grid_Data()
|
||||
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
|
||||
Me.Text = $"Document-Links for file: {ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_PATH")}"
|
||||
Else
|
||||
Me.Text = $"Document-Links for file: NODOC-ID"
|
||||
End If
|
||||
Refresh_Grid_Data()
|
||||
Catch ex As Exception
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDoc_DocLinks_Load", ex.Message, ex.StackTrace)
|
||||
End Try
|
||||
@@ -15,38 +16,51 @@ Public Class frmDoc_Links
|
||||
Sub Refresh_Grid_Data()
|
||||
Try
|
||||
Dim DT_RECORDS As DataTable
|
||||
Dim oSql = $"select * FROM VWPMO_CUST_DOC_OBJECT_LINKS WHERE DOC_ID = {ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_ID")}"
|
||||
Dim oSql = $"select * FROM VWPMO_CUST_DOC_OBJECT_LINKS WHERE DocID = {CURRENT_DOC_ID}"
|
||||
DT_RECORDS = clsDatabase.Return_Datatable(oSql)
|
||||
If Not IsNothing(DT_RECORDS) Then
|
||||
BarStaticItemStatus.Caption = $"{DT_RECORDS.Rows.Count} links for Document found!"
|
||||
grvwGrid.Columns.Clear()
|
||||
GridControlRecords.DataSource = DT_RECORDS
|
||||
'grvwGrid.Columns.Item("already linked").Fixed = True
|
||||
Try
|
||||
grvwGrid.Columns.Item("DocID").Visible = False
|
||||
grvwGrid.Columns.Item("RecordID").Visible = False
|
||||
grvwGrid.Columns.Item("FULL_FILENAME").Visible = False
|
||||
Try
|
||||
grvwGrid.Columns.Item("VALUE").Visible = False
|
||||
Catch ex1 As Exception
|
||||
LOGGER.Warn("Column VALUE not part of VWPMO_CUST_DOC_OBJECT_LINKS" & ex1.Message)
|
||||
End Try
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
End Try
|
||||
|
||||
tslbl.Text = $"{DT_RECORDS.Rows.Count} links for Document found!"
|
||||
grvwGrid.Columns.Clear()
|
||||
dgRecords.DataSource = DT_RECORDS
|
||||
'grvwGrid.Columns.Item("already linked").Fixed = True
|
||||
Try
|
||||
grvwGrid.Columns.Item("DOC_ID").Visible = False
|
||||
grvwGrid.Columns.Item("RECORD_ID").Visible = False
|
||||
grvwGrid.Columns.Item("VALUE").Visible = False
|
||||
Catch ex As Exception
|
||||
GridControlRecords.RefreshDataSource()
|
||||
If DT_RECORDS.Rows.Count > 10000 Then
|
||||
BarButtonItem2.Enabled = False
|
||||
Else
|
||||
BarButtonItem2.Enabled = True
|
||||
End If
|
||||
Else
|
||||
MsgBox($"Please check Your link-object-relation: {oSql}", MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
|
||||
End Try
|
||||
|
||||
dgRecords.RefreshDataSource()
|
||||
Catch ex As Exception
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in Sub Refresh_Grid_Data", ex.Message, ex.StackTrace)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButtonDelete_Click(sender As Object, e As EventArgs) Handles ToolStripButtonDelete.Click
|
||||
Dim selectedRows As Integer() = grvwGrid.GetSelectedRows()
|
||||
Dim i As Integer = 0
|
||||
For Each rowhandle As Integer In selectedRows
|
||||
Dim oDocID = grvwGrid.GetRowCellValue(rowhandle, "DOC_ID")
|
||||
Dim oRECORD_ID = grvwGrid.GetRowCellValue(rowhandle, "RECORD_ID")
|
||||
If IsNothing(oDocID) Then
|
||||
Continue For
|
||||
End If
|
||||
LOGGER.Debug($"RecordLink will be removed Record: {oRECORD_ID} - DocID: {oDocID} ")
|
||||
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
||||
|
||||
|
||||
Dim oDocID = grvwGrid.GetRowCellValue(grvwGrid.FocusedRowHandle, "DocID")
|
||||
Dim oRECORD_ID = grvwGrid.GetRowCellValue(grvwGrid.FocusedRowHandle, "RecordID")
|
||||
If IsNothing(oDocID) Then
|
||||
Exit Sub
|
||||
End If
|
||||
LOGGER.Debug($"RecordLink will be removed Record: {oRECORD_ID} - DocID: {oDocID} ")
|
||||
Try
|
||||
If ClassFileResult.Delete_ResultFile(oDocID, oRECORD_ID, 0) = True Then
|
||||
ClassHelper.InsertEssential_Log(oDocID, "DOC-ID", $"RECORD LINK {oRECORD_ID} REMOVED FROM DOC-SEARCH")
|
||||
@@ -54,7 +68,34 @@ Public Class frmDoc_Links
|
||||
Catch ex As Exception
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in Removing DocRecord-Link", ex.Message, ex.StackTrace)
|
||||
End Try
|
||||
Next
|
||||
|
||||
Refresh_Grid_Data()
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
||||
Try
|
||||
Dim saveFileDialogDocSearchResult As New SaveFileDialog
|
||||
saveFileDialogDocSearchResult.Filter = "Excel File|*.xlsx"
|
||||
saveFileDialogDocSearchResult.Title = "Export to Excel:"
|
||||
saveFileDialogDocSearchResult.ShowDialog()
|
||||
If saveFileDialogDocSearchResult.FileName <> "" Then
|
||||
Cursor = Cursors.WaitCursor
|
||||
GridControlRecords.MainView.ExportToXlsx(saveFileDialogDocSearchResult.FileName)
|
||||
Dim result As MsgBoxResult
|
||||
Dim msg = String.Format("Datei wurde erstellt! Wollen Sie diese nun öffnen?")
|
||||
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("File was created. Do You want to open excel?")
|
||||
End If
|
||||
result = MessageBox.Show(msg, "Exporting result:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Process.Start(saveFileDialogDocSearchResult.FileName)
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in ExportExcel: " & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
Cursor = Cursors.Default
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user