/
sifremiUnuttum.aspx.cs
54 lines (52 loc) · 1.87 KB
/
sifremiUnuttum.aspx.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Net.Mail;
namespace urun_kayit
{
public partial class sifremiUnuttum : System.Web.UI.Page
{
string sorgu, kullaniciMail, kullaniciNumara;
protected void btnSifreYenile_Click1(object sender, EventArgs e)
{
kullaniciMail = txtSifremiUnuttumMail.Text;
kullaniciNumara = txtSifremiUnuttumTelNo.Text;
if (kullaniciMail != "" && kullaniciNumara != "")
{
SqlConnection baglanti = new SqlConnection("Server=.;Database=urunKayitListeleme;Integrated Security = True");
sorgu = "Select * from tblMusteri where musteriUser=@user AND musteriNo=@numara";
SqlCommand komut = new SqlCommand(sorgu, baglanti);
komut.Parameters.AddWithValue("@numara", kullaniciNumara);
komut.Parameters.AddWithValue("@user", kullaniciMail);
baglanti.Open();
SqlDataReader oku = komut.ExecuteReader();
try
{
if (oku.Read())
{
Session["numara"] = kullaniciNumara;
Session.Add("kullanici", kullaniciMail);
Response.Redirect("SifreYenile.aspx");
}
else
{
lblinfo.Text = "Giriş Başarısız !!!";
}
baglanti.Close();
}
catch (Exception)
{
lblinfo.Text = "Giriş Başarısız !!!";
}
}
else
{
lblinfo.Text = "Girdiler Boş Geçilemez !";
}
}
}
}