This commit is contained in:
2025-11-06 16:56:43 +01:00
parent 1a8fea634e
commit cf8a116685
3 changed files with 81 additions and 6 deletions

View File

@@ -95,6 +95,7 @@ Partial Class usrctlProcedures
Me.Button50 = New System.Windows.Forms.Button() Me.Button50 = New System.Windows.Forms.Button()
Me.Button49 = New System.Windows.Forms.Button() Me.Button49 = New System.Windows.Forms.Button()
Me.TabPage7 = New System.Windows.Forms.TabPage() Me.TabPage7 = New System.Windows.Forms.TabPage()
Me.Button53 = New System.Windows.Forms.Button()
Me.Label22 = New System.Windows.Forms.Label() Me.Label22 = New System.Windows.Forms.Label()
Me.dtpbis = New System.Windows.Forms.DateTimePicker() Me.dtpbis = New System.Windows.Forms.DateTimePicker()
Me.lblDakosyImport = New System.Windows.Forms.Label() Me.lblDakosyImport = New System.Windows.Forms.Label()
@@ -874,6 +875,7 @@ Partial Class usrctlProcedures
' '
'TabPage7 'TabPage7
' '
Me.TabPage7.Controls.Add(Me.Button53)
Me.TabPage7.Controls.Add(Me.Label22) Me.TabPage7.Controls.Add(Me.Label22)
Me.TabPage7.Controls.Add(Me.dtpbis) Me.TabPage7.Controls.Add(Me.dtpbis)
Me.TabPage7.Controls.Add(Me.lblDakosyImport) Me.TabPage7.Controls.Add(Me.lblDakosyImport)
@@ -889,6 +891,15 @@ Partial Class usrctlProcedures
Me.TabPage7.Text = "Dakosy Import" Me.TabPage7.Text = "Dakosy Import"
Me.TabPage7.UseVisualStyleBackColor = True 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 'Label22
' '
Me.Label22.Location = New System.Drawing.Point(279, 19) Me.Label22.Location = New System.Drawing.Point(279, 19)
@@ -1652,4 +1663,5 @@ Partial Class usrctlProcedures
Friend WithEvents Button52 As Button Friend WithEvents Button52 As Button
Friend WithEvents Label22 As Label Friend WithEvents Label22 As Label
Friend WithEvents dtpbis As DateTimePicker Friend WithEvents dtpbis As DateTimePicker
Friend WithEvents Button53 As Button
End Class End Class

View File

@@ -123,10 +123,4 @@
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </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> </root>

View File

@@ -3596,6 +3596,9 @@ Public Class usrctlProcedures
DYIMPORT.Ursprung = isleernothing((currentRow(89))) DYIMPORT.Ursprung = isleernothing((currentRow(89)))
If DYIMPORT.Ursprung IsNot Nothing AndAlso DYIMPORT.Ursprung <> "" Then DYIMPORT.Ursprungsland_ISO2 = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromLandbezeichnung(DYIMPORT.Ursprung)
DYIMPORT.Präferenzursprungsland = isleernothing((currentRow(90))) DYIMPORT.Präferenzursprungsland = isleernothing((currentRow(90)))
DYIMPORT.Beguenstigung = isleernothing((currentRow(91))) DYIMPORT.Beguenstigung = isleernothing((currentRow(91)))
@@ -4301,6 +4304,72 @@ OPTION (MAXRECURSION 1000);", "AVISO") '
cProgramFunctions.genExcelFromDT_NEW(dt) 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 End Sub