Feature: Offerten

This commit is contained in:
2022-11-16 17:18:30 +01:00
parent ddd6682105
commit 6b278a1f60
4 changed files with 395 additions and 210 deletions

View File

@@ -77,7 +77,7 @@ Public Class cOfferte
Property Gesperrt As Object = Nothing
Property Gesperrt_Datum As Object = Nothing
Property Gesperrt_Grund As Object = Nothing
Property SSMA_TimeStamp As Object = Nothing
Property POSITIONEN As New List(Of cOffertPosition) '= Nothing
Dim SQL As New SQL
@@ -304,6 +304,40 @@ Public Class cOfferte
End Function
Public Function SAVETOARCHIVE() As Boolean
Dim sqlstr = "BEGIN TRAN " &
"BEGIN " & getInsertToArchiveCmd() & " END " &
" commit tran "
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("SSMA_TimeStamp", SSMA_TimeStamp))
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
Public Function getInsertToArchiveCmd() As String
Try
Me.Eingegeben_am = Now
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 tblOffertenArchiv (" & 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
@@ -325,6 +359,7 @@ Public Class cOffertPosition
Property PreisänderungProzent As Object = Nothing
Property PreisAlt As Object = Nothing
Property BerechnungsartPosInkludiert As Object = Nothing
Property SSMA_TimeStamp As Object = Nothing
Dim SQL As New SQL
@@ -360,6 +395,13 @@ Public Class cOffertPosition
Return SQL.doSQLVarList(getInsertCmd, "FMZOLL", , list)
End Function
Public Function INSERTTOARCHIVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("SSMA_TimeStamp", SSMA_TimeStamp))
Return SQL.doSQLVarList(getInsertToArchiveCmd, "FMZOLL", , list)
End Function
Public Function getInsertCmd() As String
Try
Me.Eingegeben_am = Now
@@ -380,4 +422,27 @@ Public Class cOffertPosition
End Try
Return ""
End Function
Public Function getInsertToArchiveCmd() As String
Try
Me.Eingegeben_am = Now
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 tblOffertenPositionenArchiv (" & 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