Skip to content

Commit 6be5b48

Browse files
committed
comments
1 parent 0f9abfc commit 6be5b48

File tree

9 files changed

+3
-1
lines changed

9 files changed

+3
-1
lines changed

.vs/C-Sharf Classes/v15/.suo

2.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

C-Sharf Classes/View/frmInputs.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ void clearInputs()
3232

3333
private void btnSave_Click(object sender, EventArgs e)
3434
{
35+
// validation
3536
TextBox[] txt = { txtUsername, txtPassword, txtCPassword };
3637
ComboBox[] cmb = { cmbSex };
3738
if (!validate.txtRequired(txt) || !validate.cmbRequired(cmb))
3839
return;
3940

41+
// database
4042
if(db.exist("select username from users where username='" + txtUsername.Text + "'"))
4143
{
4244
MessageBox.Show("Username Already Exist");
@@ -49,7 +51,6 @@ private void btnSave_Click(object sender, EventArgs e)
4951
//3 lines save
5052
string[] value = { txtUsername.Text, validate.encodePassword(txtPassword.Text), cmbSex.Text };
5153
string[] column = { "username", "password", "sex" };
52-
5354
db.save("users", column, value);
5455

5556
//or you can use // 1 line
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

C-Sharf Classes/frmLogin.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ private void btnLogin_Click(object sender, EventArgs e)
3131
if (reader.Read())
3232
{
3333

34+
//add your id to a global variable userId
3435
variables.userId = Int32.Parse(reader["userid"].ToString());
3536

3637
frmMain frmain = new frmMain();
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)