-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmRemoveMember.vb
224 lines (192 loc) · 8.7 KB
/
frmRemoveMember.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
Public Class frmRemoveMember
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents tbMemID As System.Windows.Forms.TextBox
Friend WithEvents btnCheck As System.Windows.Forms.Button
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnDelete As System.Windows.Forms.Button
Friend WithEvents DG As System.Windows.Forms.DataGrid
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents cmbType As System.Windows.Forms.ComboBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.tbMemID = New System.Windows.Forms.TextBox
Me.btnCheck = New System.Windows.Forms.Button
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.DG = New System.Windows.Forms.DataGrid
Me.btnCancel = New System.Windows.Forms.Button
Me.btnDelete = New System.Windows.Forms.Button
Me.Label2 = New System.Windows.Forms.Label
Me.cmbType = New System.Windows.Forms.ComboBox
Me.GroupBox1.SuspendLayout()
CType(Me.DG, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Book Antiqua", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(40, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(129, 23)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Enter the Member ID"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'tbMemID
'
Me.tbMemID.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
Me.tbMemID.Font = New System.Drawing.Font("Book Antiqua", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.tbMemID.Location = New System.Drawing.Point(168, 8)
Me.tbMemID.MaxLength = 20
Me.tbMemID.Name = "tbMemID"
Me.tbMemID.Size = New System.Drawing.Size(112, 22)
Me.tbMemID.TabIndex = 1
Me.tbMemID.Text = ""
'
'btnCheck
'
Me.btnCheck.Font = New System.Drawing.Font("Book Antiqua", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnCheck.Location = New System.Drawing.Point(360, 24)
Me.btnCheck.Name = "btnCheck"
Me.btnCheck.Size = New System.Drawing.Size(112, 23)
Me.btnCheck.TabIndex = 4
Me.btnCheck.Text = "&Check Records"
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.DG)
Me.GroupBox1.Font = New System.Drawing.Font("Book Antiqua", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GroupBox1.Location = New System.Drawing.Point(8, 72)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(552, 184)
Me.GroupBox1.TabIndex = 5
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Overdue Books"
'
'DG
'
Me.DG.DataMember = ""
Me.DG.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DG.Location = New System.Drawing.Point(8, 17)
Me.DG.Name = "DG"
Me.DG.Size = New System.Drawing.Size(536, 159)
Me.DG.TabIndex = 0
'
'btnCancel
'
Me.btnCancel.Font = New System.Drawing.Font("Book Antiqua", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnCancel.Location = New System.Drawing.Point(456, 264)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(64, 23)
Me.btnCancel.TabIndex = 7
Me.btnCancel.Text = "&Exit"
'
'btnDelete
'
Me.btnDelete.Enabled = False
Me.btnDelete.Font = New System.Drawing.Font("Book Antiqua", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDelete.Location = New System.Drawing.Point(368, 264)
Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(64, 23)
Me.btnDelete.TabIndex = 6
Me.btnDelete.Text = "&Delete"
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("Book Antiqua", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(40, 38)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(67, 23)
Me.Label2.TabIndex = 8
Me.Label2.Text = "Type"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'cmbType
'
Me.cmbType.Font = New System.Drawing.Font("Book Antiqua", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmbType.Items.AddRange(New Object() {"Staff", "Student"})
Me.cmbType.Location = New System.Drawing.Point(168, 39)
Me.cmbType.Name = "cmbType"
Me.cmbType.Size = New System.Drawing.Size(112, 24)
Me.cmbType.TabIndex = 9
'
'frmRemoveMember
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.Highlight
Me.ClientSize = New System.Drawing.Size(568, 294)
Me.Controls.Add(Me.cmbType)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnDelete)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.btnCheck)
Me.Controls.Add(Me.tbMemID)
Me.Controls.Add(Me.Label1)
Me.Name = "frmRemoveMember"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Delete Member"
Me.GroupBox1.ResumeLayout(False)
CType(Me.DG, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
#Region "Check Overdue Books"
Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click
DG.Refresh()
btnDelete.Enabled = False
If cmbType.Text = "Staff" Then
Dim Stf As New ClassStaff
Stf.Search_Member(tbMemID.Text, DG)
ElseIf cmbType.Text = "Student" Then
Dim Stu As New ClassStudent
Stu.Search_Member(tbMemID.Text, DG)
ElseIf cmbType.Text = "" Then
MessageBox.Show("Enter the Type", "Verify Member", MessageBoxButtons.OK, MessageBoxIcon.Information)
ElseIf tbMemID.Text = "" Then
MessageBox.Show("Enter the Member ID", "Verify Member", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
If DG.VisibleRowCount > 1 Then
Exit Sub
Else
btnDelete.Enabled = True
End If
End Sub
#End Region
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
If cmbType.Text = "Staff" Then
Dim Stf As New ClassStaff
Stf.Delete_Member(tbMemID.Text)
ElseIf cmbType.Text = "Student" Then
Dim Stu As New ClassStudent
Stu.Delete_Member(tbMemID.Text)
End If
End Sub
#Region "Exit"
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me.Close()
End Sub
#End Region
End Class