-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
109 lines (85 loc) · 2.63 KB
/
Form1.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
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 Library_Management_System
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
private void txtUsername(object sender, EventArgs e)
{
}
private void txtPassword(object sender, EventArgs e)
{
txtPass.PasswordChar = '*';
}
private void txtLoginID_MouseClick(object sender, MouseEventArgs e)
{
if (txtLoginID.Text == "Login ID")
{
txtLoginID.Clear();
}
}
private void txtPass_MouseClick(object sender, MouseEventArgs e)
{
if (txtPass.Text == "Password")
{
txtPass.Clear();
}
}
private void label4_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void pictureBox1_kiitlogo_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://kiit.ac.in/");
}
private void btnLogin_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=BT-2105617\\SQLEXPRESS;Initial Catalog=library;Integrated Security=True;";
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select * from logintable where username = '"+txtLoginID.Text+"' and pass = '"+txtPass.Text+"' ";
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
this.Hide();
Dashboard dsa = new Dashboard();
dsa.Show();
}
else
{
MessageBox.Show("Wrong Username or Password","Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void label1_Click_1(object sender, EventArgs e)
{
}
}
}