-
Notifications
You must be signed in to change notification settings - Fork 0
/
Giris.aspx.cs
49 lines (38 loc) · 1.24 KB
/
Giris.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
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;
public partial class Giris : System.Web.UI.Page
{
sqlsinif bgl = new sqlsinif();
public static int ID;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand komut = new SqlCommand("select * from tbl_yonetici where YoneticiAdı='"+TxtAd.Text+"'and YoneticiSifre='"+TxtSifre.Text+"'", bgl.baglanti());
SqlDataReader oku = komut.ExecuteReader();
if (oku.Read())
{
ID= Convert.ToInt32(oku["Yoneticiid"].ToString());
Response.Redirect("Admin.aspx");
}
else
{
Response.Write("<script>alert('HATALI KULLANICI ADI VEYA ŞİFRE')</script>");
}
TxtAd.Text = string.Empty;
TxtSifre.Text = string.Empty;
bgl.baglanti().Close();
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("Anasayfa.aspx");
TxtAd.Text = string.Empty;
TxtSifre.Text = string.Empty;
}
}