This commit is contained in:
2023-01-11 21:03:39 +01:00
3 changed files with 18 additions and 15 deletions

View File

@@ -2718,6 +2718,7 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="AATEST.resx"> <EmbeddedResource Include="AATEST.resx">
<DependentUpon>AATEST.vb</DependentUpon> <DependentUpon>AATEST.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Administration\Auswertungen\frmZollUserStat.resx"> <EmbeddedResource Include="Administration\Auswertungen\frmZollUserStat.resx">
<DependentUpon>frmZollUserStat.vb</DependentUpon> <DependentUpon>frmZollUserStat.vb</DependentUpon>

View File

@@ -1,7 +1,7 @@
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports System.Reflection Imports System.Reflection
Public Class cKundenVollmachten 'in Arbeit! Public Class cKundenVollmachten
Property kdvm_Id As Integer Property kdvm_Id As Integer
Property kdvm_KundenNr As Object = Nothing Property kdvm_KundenNr As Object = Nothing

View File

@@ -3,7 +3,7 @@ Imports System.Reflection
Public Class cWarenorte Public Class cWarenorte
'Property _BASE_id As Integer Property wo_id As Integer
Property wo_warenort As Object = Nothing Property wo_warenort As Object = Nothing
Property wo_bezeichnung As Object = Nothing Property wo_bezeichnung As Object = Nothing
Property wo_firma As Object = Nothing Property wo_firma As Object = Nothing
@@ -13,13 +13,14 @@ Public Class cWarenorte
Property wo_cluster As Object = Nothing Property wo_cluster As Object = Nothing
Property wo_grenzstelle As Object = Nothing Property wo_grenzstelle As Object = Nothing
Property wo_knnr As Object = Nothing Property wo_knnr As Object = Nothing
Property wo_strasse As Object = Nothing
Public hasEntry = False Public hasEntry = False
Dim SQL As New SQL Dim SQL As New SQL
Sub New(wo_warenort) Sub New(wo_id)
Me.wo_warenort = wo_warenort Me.wo_id = wo_id
LOAD() LOAD()
End Sub End Sub
@@ -38,7 +39,7 @@ Public Class cWarenorte
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
'list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("_BASE_id", _BASE_id,, True)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_id", wo_id,, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_warenort", wo_warenort)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_warenort", wo_warenort))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_bezeichnung", wo_bezeichnung)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_bezeichnung", wo_bezeichnung))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_firma", wo_firma)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_firma", wo_firma))
@@ -48,6 +49,7 @@ Public Class cWarenorte
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_cluster", wo_cluster)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_cluster", wo_cluster))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_grenzstelle", wo_grenzstelle)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_grenzstelle", wo_grenzstelle))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_knnr", wo_knnr)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_knnr", wo_knnr))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_strasse", wo_strasse))
Return list Return list
End Function End Function
@@ -57,7 +59,7 @@ Public Class cWarenorte
Public Function SAVE() As Boolean Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM [tblWarenorte] WHERE wo_warenort=@wo_warenort AND wo_firma=@wo_firma) " & Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM [tblWarenorte] WHERE wo_id=@wo_id) " &
" BEGIN " & getUpdateCmd() & " END " & " BEGIN " & getUpdateCmd() & " END " &
" Else " & " Else " &
" BEGIN " & getInsertCmd() & " END " & " BEGIN " & getInsertCmd() & " END " &
@@ -67,12 +69,12 @@ Public Class cWarenorte
End Function End Function
Public Sub LOAD() Public Sub LOAD()
Try Try
hasEntry = False hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionAVISO() Using conn As SqlConnection = SQL.GetNewOpenConnectionAVISO()
Using cmd As New SqlCommand("SELECT * FROM [tblWarenorte] WHERE wo_warenort=@wo_warenort AND wo_firma=@wo_firma ", conn) Using cmd As New SqlCommand("Select * From [tblWarenorte] Where wo_id =@wo_id", conn)
cmd.Parameters.AddWithValue("@wo_warenort", wo_warenort) cmd.Parameters.AddWithValue("@wo_id", wo_id)
cmd.Parameters.AddWithValue("@wo_firma", wo_firma)
Dim dr = cmd.ExecuteReader() Dim dr = cmd.ExecuteReader()
If dr.Read Then If dr.Read Then
For Each li In getParameterList() For Each li In getParameterList()
@@ -135,7 +137,7 @@ Public Class cWarenorte
End If End If
Next Next
str = str.Substring(0, str.Length - 1) 'wg. ',' str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblWarenorte] SET " & str & " WHERE wo_warenort=@wo_warenort ") Return (" UPDATE [tblWarenorte] SET " & str & " WHERE wo_id=@wo_id ")
Catch ex As Exception Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace) MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
@@ -164,14 +166,14 @@ Public Class cWarenorte
Return "" Return ""
End Function End Function
Public Function deleteWarenort(ByVal warenort As String, ByVal firma As String) As Boolean Public Function deleteWarenort(ByVal id As Integer) As Boolean
Try Try
SQL.doSQL("DELETE FROM [tblWarenorte] WHERE wo_warenort = '" & warenort & "' AND wo_firma='" & firma & "'", "AVISO") SQL.doSQL("DELETE FROM [tblWarenorte] WHERE wo_id = '" & id & "'", "AVISO")
Return True Return True
Catch ex As SqlException Catch ex As SqlException
MsgBox(System.Reflection.MethodInfo.GetCurrentMethod.Name & ": Datensatz kann nicht gelöscht werden!" & vbCrLf & vbCrLf & ex.Message, vbExclamation, "Fehler beim Löschen") MsgBox(System.Reflection.MethodInfo.GetCurrentMethod.Name & ": Datensatz kann nicht gelöscht werden!" & vbCrLf & vbCrLf & ex.Message, vbExclamation, "Fehler beim Löschen")
End Try End Try
Return False Return False