Your IP : 216.73.216.57
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Admin_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["UserID"] != null)
{
HaberDetayCagir(Convert.ToInt32(Request.QueryString["urunid"]));
using (OleDbConnection vt=new baglanti().baglan())
{
vt.Open();
OleDbCommand cmd=new OleDbCommand("UPDATE mesajlar SET durum=false WHERE id="+Request.QueryString["urunid"],vt);
cmd.ExecuteNonQuery();
vt.Close();
}
}
else
{
Response.Redirect("Login.aspx");
}
}
private void HaberDetayCagir(int id)
{
using (OleDbConnection vt = new baglanti().baglan())
{
vt.Open();
OleDbCommand cmd = new OleDbCommand("SELECT * FROM mesajlar WHERE id=" + id, vt);
OleDbDataReader dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
if (dt.Rows.Count > 0)
{
ltrTarih.Text = dt.Rows[0]["tarih"].ToString();
ltrAdSoyad.Text = dt.Rows[0]["Adsoyad"].ToString();
ltrMailAdresi.Text = dt.Rows[0]["mail"].ToString();
txticerik.Text = dt.Rows[0]["mesaj"].ToString();
txticerik.Enabled = false;
}
vt.Close();
}
using (OleDbConnection vt=new baglanti().baglan())
{
vt.Open();
OleDbCommand cmd=new OleDbCommand("UPDATE mesajlar SET durum=false WHERE id="+id,vt);
cmd.ExecuteNonQuery();
vt.Close();
}
}
}