protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { if (Session["KoleksiyonerEmail"] != null) { string kEmail = Session["KoleksiyonerEmail"].ToString(); SqlCommand cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", bag.baglan()); SqlDataReader drSession = cmdSession.ExecuteReader(); DatalistProfilBilgi.DataSource = drSession; DatalistProfilBilgi.DataBind(); SqlCommand cmdForum = new SqlCommand("Select * from ForumKonu ", bag.baglan()); DropdownForumKonu.DataSource = cmdForum.ExecuteReader();; DropdownForumKonu.DataTextField = "ForumKonuBaslik"; DropdownForumKonu.DataValueField = "ForumKonuID"; DropdownForumKonu.DataBind(); SqlCommand cmdForum1 = new SqlCommand("Select * from ForumKonu where KategoriAdi='" + DropdownForumKonu.SelectedItem.Text + "' ", bag.baglan()); SqlDataReader drForum = cmdForum1.ExecuteReader(); DataListForumKonuGetir.DataSource = drForum; DataListForumKonuGetir.DataBind(); } else { Response.Redirect("KullaniciGiris.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { SQLBaglanti bag = new SQLBaglanti(); if (!Page.IsPostBack) { if (Session["KoleksiyonerEmail"] != null) { //kategori çek SqlCommand cmd = new SqlCommand("Select * from Kategori", bag.baglan()); SqlDataReader dr = cmd.ExecuteReader(); DropDownListKategori.DataTextField = "KategoriAdi"; DropDownListKategori.DataValueField = "KategoriID"; DropDownListKategori.DataSource = dr; DropDownListKategori.DataBind(); string kEmail = Session["KoleksiyonerEmail"].ToString(); SqlCommand cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", bag.baglan()); SqlDataReader drSession = cmdSession.ExecuteReader(); DatalistProfilBilgi.DataSource = drSession; DatalistProfilBilgi.DataBind(); } else { Response.Redirect("KullaniciGiris.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { UrunID = Request.QueryString["UrunID"]; SqlCommand cmuGetir = new SqlCommand("Select * from Urun where UrunID='" + UrunID + "'", baglan.baglan()); SqlDataReader druGetir = cmuGetir.ExecuteReader(); Datalist1.DataSource = druGetir; Datalist1.DataBind(); if (Session["KoleksiyonerEmail"] != null) { string kEmail = Session["KoleksiyonerEmail"].ToString(); SqlCommand cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", baglan.baglan()); SqlDataReader drSession = cmdSession.ExecuteReader(); DatalistProfilBilgi.DataSource = drSession; DatalistProfilBilgi.DataBind(); Panel1.Visible = false; //SqlCommand cmYorumGetir = new SqlCommand("Select * from ForumKonuYorum where ForumKonuID=" + ForumKonuID + "", baglan.baglan()); //SqlDataReader drYorumGetir = cmYorumGetir.ExecuteReader(); //DatalistMesajGetir.DataSource = drYorumGetir; //DatalistMesajGetir.DataBind(); } else { Panel2.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { ForumKonuID = Request.QueryString["ForumKonuID"]; islem = Request.QueryString["islem"]; if (islem == "sil") { SqlCommand cmuSil = new SqlCommand("Delete from ForumKonu where ForumKonuID='" + ForumKonuID + "'", baglan.baglan()); cmuSil.ExecuteNonQuery(); } if (Session["KoleksiyonerEmail"] != null) { string kEmail = Session["KoleksiyonerEmail"].ToString(); SqlCommand cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", baglan.baglan()); SqlDataReader drSession = cmdSession.ExecuteReader(); DatalistProfilBilgi.DataSource = drSession; DatalistProfilBilgi.DataBind(); SqlCommand cmForumKonuGetir = new SqlCommand("Select * from ForumKonu", baglan.baglan()); SqlDataReader drForumKonuGetir = cmForumKonuGetir.ExecuteReader(); DataListKonuGetir.DataSource = drForumKonuGetir; DataListKonuGetir.DataBind(); } else { Response.Redirect("KullaniciGiris.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { if (Session["KoleksiyonerEmail"] != null) { string kEmail = Session["KoleksiyonerEmail"].ToString(); SqlCommand cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", bag.baglan()); SqlDataReader drSession = cmdSession.ExecuteReader(); DatalistProfilBilgi.DataSource = drSession; DatalistProfilBilgi.DataBind(); SqlCommand cmdKoleksiyoner = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", bag.baglan()); cmdKoleksiyoner.ExecuteNonQuery(); SqlDataReader drKoleksiyoner = cmdKoleksiyoner.ExecuteReader(); DataTable dtKGuncelle = new DataTable("tablo"); dtKGuncelle.Load(drKoleksiyoner); DataRow row = dtKGuncelle.Rows[0]; txtAd.Text = row["KoleksiyonerAdi"].ToString(); txtEmail.Text = row["KoleksiyonerEmail"].ToString(); txtSifre.Text = row["KoleksiyonerSifre"].ToString(); txtTel.Text = row["KoleksiyonerTelefon"].ToString(); txtAdres.Text = row["KoleksiyonerAdres"].ToString(); } else { Response.Redirect("KullaniciGiris.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["KoleksiyonerEmail"] != null) { string kEmail = Session["KoleksiyonerEmail"].ToString(); SqlCommand cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", baglan.baglan()); SqlDataReader drSession = cmdSession.ExecuteReader(); DatalistProfilBilgi.DataSource = drSession; DatalistProfilBilgi.DataBind(); Panel1.Visible = false; } else { DatalistProfilBilgi.Visible = false; Panel2.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { ForumKonuID = Request.QueryString["ForumKonuID"]; if (Page.IsPostBack == false) { if (Session["KoleksiyonerEmail"] != null) { //kategori çek SqlCommand cmd = new SqlCommand("Select * from Kategori ", baglan.baglan()); SqlDataReader dr = cmd.ExecuteReader(); DropDownListKonu.DataTextField = "KategoriAdi"; DropDownListKonu.DataValueField = "KategoriID"; DropDownListKonu.DataSource = dr; DropDownListKonu.DataBind(); SqlCommand cmdKonuGetir = new SqlCommand("Select * from ForumKonu where ForumKonuID='" + ForumKonuID + "'", baglan.baglan()); SqlDataReader drKonuGuncelle = cmdKonuGetir.ExecuteReader(); DataTable dtKonuGuncelle = new DataTable("tablo"); dtKonuGuncelle.Load(drKonuGuncelle); DataRow row = dtKonuGuncelle.Rows[0]; txtKonuAdi.Text = row["ForumKonuBaslik"].ToString(); txtIcerik.Text = row["ForumKonuIcerik"].ToString(); SqlCommand cmd2 = new SqlCommand("Select * from Kategori where KategoriAdi='" + row["KategoriAdi"].ToString() + "'", baglan.baglan()); SqlDataReader dr2 = cmd2.ExecuteReader(); DataTable dt2 = new DataTable("tablo"); dt2.Load(dr2); DataRow row2 = dt2.Rows[0]; DropDownListKonu.SelectedIndex = (Convert.ToInt32(row2["KategoriID"]) - 1); string kEmail = Session["KoleksiyonerEmail"].ToString(); SqlCommand cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", baglan.baglan()); SqlDataReader drSession = cmdSession.ExecuteReader(); DatalistProfilBilgi.DataSource = drSession; DatalistProfilBilgi.DataBind(); } else { Response.Redirect("KullaniciGiris.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { UrunID = Request.QueryString["UrunID"]; if (Page.IsPostBack == false) { if (Session["KoleksiyonerEmail"] != null) { //kategori çek SqlCommand cmd = new SqlCommand("Select * from Kategori ", baglan.baglan()); SqlDataReader dr = cmd.ExecuteReader(); DropDownListKategori.DataTextField = "KategoriAdi"; DropDownListKategori.DataValueField = "KategoriID"; DropDownListKategori.DataSource = dr; DropDownListKategori.DataBind(); SqlCommand cmdUrunGetir = new SqlCommand("Select * from Urun where UrunID='" + UrunID + "'", baglan.baglan()); SqlDataReader druGuncelle = cmdUrunGetir.ExecuteReader(); DataTable dtuGuncelle = new DataTable("tablo"); dtuGuncelle.Load(druGuncelle); DataRow row = dtuGuncelle.Rows[0]; txtUrunAdi.Text = row["UrunAdi"].ToString(); txtFiyat.Text = row["UrunFiyat"].ToString(); txtAciklama.Text = row["Aciklama"].ToString(); txtIlanSuresi.Text = row["IhaleSuresi"].ToString(); DropDownListKategori.SelectedItem.Text = row["KategoriAdi"].ToString(); string kEmail = Session["KoleksiyonerEmail"].ToString(); SqlCommand cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", baglan.baglan()); SqlDataReader drSession = cmdSession.ExecuteReader(); DatalistProfilBilgi.DataSource = drSession; DatalistProfilBilgi.DataBind(); } else { Response.Redirect("KullaniciGiris.aspx"); } } }