Esempio n. 1
0
        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)
 {
     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");
         }
     }
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //kategori çek
            SqlCommand    cmd = new SqlCommand("Select * from Kategori", baglan.baglan());
            SqlDataReader dr  = cmd.ExecuteReader();

            DropDownList1.DataTextField  = "KategoriAdi";
            DropDownList1.DataValueField = "KategoriID";
            DropDownList1.DataSource     = dr;
            DropDownList1.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlCommand    cmdSlider = new SqlCommand("Select Top 5 * from Urun where Yayin=" + 1 + " order by UrunID desc", bag.baglan());
            SqlDataReader drSlider  = cmdSlider.ExecuteReader();

            dlSlider.DataSource = drSlider;
            dlSlider.DataBind();

            SqlCommand    cmUrun = new SqlCommand("Select * from Kategori", bag.baglan());
            SqlDataReader drUrun = cmUrun.ExecuteReader();

            DatalistKategori.DataSource = drUrun;
            DatalistKategori.DataBind();
        }
Esempio n. 5
0
        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");
                }
            }
        }
Esempio n. 6
0
        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");
                }
            }
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AdminAdi"] != null)
            {
                //kategori çek
                SqlCommand    cmd = new SqlCommand("Select * from Kategori", baglan.baglan());
                SqlDataReader dr  = cmd.ExecuteReader();
                DropDownList1.DataTextField  = "KategoriAdi";
                DropDownList1.DataValueField = "KategoriID";
                DropDownList1.DataSource     = dr;
                DropDownList1.DataBind();

                //string AdminAdi = Session["AdminAdi"].ToString();
                //SqlCommand cmdSession = new SqlCommand("Select * from Admin where AdminAdi='" + AdminAdi + "'", baglan.baglan());
                //SqlDataReader drSession = cmdSession.ExecuteReader();
                //datalist.DataSource = drSession;
                //dtlist.DataBind();
            }
            else
            {
                Response.Redirect("AdminGiris.aspx");
            }
        }
Esempio n. 8
0
        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;
            }
        }
Esempio n. 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ForumKonuID = Request.QueryString["ForumKonuID"];
     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    cmuGetir = new SqlCommand("Select * from ForumKonu where ForumKonuID=" + ForumKonuID + "", baglan.baglan());
         SqlDataReader druGetir = cmuGetir.ExecuteReader();
         DataListForumKonuGetir.DataSource = druGetir;
         DataListForumKonuGetir.DataBind();
         SqlCommand    cmYorumGetir = new SqlCommand("Select * from ForumKonuYorum where ForumKonuID=" + ForumKonuID + "", baglan.baglan());
         SqlDataReader drYorumGetir = cmYorumGetir.ExecuteReader();
         DatalistMesajGetir.DataSource = drYorumGetir;
         DatalistMesajGetir.DataBind();
     }
     else
     {
         Response.Redirect("KullaniciGiris.aspx");
     }
 }
Esempio n. 10
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (FileUploadResim1.HasFile && FileUploadResim2.HasFile)
            {
                //SqlCommand cmUrun = new SqlCommand("Select * from Urun WHERE UrunAdi LIKE '%'"+ txtUrunAdi.Text+ "' %' AND UrunAdi LIKE '%'" + txtFiyat.Text + "' %'AND UrunAdi LIKE '%'" + txtAciklama.Text + "' %'AND UrunAdi LIKE '%'" + txtIlanSuresi.Text + "' %'AND UrunAdi LIKE '%'" + DropDownListKategori.SelectedItem.Text + "' %'", baglan.baglan());
                //SqlDataReader drUrun = cmUrun.ExecuteReader();


                //if ((drUrun.Read() ) )
                //{
                //if (!(txtUrunAdi.Text == "" || txtFiyat.Text == "" || txtAciklama.Text == "" || txtIlanSuresi.Text == "" || DropDownListKategori.SelectedItem.Text == "para"))
                //{
                string     pathName1 = "Images/" + Path.GetFileName(FileUploadResim1.PostedFile.FileName);
                string     pathName2 = "Images/" + Path.GetFileName(FileUploadResim2.PostedFile.FileName);
                SqlCommand komut     = new SqlCommand("insert into Urun(UrunAdi,UrunFiyat,Aciklama,EklenmeTarihi,IhaleSuresi,KategoriAdi,ResimLogo,Resim1,Yayin,Ekleyen)values('" + txtUrunAdi.Text + "','" + txtFiyat.Text + "','" + txtAciklama.Text + "','" + DateTime.Now.ToString("MM.dd.yyyy") + "','" + txtIlanSuresi.Text + "','" + DropDownListKategori.SelectedItem + "','" + pathName1 + "','" + pathName2 + "'," + 0 + "," + 0 + ")", baglan.baglan());
                komut.ExecuteNonQuery();
                FileUploadResim1.SaveAs(Server.MapPath("Images/" + FileUploadResim1.FileName));
                FileUploadResim2.SaveAs(Server.MapPath("Images/" + FileUploadResim2.FileName));

                //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertmessage", "alert('Lütfen herşeyi doldurun')", true);
                //}

                //}
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertmessage", "alert('Resimler Boş geçilemez')", true);
            }
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (FileUploadResim.HasFile)
     {
         string     pathName = "Images/" + Path.GetFileName(FileUploadResim.PostedFile.FileName);
         SqlCommand cmd      = new SqlCommand("insert into Koleksiyoner(KoleksiyonerAdi,KoleksiyonerSifre,KoleksiyonerResimYolu,KoleksiyonerAdres,KoleksiyonerEmail,KoleksiyonerTelefon) values ('" + txtAd.Text + "','" + txtSifre.Text + "','" + pathName + "','" + txtAdres.Text + "','" + txtEmail.Text + "','" + txtTel.Text + "')", baglan.baglan());
         cmd.ExecuteNonQuery();
         FileUploadResim.SaveAs(Server.MapPath("Images/" + FileUploadResim.FileName));
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertmessage", "alert('resim boş olamaz')", true);
     }
 }
 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)
        {
            UrunID = Request.QueryString["UrunID"];
            islem  = Request.QueryString["islem"];

            if (islem == "sil")
            {
                SqlCommand cmuSil = new SqlCommand("Delete from Urun where UrunID='" + UrunID + "'", 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    cmuGetir = new SqlCommand("Select * from Urun where Ekleyen=" + 0 + "", baglan.baglan());
                SqlDataReader druGetir = cmuGetir.ExecuteReader();

                DataListKategoriGetir.DataSource = druGetir;
                DataListKategoriGetir.DataBind();
                SqlCommand    cmuGetir1 = new SqlCommand("Select * from Urun where Ekleyen=" + 1 + "", baglan.baglan());
                SqlDataReader druGetir1 = cmuGetir1.ExecuteReader();

                DataList1.DataSource = druGetir1;
                DataList1.DataBind();
            }
            else
            {
                Response.Redirect("KullaniciGiris.aspx");
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            SqlCommand    komut = new SqlCommand("Select * from Admin where AdminAdi='" + TextBox1.Text + "' and AdminSifre='" + TextBox2.Text + "' ", baglan.baglan());
            SqlDataReader dr    = komut.ExecuteReader();

            if (dr.Read())
            {
                Session.Add("AdminAdi", TextBox1.Text);
                Response.Redirect("AdminUrunEkle.aspx");
            }
            else
            {
                Label1.Text = "Kullanıcı Adı veya Şifre Hatalı";
            }
        }
        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");
                }
            }
        }