Projektdateien hinzufügen.
This commit is contained in:
140
UID/usrcntlAdresse.vb
Normal file
140
UID/usrcntlAdresse.vb
Normal file
@@ -0,0 +1,140 @@
|
||||
Public Class usrcntlAdresse
|
||||
Property _BeteiligterName As String = "-"
|
||||
Property ATR_ID As Integer = -1
|
||||
Property BET_ID As Integer = -1
|
||||
|
||||
Public loaded = False
|
||||
|
||||
Dim DISPO As New cOptionenDAL
|
||||
|
||||
Private Sub usrcntlAdresse_Layout(sender As Object, e As LayoutEventArgs) Handles Me.Layout
|
||||
lblBeteiligterBez.Text = _BeteiligterName
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub lblChange_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lblChange.LinkClicked
|
||||
DISPO.updateKundenDaten(BET_ID, txtFirma.Text, txtStr.Text, txtStrnr.Text, txtPlz.Text, txtOrt.Text, cboLand.Text)
|
||||
'If auftragID >= 0 Then btnSave.PerformClick()
|
||||
lblChange.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub txtFirma_TextChanged(sender As Object, e As EventArgs) Handles txtFirma.TextChanged
|
||||
'If pic.Visible Then lblChange.Visible = True 'probleme wenn aus versehen überschrieben
|
||||
lblNotFound.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub lblOld_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lblOld.LinkClicked
|
||||
If BET_ID > 0 Then
|
||||
Dim KD As New cEntry
|
||||
If KD.LOAD(BET_ID) Then
|
||||
setByKD(KD)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
|
||||
Dim frmSearch As New frmSearch
|
||||
If frmSearch.ShowDialog(Me) = DialogResult.OK Then
|
||||
If frmSearch.KD IsNot Nothing Then
|
||||
setByKD(frmSearch.KD)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub pic_Click(sender As Object, e As EventArgs) Handles pic.Click
|
||||
BET_ID = -1
|
||||
pic.Visible = False : lblChange.Visible = False : lblOld.Visible = False
|
||||
End Sub
|
||||
|
||||
Sub setByKD(KD As cEntry)
|
||||
|
||||
checkKDExists()
|
||||
loaded = False
|
||||
txtFirma.Text = KD.kd_firma
|
||||
txtStr.Text = KD.kd_str
|
||||
txtStrnr.Text = KD.kd_strnr
|
||||
cboLand.Text = KD.kd_land
|
||||
txtPlz.Text = KD.kd_plz
|
||||
txtOrt.Text = KD.kd_ort
|
||||
txtAnpsr.Text = (KD.kd_anspr1_vn & " " & KD.kd_anspr1_nn).Trim
|
||||
If KD.kd_FMZOLL_KdNr IsNot Nothing AndAlso IsNumeric(KD.kd_FMZOLL_KdNr) Then
|
||||
kdFirma.KdNr = KD.kd_FMZOLL_KdNr
|
||||
End If
|
||||
' ATR_ID = BET_ID
|
||||
BET_ID = KD.kd_id
|
||||
|
||||
pic.Visible = True
|
||||
lblChange.Visible = False
|
||||
lblOld.Visible = False
|
||||
lblNotFound.Visible = False
|
||||
loaded = True
|
||||
End Sub
|
||||
|
||||
Sub setByID(id)
|
||||
checkKDExists()
|
||||
If id Is Nothing Then Exit Sub
|
||||
Dim KD As New cEntry(id)
|
||||
If Not KD.hasEntry Then Exit Sub
|
||||
loaded = False
|
||||
txtFirma.Text = KD.kd_firma
|
||||
txtStr.Text = KD.kd_str
|
||||
txtStrnr.Text = KD.kd_strnr
|
||||
cboLand.Text = KD.kd_land
|
||||
txtPlz.Text = KD.kd_plz
|
||||
txtOrt.Text = KD.kd_ort
|
||||
txtAnpsr.Text = (KD.kd_anspr1_vn & " " & KD.kd_anspr1_nn).Trim
|
||||
If KD.kd_FMZOLL_KdNr IsNot Nothing AndAlso IsNumeric(KD.kd_FMZOLL_KdNr) Then
|
||||
kdFirma.KdNr = KD.kd_FMZOLL_KdNr
|
||||
End If
|
||||
' ATR_ID = BET_ID
|
||||
BET_ID = id
|
||||
|
||||
pic.Visible = True
|
||||
lblChange.Visible = False
|
||||
lblOld.Visible = False
|
||||
lblNotFound.Visible = False
|
||||
loaded = True
|
||||
End Sub
|
||||
|
||||
|
||||
Sub checkKDExists()
|
||||
If BET_ID < 0 OrElse DISPO.existsKunde(BET_ID) Then
|
||||
pic.Visible = True
|
||||
Else : lblNotFound.Visible = True : End If
|
||||
End Sub
|
||||
|
||||
Private Sub usrcntlAdresse_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
kdFirma.initKdBox(Me.FindForm)
|
||||
loaded = True
|
||||
End Sub
|
||||
|
||||
Sub setKdNrWOEvent(kdNr)
|
||||
loaded = False
|
||||
If kdNr IsNot Nothing AndAlso IsNumeric(kdNr) Then
|
||||
kdFirma.KdNr = kdNr
|
||||
End If
|
||||
loaded = True
|
||||
End Sub
|
||||
|
||||
Private Sub kdFirma_TextChanged() Handles kdFirma.PropertyChanged
|
||||
'MsgBox(loaded)
|
||||
If Not loaded Then Exit Sub 'NUR WEnn geladen!
|
||||
' MsgBox(kdFirma.KdNrNullInt)
|
||||
If kdFirma.KdNrNullInt IsNot Nothing Then
|
||||
' MsgBox(kdFirma.KdData_ADRESSEN)
|
||||
If kdFirma.KdData_ADRESSEN IsNot Nothing Then
|
||||
Dim AD = kdFirma.KdData_ADRESSEN
|
||||
txtFirma.Text = AD.Ordnungsbegriff
|
||||
txtStr.Text = AD.Straße
|
||||
txtPlz.Text = AD.PLZ
|
||||
txtOrt.Text = AD.Ort
|
||||
If AD.LandKz IsNot Nothing Then
|
||||
cboLand.Text = If(AD.LandKz.ToString.Length = 1, SDL.cProgramFunctions.getISO2Land(AD.LandKz), AD.LandKz)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user