-
Notifications
You must be signed in to change notification settings - Fork 0
/
PopulerKitaplar.aspx.cs
58 lines (50 loc) · 1.68 KB
/
PopulerKitaplar.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
55
56
57
58
using System;
using System.Data;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
Database db = new Database();
protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToBoolean(Session["kullaniciGirisi"]))
{
Session["adminGirisi"] = false;
}
else
Response.Redirect("Giris.aspx");
}
protected void gVKitaplar_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = gVKitaplar.SelectedRow;
Session["secilenKitapID"] = row.Cells[1].Text;
Session["secilenKitapAdi"] = row.Cells[2].Text;
Response.Redirect("KitapDetay.aspx");
}
protected void txtKitapAra_TextChanged(object sender, EventArgs e)
{
try
{
//Textbox içerisindeki veri veritabanında herhangi bir kitap adı
//içerisinde bulunursa o kitaplar listelenir.
string sart = string.Format("WHERE Adi LIKE '%{0}%';", txtKitapAra.Text);
DataTable table = PopulerKitaplarDb.PopulerKitaplariCek(sart);
VerileriCek(table);
GridViewRow row = gVKitaplar.SelectedRow;
Session["secilenKitapID"] = row.Cells[1].Text;
Session["secilenKitapAdi"] = row.Cells[2].Text;
}
catch
{
}
}
protected void gVKitaplar_Init(object sender, EventArgs e)
{
DataTable table = PopulerKitaplarDb.PopulerKitaplariCek("");
VerileriCek(table);
}
public void VerileriCek(DataTable table)
{
gVKitaplar.DataSource = table;
gVKitaplar.DataBind();
}
}