Your IP : 216.73.216.57
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Admin_ebulten : System.Web.UI.Page
{
public static int altkatid, katid;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.Cookies["UserID"] != null)
{
KurumsalListe();
}
else
{
Response.Redirect("Login.aspx");
}
}
}
[WebMethod]
public static bool Sil(int id)
{
using (OleDbConnection vt = new baglanti().baglan())
{
vt.Open();
OleDbCommand cmd = new OleDbCommand("DELETE FROM Ebulten WHERE id=" + id, vt);
cmd.ExecuteNonQuery();
vt.Close();
}
return true;
}
private void KurumsalListe()
{
using (OleDbConnection vt = new baglanti().baglan())
{
vt.Open();
OleDbCommand cmd = new OleDbCommand("SELECT * FROM Ebulten ORDER BY id DESC", vt);
OleDbDataReader dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
if (dt.Rows.Count > 0)
{
pagerReferans.DataSource = dt.DefaultView;
pagerReferans.BindToControl = rptKurumsalListe;
rptKurumsalListe.DataSource = pagerReferans.DataSourcePaged;
rptKurumsalListe.DataBind();
}
vt.Close();
}
}
protected void btnKurumsalListe_OnServerClick(object sender, EventArgs e)
{
Response.Redirect("ebulten.aspx?altkatid=" + altkatid + "&katid=" + katid + "&komut=new");
}
}