Files
AVISO/Aviso/usrCntlSND_Ausfuhr.vb

135 lines
6.6 KiB
VB.net

Public Class usrCntlSND_Ausfuhr
Public NCTS_GA As VERAG_PROG_ALLGEMEIN.cNCTSGestellungsadressen
Sub New()
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
End Sub
Sub New(id)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
NCTS_GA = New VERAG_PROG_ALLGEMEIN.cNCTSGestellungsadressen(id)
End Sub
Public Sub setValues()
txtT1Verzollungsadresse.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 = txtT1Verzollungsadresse.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
Private Sub LinkLabel4_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel4.LinkClicked
Try
If Me.FindForm.GetType Is GetType(frmSendungsdetailsNEU) Then
Dim f = DirectCast(Me.FindForm, frmSendungsdetailsNEU)
If f.txtAbsender.KdNr > 0 AndAlso f.txtAbsender.KdData_ADRESSEN IsNot Nothing Then
txtT1Verzollungsadresse.Text = (If(f.txtAbsender.KdData_ADRESSEN.Name_1, "") & " " & If(f.txtAbsender.KdData_ADRESSEN.Name_2, "")).trim
txtT1VerzollungsadresseStrasse.Text = If(f.txtAbsender.KdData_ADRESSEN.Straße, "")
txtT1VerzollungsadressePlz.Text = If(f.txtAbsender.KdData_ADRESSEN.PLZ, "")
txtT1VerzollungsadresseOrt.Text = If(f.txtAbsender.KdData_ADRESSEN.Ort, "")
sbT1VerzollungsadresseLand.SET_VALUE(SDL.cProgramFunctions.getISO2Land(If(f.txtAbsender.KdData_ADRESSEN.LandKz, "")))
If f.txtAbsender.KdData_KUNDE IsNot Nothing Then
txtT1VerzollungsadresseEORI.Text = If(f.txtAbsender.KdData_KUNDE.EORITIN, "")
txtT1VerzollungsadresseEORI_NL.Text = If(f.txtAbsender.KdData_KUNDE.EORITIN_NL, "")
End If
Else
txtT1Verzollungsadresse.Text = f.txtAbsender.Text
End If
End If
Catch ex As Exception
End Try
End Sub
Private Sub usrCntlSND_NCTSGestellungsadresse_Load(sender As Object, e As EventArgs) Handles Me.Load
If NCTS_GA Is Nothing Then : NCTS_GA = New VERAG_PROG_ALLGEMEIN.cNCTSGestellungsadressen
Else : setValues() : End If
' txtT1VerzollungsadresseBestimmungszollstelle.initSearchBox(Me.FindForm, "[basncd_dstnr] ,[basncd_dstnr] as Nr,[basncd_name] as Dienststelle,[basncd_alpha] as Land,[basncd_dstnr] +' - ' + [basncd_name] +' (' +[basncd_alpha]+')' as displayPARAM FROM basncd", {" [basncd_dstnr]", "basncd_name"}, " [basncd_gbdat] >= getdate() ", " basncd_alpha,[basncd_name]", "basncd_dstnr", "displayPARAM", "ATLAS", , 400, 200, {"displayPARAM", "basncd_dstnr"})
txtT1VerzollungsadresseBestimmungszollstelle.initSearchBox(Me.FindForm, "[Code] ,[Code] as Nr,Description as Dienststelle,left(Code,2) as Land,[Code] +' - ' + [Description] +' (' +left(Code,2)+')' as displayPARAM FROM [tbl_DY_ZollDE_C0141_Zollstellen]", {" [Code]", "Description"}, " (StartDate is null OR StartDate< GETDATE()) AND (EndDate is null OR EndDate> GETDATE()) ", " left(Code,2),[Description]", "Code", "displayPARAM", "FMZOLL", True, 400, 200, {"displayPARAM", "Code"})
sbT1VerzollungsadresseLand.initSearchBox(Me.FindForm, " [Code] ,[Description] as Land,[Code] display FROM tbl_DY_ZollDE_C0008_LaenderFull", {"Code", "Description"}, " (StartDate is null OR StartDate< GETDATE()) AND (EndDate is null OR EndDate> GETDATE()) ", "Code", "Code", "display", "FMZOLL", , 400, 200)
txtT1Verzollungsadresse.initSearchBox(Me.FindForm, " [nga_id] ,[nga_name] as Name,isnull(nga_ort,'') as Ort FROM tblNCTSGestellungsadressen", {"nga_id", "nga_name", "nga_ort", "nga_strasse", "nga_bestZollst", "nga_EORI"}, " nga_firma='" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' ", "nga_id", "nga_id", "Name", "FMZOLL", , 400, 200, {"nga_id"})
End Sub
Sub reset()
NCTS_GA = New VERAG_PROG_ALLGEMEIN.cNCTSGestellungsadressen
setValues()
End Sub
Private Sub btn_Click(sender As Object, e As EventArgs) Handles btn.Click
Save_Me()
End Sub
Function Save_Me() As Boolean
getValues()
Save_Me = NCTS_GA.SAVE
lblNGAId.Text = NCTS_GA.nga_id
End Function
Private Sub txtT1Verzollungsadresse_VALUE_CHANGED() Handles txtT1Verzollungsadresse.VALUE_CHANGED
If txtT1Verzollungsadresse._value <> "" Then
NCTS_GA = New VERAG_PROG_ALLGEMEIN.cNCTSGestellungsadressen(txtT1Verzollungsadresse._value)
setValues()
End If
End Sub
Private Sub lblNGAId_Click(sender As Object, e As EventArgs) Handles lblNGAId.Click
reset()
End Sub
Private Sub picDel_Click(sender As Object, e As EventArgs) Handles picDel.Click
If vbYes = MsgBox("Möchten Sie die NCTS-Gestellungsadresse wirklich löschen?", vbYesNoCancel + MsgBoxStyle.DefaultButton2) Then
NCTS_GA.DELETE()
NCTS_GA = New VERAG_PROG_ALLGEMEIN.cNCTSGestellungsadressen
setValues()
End If
End Sub
End Class