-
Notifications
You must be signed in to change notification settings - Fork 0
/
giris.cs
93 lines (85 loc) · 2.84 KB
/
giris.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
using System;
using System.Data.OleDb;
using System.Windows.Forms;
namespace e_envanter
{
public partial class giris : Form
{
public OleDbConnection cnn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e-envanter.mdb");
public giris()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
saatlbl.Text = DateTime.Now.ToString();
saat.Interval = 1000;
saat.Enabled = true;
this.AcceptButton = girisBtn;
sifreG.PasswordChar = '*';
}
private void girisBtn_Click(object sender, EventArgs e)
{
cnn.Open();
bool giris=false;
OleDbCommand cmd = new OleDbCommand("SELECT * FROM calisanTablo", cnn);
OleDbDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
if (yoneticiCheck.Checked == true)
{
if (reader["kullaniciAd"].ToString() == kullanici_AdG.Text && reader["sifre"].ToString() == sifreG.Text && reader["yetki"].ToString() == "Yönetici")
{
yoneticiSayfası ys = new yoneticiSayfası();
this.Hide();
ys.Show();
giris = true;
break;
}
}
else if (calisanCheck.Checked == true)
{
if (reader["kullaniciAd"].ToString() == kullanici_AdG.Text && reader["sifre"].ToString() == sifreG.Text && reader["yetki"].ToString() == "Çalışan")
{
calisanSayfasi cs = new calisanSayfasi();
this.Hide();
cs.Show();
giris = true;
break;
}
}
else
{
giris = false;
break;
}
}
if (!giris)
{
MessageBox.Show("Hatalı Giriş.");
}
cnn.Close();
}
private void çıkışToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void saat_Tick(object sender, EventArgs e)
{
saatlbl.Text = DateTime.Now.ToString();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (gösterChckb.Checked)
{
//karakteri göster.
sifreG.PasswordChar = '\0';
}
//değilse karakterlerin yerine * koy.
else
{
sifreG.PasswordChar = '*';
}
}
}
}