-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGiriş.cs
148 lines (120 loc) · 4.45 KB
/
Giriş.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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.OleDb;
using System.Net.Mail;
namespace OkulOtomasyonSitemi
{
public partial class Giriş : Form
{
public static string userName; // Kullanıcının adini tutmak icin
public static string flagMail; // Kullanıcının mailini tutmak için
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.Oledb.12.0;Data Source = C:\\Users\\yakup\\OneDrive\\Masaüstü\\OgrenciOtomation1.accdb");
public Giriş()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if( textBox1.Text == "" || textBox2.Text == "" )
{
MessageBox.Show("Giriş Yapmak İçin Tüm Alanları Doldurun.", "Başarısız.");
}
else
{
conn.Open();
OleDbCommand cmd = new OleDbCommand("Select * from kullanici_girisi where emailadres_kullaniciadi='" + textBox1.Text+"'" , conn);
OleDbDataReader read = cmd.ExecuteReader();
if( read.Read() == true )
{
if(textBox1.Text == read["emailadres_kullaniciadi"].ToString() && textBox2.Text == read["sifre"].ToString())
{
MessageBox.Show("Hoş Geldiniz! " + read["ad"].ToString());
userName = read["ad"].ToString();
flagMail = read["emailadres_kullaniciadi"].ToString();
// Form1 newForm = new Form1();
// newForm.Show();
MainPage mp = new MainPage();
mp.Show();
// Anasayfa Anasayfa = new Anasayfa();
// Anasayfa.Show();
this.Hide();
}
else
{
MessageBox.Show("HATA! Giriş Bilgilerinizi Kontrol Edin." , "Başarısız");
textBox1.Text = "";
textBox2.Text = "";
}
}
else
{
MessageBox.Show("HATA! Giriş Bilgilerinizi Kontrol Edin.", "Başarısız");
textBox1.Text = "";
textBox2.Text = "";
}
conn.Close();
}
}
private void pictureBoxEye_Click(object sender, EventArgs e)
{
textBox2.PasswordChar = '*';
pictureBoxEye.Hide();
pictureBoxHidden.Show();
}
private void pictureBoxHidden_Click(object sender, EventArgs e)
{
textBox2.PasswordChar = '\0';
pictureBoxHidden.Hide();
pictureBoxEye.Show();
}
private void label3_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
IdariKayit idariekle = new IdariKayit();
idariekle.Show();
}
private void Giriş_Load(object sender, EventArgs e)
{
}
public string GetUserName()
{
return userName;
}
public string GetFlagMail()
{
if (flagMail == null)
{
flagMail = "";
}
return flagMail;
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void label4_Click(object sender, EventArgs e)
{
SifremiUnuttum sifre = new SifremiUnuttum();
sifre.Show();
}
private void pictureBox3_Click(object sender, EventArgs e)
{
DialogResult = MessageBox.Show("Programdan Çıkmak İstediğinize Emin Misiniz?", "Emin Misin?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (DialogResult == DialogResult.OK)
{
Environment.Exit(0);
}
}
}
}