92 lines
3.0 KiB
VB.net
92 lines
3.0 KiB
VB.net
Imports SDL
|
|
Public Class frmZoll
|
|
Dim kdNr As Integer = -1
|
|
|
|
Dim kundenSQL As New SDL.kundenSQL
|
|
Dim acd As List(Of cAutoCompleteData) = kundenSQL.getKundenShort()
|
|
|
|
Private Sub frmZoll_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
|
|
Dim acsc As New AutoCompleteStringCollection
|
|
For Each a In acd
|
|
acsc.Add(a.AutoCompleteString)
|
|
Next
|
|
cboJumpToKd_Firma.AutoCompleteMode = AutoCompleteMode.SuggestAppend
|
|
cboJumpToKd_Firma.AutoCompleteSource = AutoCompleteSource.CustomSource
|
|
cboJumpToKd_Firma.AutoCompleteCustomSource = acsc
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub cboJumpToKd_Firma_KeyDown(sender As Object, e As KeyEventArgs) Handles cboJumpToKd_Firma.KeyUp
|
|
' txtJumpToKd_KdNR.Text = ""
|
|
If (e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Return Or e.KeyCode = Keys.Tab) AndAlso DirectCast(sender, ComboBox).Text <> "" Then
|
|
getKdNrSearch()
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
Sub getKdNrSearch()
|
|
Me.Cursor = Cursors.WaitCursor
|
|
Me.Enabled = False
|
|
For Each a In acd
|
|
If a.AutoCompleteString.ToLower = cboJumpToKd_Firma.Text.ToLower Then
|
|
' kdNr =
|
|
txtKdNr.Text = CStr(a.AutoCompleteProperty)
|
|
End If
|
|
Next
|
|
Me.Enabled = True
|
|
Me.Cursor = Cursors.Default
|
|
End Sub
|
|
|
|
Private Sub txtKdNr_TextChanged_1(sender As Object, e As EventArgs) Handles txtKdNr.TextChanged
|
|
lblInfo.Visible = True
|
|
Panel1.Controls.Clear()
|
|
If IsNumeric(txtKdNr.Text) Then
|
|
Dim k As cKundenFMZOLL = kundenSQL.getKundeFMZOLLByKdNr(CInt(txtKdNr.Text))
|
|
|
|
If Not k Is Nothing And k.KundeFound Then
|
|
lblInfo.Visible = False
|
|
lblFirma.Text = k.Ordnungsbegriff
|
|
lblEORINr.Text = k.EORITIN
|
|
' lblAufschubKtoZoll.Text = k.Aufschubkonto_Zoll
|
|
' lblAufschubKtoEUST.Text = k.Aufschubkonto_EUSt
|
|
lblStrasse.Text = k.Straße
|
|
lblOrt.Text = k.LandKz & " " & k.PLZ & " " & k.Ort
|
|
initZollTarife()
|
|
' MsgBox("nn")
|
|
End If
|
|
|
|
Else
|
|
lblFirma.Text = ""
|
|
lblEORINr.Text = ""
|
|
' lblAufschubKtoZoll.Text = ""
|
|
' lblAufschubKtoEUST.Text = ""
|
|
lblStrasse.Text = ""
|
|
lblOrt.Text = ""
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Sub initZollTarife()
|
|
Dim usrcntl As New SDL.usrCntlZollArtikel
|
|
|
|
usrcntl.displayFilter = True
|
|
usrcntl.Dock = DockStyle.Fill
|
|
usrcntl.kdnr = CInt(txtKdNr.Text)
|
|
usrcntl.parentKundenblatt = True
|
|
Panel1.Controls.Clear()
|
|
Panel1.Controls.Add(usrcntl)
|
|
End Sub
|
|
|
|
Private Sub btnKdSearch_Click(sender As Object, e As EventArgs) Handles btnKdSearch.Click
|
|
If cboJumpToKd_Firma.Text <> "" Then
|
|
getKdNrSearch()
|
|
Else
|
|
txtKdNr_TextChanged_1(txtKdNr, New EventArgs)
|
|
End If
|
|
|
|
End Sub
|
|
End Class |