Files
AVISO/Aviso/usrCntlSND_ATBGestellung.vb

141 lines
5.0 KiB
VB.net

Imports VERAG_PROG_ALLGEMEIN
Public Class usrCntlSND_ATBGestellung
Dim _SendungsId As Object
Public firmaId As Integer
'Public NCTS_GA As VERAG_PROG_ALLGEMEIN.cNCTSGestellungsadressen
Sub New(SendungsId)
_SendungsId = SendungsId
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
End Sub
Private Sub btnGesSicherheit_Click(sender As Object, e As EventArgs) Handles btnGesSicherheit.Click
If txtATBT1.Text <> "" Then
Dim SND As New cSendungen(_SendungsId)
Dim Standort = ""
Select Case SND.FilialenNr
Case 4803, 4809
Standort = "VERAG AG" : firmaId = 1
Case 5601
Standort = "Unisped GmbH" : firmaId = 21
Case 5701
Standort = "AMBAR" : firmaId = 24
Case 4810,
Standort = "VERAG GmbH" : firmaId = 1
Case 5103
Standort = "VERAG CS" : firmaId = 11
Case 5501
Standort = "IMEX" : firmaId = 20
End Select
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort)
If GesSichRef Is Nothing Then
Exit Sub
End If
Dim SQL As New SQL
Dim gsid As Integer = 0
Dim SQLString As String = "Select top (1) gs_gsNr from [tblGesamtsicherheit] where [gs_ATBNr] = '" & txtATBT1.Text & "' or ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) or gs_avisoId = '" & SND.tblSnd_AvisoID & "' "
Dim dt As New DataTable
dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True)
If dt.Rows.Count > 0 Then
gsid = dt.Rows(0).Item("gs_gsNr")
End If
Dim frm As New frmGesamtsicherheitenNEU
If gsid > 0 Then
With frm
.currentGesSichRef = GesSichRef
.gessicherheitID = gsid
.Standort = Standort
.FilialNummer = SND.FilialenNr
.Abfertigungsnummer = SND.AbfertigungsNr
.firmaId = firmaId
End With
AddHandler frm.FormClosing, Function()
GesSichRef.CalcSaldo()
Me.BringToFront()
End Function
frm.Show()
Else
With frm
.currentGesSichRef = GesSichRef
.Standort = Standort
.datum = Date.Now
.Neu = True
.FilialNummer = SND.FilialenNr
.Abfertigungsnummer = SND.AbfertigungsNr
.firmaId = firmaId
End With
AddHandler frm.FormClosing, Function()
GesSichRef.CalcSaldo()
Me.BringToFront()
End Function
frm.Show(Me)
End If
End If
End Sub
'Public Sub setValues()
' txtATBT1.Text = If(NCTS_GA.nga_name, "")
' txtT1VerzollungsadresseStrasse.Text = If(NCTS_GA.nga_strasse, "")
' txtT1VerzollungsadressePlz.Text = If(NCTS_GA.nga_plz, "")
' txtT1VerzollungsadresseOrt.Text = If(NCTS_GA.nga_ort, "")
' sbT1VerzollungsadresseLand.SET_VALUE(If(NCTS_GA.nga_land, ""))
' txtT1VerzollungsadresseAnspr.Text = If(NCTS_GA.nga_Ansprechpartner, "")
' txtT1VerzollungsadresseEORI.Text = If(NCTS_GA.nga_EORI, "")
' txtT1VerzollungsadresseEORI_NL.Text = If(NCTS_GA.nga_EORI_NL, "")
' txtT1VerzollungsadresseBestimmungszollstelle.SET_VALUE(If(NCTS_GA.nga_bestZollst, ""))
' lblNGAId.Text = If(NCTS_GA.nga_id > 0, NCTS_GA.nga_id, "-")
' picDel.Visible = (NCTS_GA.nga_id > 0)
'End Sub
'Public Sub getValues()
' NCTS_GA.nga_name = txtATBT1.Text
' NCTS_GA.nga_strasse = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseStrasse.Text)
' NCTS_GA.nga_plz = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadressePlz.Text)
' NCTS_GA.nga_ort = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseOrt.Text)
' NCTS_GA.nga_land = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(sbT1VerzollungsadresseLand._value)
' NCTS_GA.nga_Ansprechpartner = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseAnspr.Text)
' NCTS_GA.nga_EORI = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseEORI.Text)
' NCTS_GA.nga_EORI_NL = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseEORI_NL.Text)
' NCTS_GA.nga_bestZollst = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseBestimmungszollstelle._value)
'End Sub
End Class