This commit is contained in:
2023-09-15 14:59:46 +02:00
parent 7e1a5286b0
commit 6b5e454662
3 changed files with 231 additions and 219 deletions

View File

@@ -7,15 +7,17 @@ Public Class frmDatenarchivarchiv
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Me.Cursor = Cursors.WaitCursor
If txtMax._value = "" Then Me.Cursor = Cursors.Default : Exit Sub
If Not IsNumeric(txtMax._value) Then Me.Cursor = Cursors.Default : Exit Sub
If Not IsDate(txtVon._value) Then Me.Cursor = Cursors.Default : Exit Sub
If Not IsDate(txtBis._value) Then Me.Cursor = Cursors.Default : Exit Sub
If txtKategorie.Text Is String.Empty Then Me.Cursor = Cursors.Default : Exit Sub
If txtOrdner.Text Is String.Empty Then Me.Cursor = Cursors.Default : Exit Sub
Dim DT = SQL.loadDgvBySql(" SELECT TOP (1) [da_id] FROM [tblDatenarchiv] inner join tblDatenarchiv_Collection on da_id=coll_daId
where da_vorlage=0 and coll_date BETWEEN '" & txtVon._value & "' and '" & txtBis._value & "' and coll_pfad NOT LIKE '%\\stor01.verag.ost.dmn\DatenArchivArchiv%'
Dim DT = SQL.loadDgvBySql(" SELECT TOP (" & txtMax._value & ") [da_id] FROM [tblDatenarchiv] inner join tblDatenarchiv_Collection on da_id=coll_daId
where da_vorlage=0 and coll_date BETWEEN '" & txtVon._value & "' and '" & txtBis._value & "' and coll_pfad NOT LIKE '%\\stor01.verag.ost.dmn\DatenArchivArchiv%' and coll_pfad NOT LIKE '\\DELETED\%'
AND da_kategorie='" & txtKategorie.Text & "' and da_ordner='" & txtOrdner.Text & "'
group by [da_id] ", "FMZOLL")
MsgBox(" SELECT TOP (1) [da_id] FROM [tblDatenarchiv] inner join tblDatenarchiv_Collection on da_id=coll_daId
where da_vorlage=0 and coll_date BETWEEN '" & txtVon._value & "' and '" & txtBis._value & "' and coll_pfad NOT LIKE '%\\stor01.verag.ost.dmn\DatenArchivArchiv%'
AND da_kategorie='" & txtKategorie.Text & "' and da_ordner='" & txtOrdner.Text & "'
group by [da_id] ")
and da_id>=392150 group by [da_id] order by [da_id] ", "FMZOLL")
If DT Is Nothing Then Me.Cursor = Cursors.Default : Exit Sub
If DT.Rows.Count = 0 Then Me.Cursor = Cursors.Default : Exit Sub
@@ -25,6 +27,7 @@ Public Class frmDatenarchivarchiv
ProgressBar1.Minimum = 1
ProgressBar1.Maximum = DT.Rows.Count
ProgressBar1.Step = 1
ProgressBar1.Value = 1
For Each ROW In DT.Rows
'Dim DS = New VERAG_PROG_ALLGEMEIN.cDATENSERVER(txtKategorie._value, txtOrdner._value, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, txtMax._value)
@@ -34,6 +37,16 @@ Public Class frmDatenarchivarchiv
DS.moveTo_ARCHIVARCHIV()
End If
ProgressBar1.PerformStep()
Label1.Text = ProgressBar1.Value & "/" & DT.Rows.Count
If DT.Rows.Count < 100 Then
Me.Refresh()
Else
If ProgressBar1.Value Mod 20 = 0 Then
Me.Refresh()
End If
End If
Next
End If