71 lines
2.9 KiB
VB.net
71 lines
2.9 KiB
VB.net
|
|
Public Class frmKundenFremdeSpedAdd
|
|
Dim FREMD As VERAG_PROG_ALLGEMEIN.cFremdSpeditionenZuordnung = Nothing
|
|
Dim WithEvents binding As New cBinding("FMZOLL")
|
|
Public id As Integer = -1
|
|
|
|
Private Sub frmKundenFremdeSpedAdd_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
txtSpedition.initKdBox(Me, txtSpeditionKdNr)
|
|
txtFirma.initKdBox(Me, txtFirmaKdNr)
|
|
|
|
AddHandler txtFirma.PropertyChanged, Sub()
|
|
If txtFirma.KdData_ADRESSEN IsNot Nothing Then
|
|
If txtFirma.KdData_ADRESSEN.Ort <> "" Then txtOrt.Text = txtFirma.KdData_ADRESSEN.Ort
|
|
If txtFirma.KdData_ADRESSEN.PLZ <> "" Then txtPlz.Text = txtFirma.KdData_ADRESSEN.PLZ
|
|
End If
|
|
End Sub
|
|
|
|
'Ä RemoveHandler binding.bindingdataTable.ColumnChanged, AddressOf change
|
|
' AddHandler binding.bindingdataTable.ColumnChanged, AddressOf change
|
|
End Sub
|
|
|
|
Private Sub SAVE_Click(sender As Object, e As EventArgs) Handles btnOK.Click
|
|
|
|
FREMD.fremdz_KundenNr = If(IsNumeric(txtFirmaKdNr.Text), txtFirmaKdNr.Text, Nothing)
|
|
|
|
FREMD.fremdz_firma = txtFirma.Text
|
|
'FREMD.fremdz_SpeditionKundenNr = txtSpedition.KdNrNullInt
|
|
FREMD.fremdz_SpeditionKundenNr = If(IsNumeric(txtSpeditionKdNr.Text), txtSpeditionKdNr.Text, Nothing)
|
|
FREMD.fremdz_verzolltBei = txtSpedition.Text
|
|
|
|
FREMD.fremdz_ort = txtOrt.Text
|
|
FREMD.fremdz_plz = txtPlz.Text
|
|
FREMD.fremdz_bemerkung = txtBemerkung.Text
|
|
FREMD.fremdz_Datum = Now
|
|
FREMD.fremdz_Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
|
|
|
|
If FREMD.SAVE() Then
|
|
Me.DialogResult = DialogResult.OK
|
|
Me.Close()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
Me.DialogResult = DialogResult.Cancel
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub frmKundenFremdeSpedAdd_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
|
FREMD = New VERAG_PROG_ALLGEMEIN.cFremdSpeditionenZuordnung(id)
|
|
|
|
If FREMD.hasEntry Then
|
|
If FREMD.fremdz_KundenNr IsNot Nothing And FREMD.fremdz_KundenNr > 0 Then
|
|
txtFirma.KdNr = FREMD.fremdz_KundenNr
|
|
Else
|
|
txtFirma.Text = If(FREMD.fremdz_firma, "")
|
|
End If
|
|
If FREMD.fremdz_SpeditionKundenNr IsNot Nothing And FREMD.fremdz_SpeditionKundenNr > 0 Then
|
|
txtSpedition.KdNr = FREMD.fremdz_SpeditionKundenNr
|
|
Else
|
|
txtSpedition.Text = If(FREMD.fremdz_verzolltBei, "")
|
|
End If
|
|
|
|
txtOrt.Text = If(FREMD.fremdz_ort, "")
|
|
txtPlz.Text = If(FREMD.fremdz_plz, "")
|
|
txtBemerkung.Text = If(FREMD.fremdz_bemerkung, "")
|
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
End Class |