Prüfung Datenarchiv

This commit is contained in:
2026-11-05 08:59:08 +01:00
parent 9d12668947
commit 01995273bf
3 changed files with 108 additions and 54 deletions

View File

@@ -33,6 +33,7 @@ Partial Class frmMain
Me.TableAdapterManager1 = New ADMIN.DataSetBerechtigungenTableAdapters.TableAdapterManager()
Me.pnlMain = New System.Windows.Forms.Panel()
Me.Panel3 = New System.Windows.Forms.Panel()
Me.btnFirm = New System.Windows.Forms.Button()
Me.btnInterneBenachrichtigungen = New System.Windows.Forms.Button()
Me.lblVersion = New System.Windows.Forms.Label()
Me.btnAuditFlow = New System.Windows.Forms.Button()
@@ -52,7 +53,6 @@ Partial Class frmMain
Me.btnMitarbeiter = New System.Windows.Forms.Button()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.btnFirm = New System.Windows.Forms.Button()
Me.Panel3.SuspendLayout()
Me.Panel2.SuspendLayout()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -137,6 +137,18 @@ Partial Class frmMain
Me.Panel3.Size = New System.Drawing.Size(137, 801)
Me.Panel3.TabIndex = 32
'
'btnFirm
'
Me.btnFirm.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnFirm.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.btnFirm.Location = New System.Drawing.Point(12, 76)
Me.btnFirm.Name = "btnFirm"
Me.btnFirm.Size = New System.Drawing.Size(94, 33)
Me.btnFirm.TabIndex = 47
Me.btnFirm.Text = "Firmen"
Me.btnFirm.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnFirm.UseVisualStyleBackColor = True
'
'btnInterneBenachrichtigungen
'
Me.btnInterneBenachrichtigungen.FlatStyle = System.Windows.Forms.FlatStyle.Flat
@@ -265,6 +277,7 @@ Partial Class frmMain
Me.btnUpdate.Size = New System.Drawing.Size(94, 34)
Me.btnUpdate.TabIndex = 37
Me.btnUpdate.Text = "Update"
Me.btnUpdate.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnUpdate.UseVisualStyleBackColor = True
'
'btnSchulungen
@@ -358,18 +371,6 @@ Partial Class frmMain
Me.PictureBox1.TabIndex = 31
Me.PictureBox1.TabStop = False
'
'btnFirm
'
Me.btnFirm.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnFirm.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.btnFirm.Location = New System.Drawing.Point(12, 76)
Me.btnFirm.Name = "btnFirm"
Me.btnFirm.Size = New System.Drawing.Size(94, 33)
Me.btnFirm.TabIndex = 47
Me.btnFirm.Text = "Firmen"
Me.btnFirm.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnFirm.UseVisualStyleBackColor = True
'
'frmMain
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

View File

@@ -26,6 +26,8 @@ Partial Class usrCntlDatenarchiv
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
Me.pnlSearch = New System.Windows.Forms.Panel()
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
Me.lblfehlendeDokumente = New System.Windows.Forms.Label()
Me.Button1 = New System.Windows.Forms.Button()
Me.cbxTestsystem = New System.Windows.Forms.CheckBox()
Me.cboPartnersystem = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Label8 = New System.Windows.Forms.Label()
@@ -35,12 +37,12 @@ Partial Class usrCntlDatenarchiv
Me.pnlAnzeige = New System.Windows.Forms.Panel()
Me.DataGridView = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Panel1 = New System.Windows.Forms.Panel()
Me.btnSave = New System.Windows.Forms.Button()
Me.lblErgebnis = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.txtMaxSrch = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Button10 = New System.Windows.Forms.Button()
Me.Button11 = New System.Windows.Forms.Button()
Me.btnSave = New System.Windows.Forms.Button()
CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainer.Panel1.SuspendLayout()
Me.SplitContainer.Panel2.SuspendLayout()
@@ -96,6 +98,8 @@ Partial Class usrCntlDatenarchiv
'
'SplitContainer1.Panel1
'
Me.SplitContainer1.Panel1.Controls.Add(Me.lblfehlendeDokumente)
Me.SplitContainer1.Panel1.Controls.Add(Me.Button1)
Me.SplitContainer1.Panel1.Controls.Add(Me.cbxTestsystem)
Me.SplitContainer1.Panel1.Controls.Add(Me.cboPartnersystem)
Me.SplitContainer1.Panel1.Controls.Add(Me.Label8)
@@ -107,6 +111,24 @@ Partial Class usrCntlDatenarchiv
Me.SplitContainer1.SplitterDistance = 55
Me.SplitContainer1.TabIndex = 0
'
'lblfehlendeDokumente
'
Me.lblfehlendeDokumente.AutoSize = True
Me.lblfehlendeDokumente.ForeColor = System.Drawing.Color.Red
Me.lblfehlendeDokumente.Location = New System.Drawing.Point(617, 15)
Me.lblfehlendeDokumente.Name = "lblfehlendeDokumente"
Me.lblfehlendeDokumente.Size = New System.Drawing.Size(0, 13)
Me.lblfehlendeDokumente.TabIndex = 57
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(443, 10)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(159, 23)
Me.Button1.TabIndex = 56
Me.Button1.Text = "Prüfe Datenarchiv-DOK"
Me.Button1.UseVisualStyleBackColor = True
'
'cbxTestsystem
'
Me.cbxTestsystem.AutoSize = True
@@ -142,6 +164,7 @@ Partial Class usrCntlDatenarchiv
'
'btnSuche
'
Me.btnSuche.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnSuche.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnSuche.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSuche.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
@@ -218,6 +241,19 @@ Partial Class usrCntlDatenarchiv
Me.Panel1.Size = New System.Drawing.Size(1020, 44)
Me.Panel1.TabIndex = 1
'
'btnSave
'
Me.btnSave.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnSave.Location = New System.Drawing.Point(789, 5)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(118, 26)
Me.btnSave.TabIndex = 56
Me.btnSave.Text = "speichern"
Me.btnSave.UseVisualStyleBackColor = True
'
'lblErgebnis
'
Me.lblErgebnis.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -230,6 +266,7 @@ Partial Class usrCntlDatenarchiv
'
'Label4
'
Me.Label4.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(930, 5)
Me.Label4.Name = "Label4"
@@ -251,6 +288,7 @@ Partial Class usrCntlDatenarchiv
Me.txtMaxSrch._value = ""
Me.txtMaxSrch._Waehrung = False
Me.txtMaxSrch._WaehrungZeichen = True
Me.txtMaxSrch.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtMaxSrch.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtMaxSrch.ForeColor = System.Drawing.Color.Black
Me.txtMaxSrch.Location = New System.Drawing.Point(966, 2)
@@ -288,18 +326,6 @@ Partial Class usrCntlDatenarchiv
Me.Button11.TabIndex = 4
Me.Button11.UseVisualStyleBackColor = True
'
'btnSave
'
Me.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnSave.Location = New System.Drawing.Point(789, 5)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(118, 26)
Me.btnSave.TabIndex = 56
Me.btnSave.Text = "speichern"
Me.btnSave.UseVisualStyleBackColor = True
'
'usrCntlDatenarchiv
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -343,4 +369,6 @@ Partial Class usrCntlDatenarchiv
Friend WithEvents Label12 As Label
Friend WithEvents cbxTestsystem As CheckBox
Friend WithEvents btnSave As Button
Friend WithEvents Button1 As Button
Friend WithEvents lblfehlendeDokumente As Label
End Class

View File

@@ -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