-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmKundenauswahl.vb
141 lines (115 loc) · 6.19 KB
/
frmKundenauswahl.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Public Class frmKundenauswahl
Private Sub txtSuchenKunde_KeyUp(sender As Object, e As KeyEventArgs) Handles txtSuchenKunde.KeyUp
If e.KeyCode = Keys.Enter Then
btnSuchen.PerformClick()
End If
End Sub
Private Sub btnAbrechen_Click(sender As Object, e As EventArgs) Handles btnAbrechen.Click
Me.Close()
End Sub
Private Sub btnOK_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnOK.Click
If lvwKunde.SelectedItems.Count > 0 Then
Dim strDivider As String = " | "
If lvwKunde.SelectedItems(0).SubItems(7).Text.Length > 0 Then
strDivider = " | "
Else
strDivider = ""
End If
frmJTLRechnung.lblKundenData.Text = "Kunde: " & lvwKunde.SelectedItems(0).SubItems(7).Text & strDivider & lvwKunde.SelectedItems(0).SubItems(1).Text & " " & lvwKunde.SelectedItems(0).SubItems(2).Text & " | " & lvwKunde.SelectedItems(0).SubItems(3).Text & " | " & lvwKunde.SelectedItems(0).SubItems(5).Text & " " & lvwKunde.SelectedItems(0).SubItems(4).Text & " | " & lvwKunde.SelectedItems(0).SubItems(8).Text
frmJTLRechnung.lblKundennummer.Text = lvwKunde.SelectedItems(0).SubItems(0).Text
'# Aktuellen Datensatz kopieren in das unsichtbare Listview
frmJTLRechnung.setLvwKundenUpdate(lvwKunde.SelectedItems(0).Clone)
frmJTLRechnung.txtSuchenKunde.Text = txtSuchenKunde.Text
End If
Me.Close()
End Sub
Private Sub frmKundenauswahl_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Call setLVWColumOrder(lvwKunde)
End Sub
Private Sub frmKundenauswahl_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If My.Settings.lvw_colum_save.Item(My.Settings.mandant_position) = True Then
Call getLVWColumOrder(lvwKunde)
End If
If frmJTLRechnung.clsDB.getDBConnect("") = False Then
Dim frmDBSetting As New frmDatenbankEinstellungen
frmDBSetting.ShowDialog()
End If
frmJTLRechnung.setMainWindowTitle("Kundenauswahl", Me)
If frmJTLRechnung.txtSuchenKunde.Text.Length > 0 Then
txtSuchenKunde.Text = frmJTLRechnung.txtSuchenKunde.Text
btnSuchen.PerformClick()
Dim iCount As Integer = 0
For iCount = 0 To lvwKunde.Items.Count - 1
If lvwKunde.Items(iCount).Text = frmJTLRechnung.lblKundennummer.Text Then
lvwKunde.Items(iCount).Selected = True
Exit For
End If
Next
End If
lvwKunde.LargeImageList = ImageList1
End Sub
Private Sub AlleKundenAnzeigenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
frmJTLRechnung.clsDB.getKunden_alle(lvwKunde)
End Sub
Private Sub lvwKunde_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
If lvwKunde.SelectedItems.Count > 0 Then
Dim strFirma As String = ""
If lvwKunde.SelectedItems(0).SubItems(7).Text.Length > 0 Then
strFirma = lvwKunde.SelectedItems(0).SubItems(7).Text & " / "
End If
frmJTLRechnung.lblKundenData.Text = "Kunde: " & strFirma & lvwKunde.SelectedItems(0).SubItems(1).Text & " " & lvwKunde.SelectedItems(0).SubItems(2).Text & " aus " & lvwKunde.SelectedItems(0).SubItems(3).Text
End If
End Sub
Private Sub NeuerKundeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NeuerKundeToolStripMenuItem1.Click
Call frmJTLRechnung.setNewKunde()
End Sub
Private Sub RouteDistanzAbrufenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call frmJTLRechnung.getRoutenPlaner(lvwKunde)
End Sub
Private Sub AlleKundenAnzeigenToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AlleKundenAnzeigenToolStripMenuItem.Click
txtSuchenKunde.Enabled = False
lvwKunde.Enabled = False
lvwKunde.Items.Clear()
frmJTLRechnung.clsDB.getKundenListe_suchen("", lvwKunde)
txtSuchenKunde.Enabled = True
lvwKunde.Enabled = True
End Sub
Private Sub RouteDistanzAbrufenToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RouteDistanzAbrufenToolStripMenuItem.Click
frmJTLRechnung.getRoutenPlaner(lvwKunde)
End Sub
Private Sub btnSuchen_Click(sender As System.Object, e As System.EventArgs) Handles btnSuchen.Click
txtSuchenKunde.Enabled = False
btnOK.Enabled = False
lvwKunde.Enabled = False
lvwKunde.Items.Clear()
frmJTLRechnung.clsDB.getKundenListe_suchen(txtSuchenKunde.Text, lvwKunde)
txtSuchenKunde.Enabled = True
lvwKunde.Enabled = True
End Sub
Private Sub lvwKunde_ColumnClick(sender As Object, e As System.Windows.Forms.ColumnClickEventArgs) Handles lvwKunde.ColumnClick
Call setSort(lvwKunde, e)
End Sub
Private Sub lvwKunde_DoubleClick(sender As Object, e As System.EventArgs) Handles lvwKunde.DoubleClick
If lvwKunde.SelectedItems.Count > 0 Then
btnOK.PerformClick()
End If
End Sub
Private Sub lvwKunde_SelectedIndexChanged_1(sender As System.Object, e As System.EventArgs) Handles lvwKunde.SelectedIndexChanged
If lvwKunde.SelectedItems.Count > 0 Then
btnOK.Enabled = True
Else
btnOK.Enabled = False
End If
End Sub
Private Sub txtSuchenKunde_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtSuchenKunde.TextChanged
End Sub
Private Sub btnNeuerKunde_Click(sender As System.Object, e As System.EventArgs) Handles btnNeuerKunde.Click
Dim frmNeuerKunde As New frmKunde_neu
frmNeuerKunde.lvwKunden = lvwKunde
frmNeuerKunde.Show()
End Sub
Private Sub AlsKassenkundenFestlegenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AlsKassenkundenFestlegenToolStripMenuItem.Click
My.Settings.strKassenKundenID(My.Settings.mandant_position) = lvwKunde.SelectedItems(0).Text
My.Settings.Save()
End Sub
End Class