Plose-Prüfung, etc.

This commit is contained in:
2025-10-06 15:04:27 +02:00
parent 58047b88c7
commit bb9ec487cf
2 changed files with 82 additions and 34 deletions

View File

@@ -3473,6 +3473,7 @@ Public Class usrctlProcedures
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(fd.FileName, Encoding.Default)
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(";")
MyReader.HasFieldsEnclosedInQuotes = True ' <— Important line! (semicolon inside quotes will be ignored)
Dim currentRow As String()
While Not MyReader.EndOfData
Try
@@ -3709,7 +3710,27 @@ Public Class usrctlProcedures
End While
If savedDY Then
sql.doSQL("EXECUTE dbo.sp_DeleteDuplicateZollmeldungen", "FMZOLL")
'zuerst alle doppelten löschen und die fehlerhaften zuerst
Dim sql_deleleMultEntries As String = "
WITH Doppelte AS (
SELECT
*,
ROW_NUMBER() OVER (
PARTITION BY Registriernummer_MRN, PositionNo, Positionsunterlagenzeile
ORDER BY (SELECT NULL)
) AS rn
FROM [tbl_DY_Zollmeldungen_Import]
)
DELETE FROM Doppelte
WHERE rn > 1 and importfile is null;"
sql.doSQL(sql_deleleMultEntries, "AVISO")
'dann generell alle doppelten löschen
sql.doSQL("EXECUTE dbo.sp_DeleteDuplicateZollmeldungen", "AVISO")
End If
End Using