-
Notifications
You must be signed in to change notification settings - Fork 0
/
Signin.cs
94 lines (69 loc) · 1.98 KB
/
Signin.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VBB
{
public partial class Signin : Form
{
VBBDBDataContext v;
public Signin()
{
InitializeComponent();
textBox2.PasswordChar = '*';
}
private void label1_Click(object sender, EventArgs e)
{
}
private void Home_Load(object sender, EventArgs e)
{
}
private void btnsignup_Click(object sender, EventArgs e)
{
this.Hide();
signup su = new signup();
su.Show();
}
private void btnsignin_Click(object sender, EventArgs e)
{
v = new VBBDBDataContext();
string username = textBox1.Text;
string password = textBox2.Text;
if(username=="")
{
MessageBox.Show("Username must be filled!");
}
else if(password=="")
{
MessageBox.Show("Password must be filled!");
}
else
{
var getAccount = (
from x in v.Users
where x.Name==username && x.Password==password
select x
);
if (getAccount.Count() != 1)
{
MessageBox.Show("Invalid username & password!");
}
else if (getAccount.Count() == 1)
{
// public int i = x;
this.Hide();
Home h = new Home();
h.Show();
}
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}