-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmadmingiriş.cs
85 lines (79 loc) · 2.51 KB
/
frmadmingiriş.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
using System;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
namespace Ogrenci_Yurt_Sistemi
{
public partial class frmadmingiriş : Form
{
public frmadmingiriş()
{
InitializeComponent();
}
SqlBaglantı bgl = new SqlBaglantı();
private void textBoxKullanıcıadı_MouseEnter(object sender, EventArgs e)
{
for (int i = 0; i <= 400; i++)
{
textBoxKullanıcıadı.BackColor = Color.Gainsboro;
}
}
private void textBoxKullanıcıadı_MouseLeave(object sender, EventArgs e)
{
for (int i = 0; i <= 400; i++)
{
textBoxKullanıcıadı.BackColor = Color.White;
}
}
private void textBoxparola_MouseEnter(object sender, EventArgs e)
{
for (int i = 0; i <= 400; i++)
{
textBoxparola.BackColor = Color.Gainsboro;
}
}
private void textBoxparola_MouseLeave(object sender, EventArgs e)
{
for (int i = 0; i <= 400; i++)
{
textBoxparola.BackColor = Color.White;
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
for (int i = 0; i <= 50; i++)
{
if (checkBox1.Checked == true)
{
textBoxparola.PasswordChar = '*';
}
else
{
textBoxparola.PasswordChar = '\0';
}
}
}
private void button1_Click(object sender, EventArgs e)
{
//veritabanlı admin girişi
SqlCommand komutg = new SqlCommand("select * from Admin1 where YöneticiAd=@p1 and YöneticiŞifre=@p2", bgl.baglantı());
komutg.Parameters.AddWithValue("@p1", textBoxKullanıcıadı.Text);
komutg.Parameters.AddWithValue("@p2", textBoxparola.Text);
SqlDataReader oku = komutg.ExecuteReader();
if (oku.Read())
{
Frmanaform fr = new Frmanaform();
fr.Show();
this.Hide();
}
else
{
MessageBox.Show("Hatalı ad veya şifre");
textBoxKullanıcıadı.Text = "";
textBoxparola.Text = "";
textBoxKullanıcıadı.Focus();
}
bgl.baglantı().Close();
}
}
}