This commit is contained in:
2020-06-22 13:33:07 +02:00
parent f4e823ec69
commit 9b52ab1b61
43 changed files with 1985 additions and 250 deletions

View File

@@ -33,7 +33,7 @@ Public Class SQL
Try
Return My.MySettings.Default.FMZOLLConnectionString
Catch ex As Exception
Return "Data Source=DEVELOPER\DEVSQL;Initial Catalog=VERAG;Integrated Security=false;User ID=sa;Password=BmWr501956;"
Return "Data Source=DEVELOPER.verag.ost.dmn\DEVSQL;Initial Catalog=VERAG;Integrated Security=false;User ID=sa;Password=BmWr501956;"
End Try
@@ -711,14 +711,19 @@ Public Class SQL
End Select
Return where
End Function
Public Function getFMZOLLKdNrFromEORI(ByVal eori As String) As String
Public Function getFMZOLLKdNrFromEORI(ByVal eori As String, eoriNL As String) As String
Dim s As String = ""
Dim where = getFirmaWhere()
Try
Dim conn As SqlConnection = GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT Adressen.AdressenNr FROM Adressen INNER JOIN Kunden ON Adressen.AdressenNr = Kunden.KundenNr WHERE [EORITIN] = '" & eori & "' " & where & " ORDER BY AdressenNr DESC", conn)
Dim sqlStr = ""
If eoriNL <> "" Then
sqlStr = "SELECT Adressen.AdressenNr FROM Adressen INNER JOIN Kunden ON Adressen.AdressenNr = Kunden.KundenNr WHERE (([EORITIN] = '" & eori & "' AND EORITIN_NL ='" & eoriNL & "') OR ([EORITIN] + '0000' = '" & (eori & eoriNL).Replace(" ", "") & "')) " & where & " ORDER BY AdressenNr DESC"
Else
sqlStr = "SELECT Adressen.AdressenNr FROM Adressen INNER JOIN Kunden ON Adressen.AdressenNr = Kunden.KundenNr WHERE ( ([EORITIN] = '" & eori & "' AND EORITIN_NL ='" & eoriNL & "') OR [EORITIN] = '" & (eori & eoriNL).Replace(" ", "") & "') " & where & " order by EORITIN_NL desc, AdressenNr DESC"
End If
Using cmd As New SqlCommand(sqlStr, conn)
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.HasRows Then