-
Notifications
You must be signed in to change notification settings - Fork 0
/
Login_Window.cs
102 lines (82 loc) · 2.6 KB
/
Login_Window.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
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;
using System.Data.SqlClient;
namespace csharpproject
{
public partial class Login_Window : Form
{
public String u_name,password;
public bool remember=true;
public Login_Window()
{
InitializeComponent();
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
}
private void loginbutton_Click(object sender, EventArgs e)
{
bool flag=false;
DataClasses1DataContext context = new DataClasses1DataContext();
foreach(ADMIN a in context.ADMINs)
{
if (a.Admin_Name == usernamebox.Text && a.Admin_Password == passwordbox.Text)
{
flag = true;
this.Hide();
Admin_Panel ap = new Admin_Panel(usernamebox.Text, passwordbox.Text, remember);
ap.Show();
}
}
foreach (USER a in context.USERs)
{
if (a.User_Name == usernamebox.Text && a.User_Password == passwordbox.Text)
{
flag = true;
this.Hide();
User_Panel up = new User_Panel(usernamebox.Text, passwordbox.Text, remember);
up.Show();
}
}
if (flag == false)
{
MessageBox.Show("Incorrect Username/Pass.");
}
}
public void checkuser(String username, String password)
{
}
private void passwordbox_TextChanged(object sender, EventArgs e)
{
}
private void registerbutton_Click(object sender, EventArgs e)
{
this.Hide();
User_Reg u = new User_Reg();
u.Show();
}
private void label4_Click(object sender, EventArgs e)
{
}
private void label5_Click(object sender, EventArgs e)
{
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == false)
{
remember = false;
}
}
private void panel2_Paint(object sender, PaintEventArgs e)
{
}
}
}