Prüfung Datenarchiv
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Documents
|
||||
Imports System.Windows.Documents
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class usrCntlDatenarchiv
|
||||
@@ -24,6 +22,7 @@ Public Class usrCntlDatenarchiv
|
||||
'cboPartnersystem.Items.Clear()
|
||||
Dim distinctDT As DataTable = DatenarchivBind.bindingdataTable.DefaultView.ToTable(True, "Param_system")
|
||||
|
||||
cboPartnersystem.Items.Add(New MyListItem("", ""))
|
||||
For Each d As DataRow In distinctDT.Rows
|
||||
If Not cboPartnersystem.Items.Contains(d.Item(0)) Then cboPartnersystem.Items.Add(d.Item(0))
|
||||
Next
|
||||
@@ -72,31 +71,6 @@ Public Class usrCntlDatenarchiv
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
|
||||
Private Sub cbxProduktivsystem_CheckedChanged(sender As Object, e As EventArgs) Handles cbxTestsystem.CheckedChanged
|
||||
|
||||
'VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cbxTestsystem.Checked
|
||||
|
||||
DatenarchivBind = New cEasyBinding(BIND_DB)
|
||||
|
||||
|
||||
Dim sqlstr As String = ""
|
||||
Dim TopMax = If(IsNumeric(txtMaxSrch.Text), " TOP " & txtMaxSrch.Text, "")
|
||||
|
||||
|
||||
DatenarchivBind.initBinding("SELECT " & TopMax & " [Param_name],[Param_value], [Param_system] FROM " & table & " WHERE 1 = 1 " & getDatenarchivwhere(), table)
|
||||
|
||||
DataGridView.DataSource = DatenarchivBind.bindingdataTable
|
||||
|
||||
Dim distinctDT As DataTable = DatenarchivBind.bindingdataTable.DefaultView.ToTable(True, "Param_system")
|
||||
|
||||
For Each d As DataRow In distinctDT.Rows
|
||||
If Not cboPartnersystem.Items.Contains(d.Item(0)) Then cboPartnersystem.Items.Add(d.Item(0))
|
||||
Next
|
||||
|
||||
Me.usrCntlDatenarchiv_Load(sender, e)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub cboPartnersystem_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPartnersystem.SelectedIndexChanged
|
||||
btnSuche_Click(sender, e)
|
||||
End Sub
|
||||
@@ -202,4 +176,55 @@ Public Class usrCntlDatenarchiv
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
|
||||
Dim jahr As Integer = 2026
|
||||
Dim zupruefendeDokumente As String = " select top(100000) * from [tblDatenarchiv_Collection] where Year(coll_date) = " & jahr & " and coll_archiv = 0 and isnull(coll_pfad,'') <> '' order by coll_date desc "
|
||||
|
||||
|
||||
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim Datenarchiv_DOKS As DataTable = SQL.loadDgvBySql(zupruefendeDokumente, "FMZOLL")
|
||||
Dim dtFehlendeDOKS = Datenarchiv_DOKS.Clone()
|
||||
|
||||
|
||||
If Datenarchiv_DOKS.Rows.Count > 0 Then
|
||||
For Each r As DataRow In Datenarchiv_DOKS.Rows
|
||||
|
||||
If r.Item("coll_pfad") <> "" Then
|
||||
If Not System.IO.File.Exists(r.Item("coll_pfad")) Then
|
||||
dtFehlendeDOKS.ImportRow(r)
|
||||
lblfehlendeDokumente.Text = "fehlende Doks.: " & dtFehlendeDOKS.Rows.Count
|
||||
Me.Refresh()
|
||||
If dtFehlendeDOKS.Rows.Count >= 10000 Then Exit For
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
If dtFehlendeDOKS.Rows.Count > 0 Then
|
||||
|
||||
MsgBox("Es existieren " & dtFehlendeDOKS.Rows.Count & " Datenarchiv-Datensätze, die kein zugeordnetes Dokument besitzen!")
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dtFehlendeDOKS,,,,, True,,, True)
|
||||
|
||||
|
||||
If vbYes = MsgBox("Sollen diese Datenarchiveinträge gelöscht werden?", vbYesNo) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
|
||||
MsgBox("Es wurden keine fehlenden Dokumente gefunden!")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user