Compare commits
2 Commits
1a8fea634e
...
e161fcdd15
| Author | SHA1 | Date | |
|---|---|---|---|
| e161fcdd15 | |||
| cf8a116685 |
12
UID/usrctlProcedures.Designer.vb
generated
12
UID/usrctlProcedures.Designer.vb
generated
@@ -95,6 +95,7 @@ Partial Class usrctlProcedures
|
||||
Me.Button50 = New System.Windows.Forms.Button()
|
||||
Me.Button49 = New System.Windows.Forms.Button()
|
||||
Me.TabPage7 = New System.Windows.Forms.TabPage()
|
||||
Me.Button53 = New System.Windows.Forms.Button()
|
||||
Me.Label22 = New System.Windows.Forms.Label()
|
||||
Me.dtpbis = New System.Windows.Forms.DateTimePicker()
|
||||
Me.lblDakosyImport = New System.Windows.Forms.Label()
|
||||
@@ -874,6 +875,7 @@ Partial Class usrctlProcedures
|
||||
'
|
||||
'TabPage7
|
||||
'
|
||||
Me.TabPage7.Controls.Add(Me.Button53)
|
||||
Me.TabPage7.Controls.Add(Me.Label22)
|
||||
Me.TabPage7.Controls.Add(Me.dtpbis)
|
||||
Me.TabPage7.Controls.Add(Me.lblDakosyImport)
|
||||
@@ -889,6 +891,15 @@ Partial Class usrctlProcedures
|
||||
Me.TabPage7.Text = "Dakosy Import"
|
||||
Me.TabPage7.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button53
|
||||
'
|
||||
Me.Button53.Location = New System.Drawing.Point(18, 115)
|
||||
Me.Button53.Name = "Button53"
|
||||
Me.Button53.Size = New System.Drawing.Size(145, 41)
|
||||
Me.Button53.TabIndex = 73
|
||||
Me.Button53.Text = "Ursprungsland ISO2 einfügen"
|
||||
Me.Button53.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label22
|
||||
'
|
||||
Me.Label22.Location = New System.Drawing.Point(279, 19)
|
||||
@@ -1652,4 +1663,5 @@ Partial Class usrctlProcedures
|
||||
Friend WithEvents Button52 As Button
|
||||
Friend WithEvents Label22 As Label
|
||||
Friend WithEvents dtpbis As DateTimePicker
|
||||
Friend WithEvents Button53 As Button
|
||||
End Class
|
||||
|
||||
@@ -123,10 +123,4 @@
|
||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -3596,6 +3596,12 @@ Public Class usrctlProcedures
|
||||
|
||||
|
||||
DYIMPORT.Ursprung = isleernothing((currentRow(89)))
|
||||
|
||||
If DYIMPORT.Ursprung IsNot Nothing AndAlso DYIMPORT.Ursprung <> "" Then
|
||||
Dim ISO2 As String = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromLandbezeichnung(DYIMPORT.Ursprung)
|
||||
If ISO2 <> "" Then DYIMPORT.Ursprungsland_ISO2 = ISO2
|
||||
End If
|
||||
|
||||
DYIMPORT.Präferenzursprungsland = isleernothing((currentRow(90)))
|
||||
DYIMPORT.Beguenstigung = isleernothing((currentRow(91)))
|
||||
|
||||
@@ -3712,25 +3718,8 @@ Public Class usrctlProcedures
|
||||
|
||||
If savedDY Then
|
||||
'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")
|
||||
|
||||
sql.doSQL("EXECUTE dbo.sp_DeleteDuplicateZollmeldungen_ohne_Importfile", "AVISO")
|
||||
'dann generell alle doppelten löschen
|
||||
|
||||
sql.doSQL("EXECUTE dbo.sp_DeleteDuplicateZollmeldungen", "AVISO")
|
||||
End If
|
||||
|
||||
@@ -4301,6 +4290,72 @@ OPTION (MAXRECURSION 1000);", "AVISO") '
|
||||
cProgramFunctions.genExcelFromDT_NEW(dt)
|
||||
|
||||
|
||||
Dim dt_fehlendeLaender As DataTable = SQL.loadDgvBySql("select distinct (Ursprung) FROM [AVISO].[dbo].[tbl_DY_Zollmeldungen_Import] where Ursprungsland_ISO2 is null and Ursprung is not null", "AVISO")
|
||||
If dt_fehlendeLaender.Rows.Count > 0 Then
|
||||
MsgBox("ACHTUNG!, es befinden sich noch " & dt_fehlendeLaender.Rows.Count & " Länder, zu denen kein Ursprungsland zugewiesen wurde!" & vbNewLine & "Bitte zuweisen/bei Administration nachfragen!")
|
||||
cProgramFunctions.genExcelFromDT_NEW(dt_fehlendeLaender)
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button53_Click(sender As Object, e As EventArgs) Handles Button53.Click
|
||||
|
||||
|
||||
Dim Laneder = "select distinct (Ursprung) FROM [AVISO].[dbo].[tbl_DY_Zollmeldungen_Import] where Ursprungsland_ISO2 is null and Ursprung is not null"
|
||||
|
||||
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim dtiso2Laneder As DataTable = SQL.loadDgvBySql(Laneder, "AVISO")
|
||||
|
||||
If dtiso2Laneder.Rows.Count > 0 Then
|
||||
For Each r As DataRow In dtiso2Laneder.Rows
|
||||
|
||||
|
||||
Dim landISO2 As String = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromLandbezeichnung(r.Item("Ursprung"))
|
||||
|
||||
If landISO2 <> "" Then
|
||||
SQL.doSQL("Update [AVISO].[dbo].[tbl_DY_Zollmeldungen_Import] set Ursprungsland_ISO2 = '" & landISO2 & "' where Ursprung = '" & r.Item("Ursprung") & "'", "AVISO")
|
||||
Else
|
||||
Dim ISO2SetCountry As String = ""
|
||||
Select Case r.Item("Ursprung")
|
||||
Case "El Salvador" : ISO2SetCountry = "SV"
|
||||
Case "Europäische Union" : ISO2SetCountry = "EU"
|
||||
Case "Guatemala" : ISO2SetCountry = "GT"
|
||||
Case "Iran (Islamische Republik)" : ISO2SetCountry = "IR"
|
||||
Case "Kambodscha" : ISO2SetCountry = "KH"
|
||||
Case "Katar" : ISO2SetCountry = "QA"
|
||||
Case "Macau" : ISO2SetCountry = "MO"
|
||||
Case "Mali" : ISO2SetCountry = "ML"
|
||||
Case "Moldau, Republik" : ISO2SetCountry = "MD"
|
||||
Case "Myanmar" : ISO2SetCountry = "MM"
|
||||
Case "Nordmazedonien" : ISO2SetCountry = "MK"
|
||||
Case "Paraguay" : ISO2SetCountry = "PY"
|
||||
Case "Russische Föderation" : ISO2SetCountry = "RU"
|
||||
Case "Saudi-Arabien" : ISO2SetCountry = "SA"
|
||||
Case "Sierra Leone" : ISO2SetCountry = "SL"
|
||||
Case "Slowakische Republik" : ISO2SetCountry = "SK"
|
||||
Case "Spanien (ohne XC, XL)" : ISO2SetCountry = "ES"
|
||||
Case "Südkorea (Republik Korea)" : ISO2SetCountry = "KR"
|
||||
Case "Tschechien" : ISO2SetCountry = "CZ"
|
||||
Case "Vereinigte Arabische Emirate" : ISO2SetCountry = "AE"
|
||||
Case "Vereinigte Staaten" : ISO2SetCountry = "US"
|
||||
Case "Vereinigtes Königreich" : ISO2SetCountry = "GB"
|
||||
End Select
|
||||
|
||||
|
||||
If ISO2SetCountry <> "" Then
|
||||
SQL.doSQL("Update [AVISO].[dbo].[tbl_DY_Zollmeldungen_Import] set Ursprungsland_ISO2 = '" & ISO2SetCountry & "' where Ursprung = '" & r.Item("Ursprung") & "'", "AVISO")
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
MsgBox("alle Länder gesetzt!")
|
||||
Else
|
||||
MsgBox("keine fehlenden Länder vorhanden!")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user