neu
This commit is contained in:
@@ -23,8 +23,12 @@ Public Class cVERAG_in_eza_FULL
|
||||
|
||||
Property shTr_id As Integer
|
||||
Property shTr_Partnersystem As String = ""
|
||||
Property trAv_Info As String = ""
|
||||
|
||||
|
||||
|
||||
Property shTr_Status As String = ""
|
||||
Public Property shTr_TRAvisoId As Object = Nothing
|
||||
|
||||
|
||||
Sub New(EZA As cVERAG_in_eza)
|
||||
@@ -45,6 +49,8 @@ Public Class cVERAG_in_eza_FULL
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTr_id", shTr_id, , True, True, True))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTr_Partnersystem", shTr_Partnersystem,,,, True))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTr_Status", shTr_Status,,,, True))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTr_TRAvisoId", shTr_TRAvisoId,,,, True))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("trAv_Info", trAv_Info,,,, True))
|
||||
|
||||
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Company", EZA.Company))
|
||||
@@ -122,6 +128,22 @@ Public Class cVERAG_in_eza_FULL
|
||||
End Function
|
||||
|
||||
|
||||
Function getParameterList_DOC(DOC As cVERAG_in_shipment_Document) As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||
' list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTrPosDoc_id", POS.GoodsTariff, , True, True))
|
||||
|
||||
'list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTrDoc_id", Me.shTr_id,,,, True))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTrDoc_ShTrId", Me.shTr_id))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DocumentType", DOC.DocumentType))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DocmentNr", DOC.DocmentNr))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DocumentDate", DOC.DocumentDate))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTrPosDoc_docID", DOC.shTrPosDoc_docID))
|
||||
|
||||
Return list
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Function getParameterList_ADR(ADR As cVERAG_in_eza_Adressen) As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||
' list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("shTrPos_id", POS.GoodsTariff, , True, True))
|
||||
@@ -184,6 +206,7 @@ Public Class cVERAG_in_eza_FULL
|
||||
If EZA Is Nothing Then Return False
|
||||
If Not SAVE() Then Return False
|
||||
If Not SAVE_Warenposition() Then Return False
|
||||
If Not SAVE_Documents() Then Return False
|
||||
If Not SAVE_Adressen() Then Return False
|
||||
Return True
|
||||
End Function
|
||||
@@ -455,6 +478,11 @@ Public Class cVERAG_in_eza_FULL
|
||||
Dim sqlstr = " DELETE FROM [tblTR_Shipment_Position] WHERE shTrPos_ShTrId=" & Me.shTr_id & " "
|
||||
Return SQL.doSQL(sqlstr, "FMZOLL")
|
||||
End Function
|
||||
Function DELETE_Documents() As Boolean 'obj As Object, tablename As String, where As String) As Boolean
|
||||
Dim sqlstr = " DELETE FROM [tblTR_Shipment_Document] WHERE [shTrDoc_ShTrId]=" & Me.shTr_id & " "
|
||||
Return SQL.doSQL(sqlstr, "FMZOLL")
|
||||
End Function
|
||||
|
||||
|
||||
Function DELETE_WarenpositionUnterlagen() As Boolean 'obj As Object, tablename As String, where As String) As Boolean
|
||||
Dim sqlstr = " DELETE FROM [tblTR_Shipment_Position_Document] WHERE shTrPosDoc_ShTrId =" & Me.shTr_id & " "
|
||||
@@ -510,6 +538,28 @@ Public Class cVERAG_in_eza_FULL
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SAVE_Documents() As Boolean
|
||||
'Zuserst alle OffertenPos von dem Offert löschen
|
||||
If DELETE_Documents() Then
|
||||
If EZA.POSITIONS IsNot Nothing Then
|
||||
'jetzt die Standartofferten einfügen
|
||||
For Each p In EZA.DOCUMENTS
|
||||
Dim posId As Integer
|
||||
If INSERT_Documents(posId, p) Then
|
||||
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
Public Function SAVE_Warenposition_Documents(POS As cVERAG_in_eza_position, posId As Integer) As Boolean
|
||||
'Zuserst alle OffertenPos von dem Offert löschen
|
||||
'jetzt die Standartofferten einfügen
|
||||
@@ -564,6 +614,29 @@ Public Class cVERAG_in_eza_FULL
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function INSERT_Documents(ByRef docId As Integer, ByRef DOC As cVERAG_in_shipment_Document) As Boolean
|
||||
Try
|
||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList_DOC(DOC)
|
||||
Dim str As String = ""
|
||||
Dim values As String = ""
|
||||
For Each i In list
|
||||
If Not i.isPrimaryParam Then
|
||||
str &= "[" & i.Text & "],"
|
||||
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
|
||||
End If
|
||||
Next
|
||||
str = str.Substring(0, str.Length - 1) 'wg. ','
|
||||
values = values.Substring(0, values.Length - 1) 'wg. ','
|
||||
Return SQL.doSQLVarListID(docId, (" INSERT INTO tblTR_Shipment_Document (" & str & ") VALUES(" & values & ") "), "FMZOLL", , list)
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||
End Try
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
Public Function INSERT_Position_Document(ByRef posId As Integer, ByRef DOC As cVERAG_in_eza_position_document) As Boolean
|
||||
Try
|
||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList_DOC(DOC, posId)
|
||||
@@ -597,10 +670,8 @@ Public Class cVERAG_in_eza
|
||||
|
||||
Public Property Company As String
|
||||
Public Property Department As String
|
||||
|
||||
Public Property Reference As String
|
||||
|
||||
|
||||
Public Property DeclarationCountry As String = ""
|
||||
Public Property DeclarationType As String = ""
|
||||
|
||||
@@ -636,6 +707,7 @@ Public Class cVERAG_in_eza
|
||||
|
||||
|
||||
Public Property POSITIONS As New List(Of cVERAG_in_eza_position)
|
||||
Public Property DOCUMENTS As New List(Of cVERAG_in_shipment_Document)
|
||||
|
||||
Public Property ADDRESS As New List(Of cVERAG_in_eza_Adressen)
|
||||
|
||||
@@ -699,3 +771,43 @@ Public Class cVERAG_in_eza_position_document
|
||||
Public Property DocmentNr As String = ""
|
||||
Public Property DocumentDate As Date = CDate("01.01.1800")
|
||||
End Class
|
||||
|
||||
|
||||
Public Class cVERAG_in_shipment_Document
|
||||
Property shTrDoc_id As Integer
|
||||
Property shTrDoc_ShTrId As Integer
|
||||
Property DocumentType As String = ""
|
||||
Property DocmentNr As String = ""
|
||||
Property DocumentDate As Date = CDate("01.01.1800")
|
||||
|
||||
Property shTrPosDoc_docID As Object = Nothing
|
||||
|
||||
|
||||
'Public Function INSERT() As Boolean
|
||||
' Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||
' 'Return SQL.doSQLVarList(getInsertCmd, "FMZOLL", , list)
|
||||
' shTrDoc_id = SQL.doSQLVarListID(shTrDoc_id, getInsertCmd, "FMZOLL", , list)
|
||||
' Return shTrDoc_id > 0
|
||||
'End Function
|
||||
|
||||
'Public Function getInsertCmd() As String
|
||||
' Try
|
||||
' Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||
' Dim str As String = ""
|
||||
' Dim values As String = ""
|
||||
' For Each i In list
|
||||
' If Not i.isPrimaryParam Then
|
||||
' str &= "[" & i.Text & "],"
|
||||
' values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
|
||||
' End If
|
||||
' Next
|
||||
' str = str.Substring(0, str.Length - 1) 'wg. ','
|
||||
' values = values.Substring(0, values.Length - 1) 'wg. ','
|
||||
' Return (" INSERT INTO tblVERAG_in_shippment_Positionsdaten (" & str & ") VALUES(" & values & ") ")
|
||||
' Catch ex As Exception
|
||||
' MsgBox("Fehler In der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||
' End Try
|
||||
' Return ""
|
||||
'End Function
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user