-
Notifications
You must be signed in to change notification settings - Fork 1
/
Form5.cs
212 lines (173 loc) · 6.38 KB
/
Form5.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace KoforiduaPolyBiometric_Attendance
{
public partial class Form5 : Form
{
GetInit cn = new GetInit();
//SqlConnection connection = new SqlConnection(@"Data Source=(local);Initial Catalog=Login;Integrated Security=True");
MySqlConnection connection;
MySqlCommand mcd;
MySqlDataReader mdr;
String s;
public Form5()
{
connection = cn.Initialize();
InitializeComponent();
}
private void textBox6_TextChanged(object sender, EventArgs e)
{
////////////////
//// connection.Open();
///// mcd = new SqlCommand("SELECT index_number as [INDEX NUMBER], LSAT_NAME AS [LAST NAME], FIRST_NAME AS [FIRST NAME], OTHER_NAME AS [OTHER NAME], DATE_OF_BIRTH AS [DATE OF BIRTH], AGE AS [AGE], GENDER AS [GENDER], PROGAMME_OFFERED AS [PROGRAMME OFFERING], COURSE_OFFERED AS [COURSE OFFERING], LEVEL AS [LEVEL], IMAGE AS [PICTURE] FROM enrollment_tablee ORDER BY FIRST_NAME WHERE like '" & textBox6.Text & "%' ");
//// mdr = New SqlDataAdapter(mcd);
/// myDataSet = New DataSet();
/// mdr.Fill(myDataSet, "enrollment_tablee");
//// DataGridView1.DataSource = myDataSet.Tables("enrollment_tablee").DefaultView;
//// connection.Close();
////////////////////////////
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
Form frm = new Form5();
frm.Show();
this.Visible = true;
this.Hide();
}
private void button1_Click(object sender, EventArgs e)
{
Form frm = new Form3();
frm.Show();
this.Visible = true;
this.Hide();
}
private void button2_Click(object sender, EventArgs e)
{
Form frm = new Form4();
frm.Show();
this.Visible = true;
this.Hide();
}
private void button3_Click(object sender, EventArgs e)
{
//f1
}
private void ProInfo_Click(object sender, EventArgs e)
{
//f2
}
private void button7_Click(object sender, EventArgs e)
{
Form frm = new Main_Form();
frm.Show();
this.Visible = true;
this.Hide();
}
private void button4_Click(object sender, EventArgs e)
{
////Search
try
{
connection.Open();
s = "select * from Enrollment_Table where Index_Number=" + int.Parse(txtUpdateIndexNumber.Text);
mcd = new MySqlCommand(s, connection);
mdr = mcd.ExecuteReader();
if (mdr.Read())
{
txtUpdateLastName.Text = mdr.GetString(1);
txtUpdateFirstName.Text = mdr.GetString(2);
txtUpdateOtherName.Text = mdr.GetString(3);
UpdateDOB.Text = mdr.GetString(4);
txtUpdeateAge.Text = mdr.GetString(5);
cmbUpdateGender.Text = mdr.GetString(6);
cmbUpdateProgramme.Text = mdr.GetString(7);
cmbUpdateCourse.Text = mdr.GetString(8);
cmbUpdateLevel.Text = mdr.GetString(9);
}
else
{
MessageBox.Show("No DATA");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
connection.Close();
}
}
private void btnUpdate_Click(object sender, EventArgs e)
{
}
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
}
private void button3_Click_1(object sender, EventArgs e)
{
// Uploading a picture from a file
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Image Files (*.jpg; *.jpeg; *.gif; *.bmp) | *.jpg; *.jpeg; *.gif; *.bmp";
if
(open.ShowDialog() == DialogResult.OK)
{
pictureBox2.Image = new Bitmap(open.FileName);
///// end
}
}
private void cmbUpdateGender_SelectedIndexChanged(object sender, EventArgs e)
{
////Disable combobox
cmbUpdateGender.DropDownStyle = ComboBoxStyle.DropDownList;
/////
}
private void cmbUpdateProgramme_SelectedIndexChanged(object sender, EventArgs e)
{
////Disable combobox
cmbUpdateProgramme.DropDownStyle = ComboBoxStyle.DropDownList;
////
}
private void cmbUpdateCourse_SelectedIndexChanged(object sender, EventArgs e)
{
////Disable combobox
cmbUpdateCourse.DropDownStyle = ComboBoxStyle.DropDownList;
///////
}
private void cmbUpdateLevel_SelectedIndexChanged(object sender, EventArgs e)
{
////Disable combobox
cmbUpdateLevel.DropDownStyle = ComboBoxStyle.DropDownList;
////
}
private void Form5_Load(object sender, EventArgs e)
{
}
private void pictureBox4_Click(object sender, EventArgs e)
{
}
private void button6_Click(object sender, EventArgs e)
{
txtUpdateLastName.Text = "";
txtUpdateFirstName.Text = "";
txtUpdateOtherName.Text = "";
dateTimePicker1.Text = "";
txtUpdeateAge.Text = "";
cmbUpdateGender.Text = "";
txtUpdateIndexNumber.Text = "";
cmbUpdateProgramme.Text = "";
cmbUpdateCourse.Text = "";
cmbUpdateLevel.Text = "";
pictureBox2.ResetText();
}
}
}