protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["yonetici"] == null)
     {
         Response.Redirect("Anasayfa.aspx");
     }
     else
     {
         Response.Write("<font color=green><b>Onay Bekleyen Yorumların Listesi : </b></font> <br><hr color=#330000/> <br> <fieldset style='background-color:#DEDEDE;'><ul>");
         SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
         baglanti.Open();
         SqlCommand komut = new SqlCommand();
         komut.Connection  = baglanti;
         komut.CommandType = CommandType.Text;
         komut.CommandText = "select * from yorumlar where yorum_onay_durumu= 0 and istenmeyen= 0";
         DataTable      tablo = new DataTable();
         SqlDataAdapter adapt = new SqlDataAdapter(komut);
         adapt.Fill(tablo);
         foreach (DataRow bilgi in tablo.Rows)
         {
             if (!IsPostBack)
             {
                 Response.Write("<li>" + "<font  color=green class=baslik>Yorum Tarihi : </font>" + bilgi["yorum_tarihi"].ToString() + " &nbsp; " + "<font color=green class=baslik> Adı : </font>" + "   " + bilgi["yorumcu_adi"].ToString() + "<font color=green class=baslik> E-posta : </font>" + bilgi["yorumcu_eposta"].ToString() + "<p><font color=green class=baslik>Yorum : </font> " + bilgi["yorum_icerigi"].ToString() + "</p>" + "<br><a href=\"onayla.aspx?ID=" + bilgi["yorum_ID"].ToString() + "\">" + "  &nbsp;" + "<span class=onay>Onayla!</span></a>" + "<a href=\"yorumEtiket.aspx?ID=" + bilgi["yorum_ID"].ToString() + "\">" + "  &nbsp; - &nbsp; " + "<span class=onay>İstenmeyen Olarak Etiketle!</span></a>" + "<a href=\"yorumSil.aspx?ID=" + bilgi["yorum_ID"].ToString() + "\">" + "  &nbsp; - &nbsp; " + "<span class=onay>Sil!</span></a>" + "</li>");
             }
         }
         baglanti.Close();
         baglanti.Dispose();
         Response.Write("</fieldset></ul><br>");
     }
 }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["yonetici"] == null || Request.QueryString.Count <= 0)
     {
         Response.Redirect("Anasayfa.aspx");
     }
     else
     {
         SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
         baglanti.Open();
         SqlCommand komut = new SqlCommand();
         komut.Connection  = baglanti;
         komut.CommandType = CommandType.Text;
         komut.CommandText = "select * from makaleler where makale_ID=" + Request.QueryString["ID"].ToString();
         DataTable      tablo = new DataTable();
         SqlDataAdapter adapt = new SqlDataAdapter(komut);
         adapt.Fill(tablo);
         foreach (DataRow item in tablo.Rows)
         {
             if (!IsPostBack)
             {
                 txt_kat_baslik.Text    = item["makale_basligi"].ToString();
                 txt_mkl_icerigi.Value  = item["makale_icerigi"].ToString();
                 txt_makale_etiket.Text = item["makale_etiketleri"].ToString();
             }
         }
         baglanti.Close();
         baglanti.Dispose();
     }
 }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     {
         if (Request.Cookies["yonetici"] == null)
         {
             Response.Redirect("Anasayfa.aspx");
         }
         else
         {
             Response.Write("<font color=green><b>Aktif Yönetici Hesaplarının Listesi : </b></font> <br><hr color=#330000/> <br> <fieldset style='background-color:#DEDEDE;'><ul>");
             SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
             baglanti.Open();
             SqlCommand komut = new SqlCommand();
             komut.Connection  = baglanti;
             komut.CommandType = CommandType.Text;
             komut.CommandText = "select kullanici_adi,kullanici_ID from hesaplar";
             DataTable      tablo = new DataTable();
             SqlDataAdapter adapt = new SqlDataAdapter(komut);
             adapt.Fill(tablo);
             foreach (DataRow bilgi in tablo.Rows)
             {
                 if (!IsPostBack)
                 {
                     Response.Write("<li>" + "<font  color=green>Kullanıcı ID : </font>" + bilgi["kullanici_ID"].ToString() + " &nbsp; " + "<font color=green>Kullanıcı Adı : </font>" + "   " + bilgi["kullanici_adi"].ToString() + "<a href=\"yonetici_profil.aspx?ID=" + bilgi["kullanici_ID"].ToString() + "\">" + "  &nbsp;" + "Güncelle!</a>" + "</li>");
                 }
             }
             baglanti.Close();
             baglanti.Dispose();
             Response.Write("</fieldset></ul><br>");
             Response.Write("<font color=#330000><b>Not:</b></font> Düzenlemek için 'Güncelle' bağlantısını kullanabilirsiniz.");
         }
     }
 }
Пример #4
0
        //  Toplam Kategori Sayısı Metot
        public static string toplamKategori()
        {
            SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());

            try
            {
                baglanti.Open();
                SqlCommand komut = new SqlCommand();
                komut.Connection  = baglanti;
                komut.CommandType = CommandType.Text;
                komut.CommandText = "Select * from kategoriler";
                DataTable      tablo = new DataTable();
                SqlDataAdapter adapt = new SqlDataAdapter(komut);
                adapt.Fill(tablo);
                string toplam_kategori_Sayisi = tablo.Rows.Count.ToString();
                return(toplam_kategori_Sayisi);
            }

            catch (Exception ex)
            {
                return(ex.Message);
            }

            finally
            {
                if (baglanti.State == ConnectionState.Open)
                {
                    baglanti.Close();
                }
            }
        }
        protected void kategoriTurleri_SelectedIndexChanged1(object sender, EventArgs e)
        {
            SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());

            try
            {
                baglanti.Open();
                SqlCommand komut = new SqlCommand();
                komut.Connection  = baglanti;
                komut.CommandType = CommandType.Text;
                komut.CommandText = "select kategori_ID from kategoriler where kategori_adi=@kategori_adi";
                komut.Parameters.AddWithValue("kategori_adi", kategoriTurleri.SelectedValue);
                DataTable      tablo = new DataTable();
                SqlDataAdapter adapt = new SqlDataAdapter(komut);
                adapt.Fill(tablo);
                foreach (DataRow bilgi in tablo.Rows)
                {
                    deger = bilgi["kategori_ID"].ToString();
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            finally
            {
                baglanti.Close();
                baglanti.Dispose();
            }
        }
        protected void btn_guncele_panpa_Click(object sender, EventArgs e)
        {
            SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());

            try
            {
                baglanti.Open();
                SqlCommand komut = new SqlCommand();
                komut.Connection  = baglanti;
                komut.CommandType = CommandType.Text;
                komut.CommandText = "UPDATE kategoriler SET kategori_adi=@kategoriAdi WHERE kategori_adi =@kategori_orjinal";
                komut.Parameters.AddWithValue("@kategoriAdi", kategori_duzen.Text);
                komut.Parameters.AddWithValue("@kategori_orjinal", kategori_guncelle_listesi.SelectedValue);
                komut.ExecuteNonQuery();
            }

            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

            finally
            {
                if (baglanti.State == ConnectionState.Open)
                {
                    baglanti.Close();
                }
                Response.Redirect("kategori_ekle.aspx");
            }
        }
        protected void btn_kategori_sil_Click(object sender, EventArgs e)
        {
            SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());

            try
            {
                baglanti.Open();
                SqlCommand komut = new SqlCommand();
                komut.Connection  = baglanti;
                komut.CommandType = CommandType.Text;
                komut.CommandText = "DELETE FROM kategoriler WHERE kategori_adi=@kategori_soyadi";
                komut.Parameters.AddWithValue("@kategori_soyadi", kategori_list.SelectedValue);
                komut.ExecuteNonQuery();
            }

            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

            finally
            {
                if (baglanti.State == ConnectionState.Open)
                {
                    baglanti.Close();
                }
                Response.Redirect("kategori_ekle.aspx");
            }
        }
Пример #8
0
 protected void girisYap_Click(object sender, EventArgs e)
 {
     if (kullaniciAdi.Text != string.Empty && sifre.Value != string.Empty)
     {
         SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
         baglanti.Open();
         SqlCommand komut = new SqlCommand();
         komut.Connection  = baglanti;
         komut.CommandType = CommandType.Text;
         komut.CommandText = "Select * from hesaplar where kullanici_adi=@kullanici_adi and kullanici_sifre=@kullanici_sifre";
         komut.Parameters.AddWithValue("@kullanici_adi", kullaniciAdi.Text);
         komut.Parameters.AddWithValue("@kullanici_sifre", sifre.Value);
         DataTable      tablo = new DataTable();
         SqlDataAdapter adapt = new SqlDataAdapter(komut);
         adapt.Fill(tablo);
         if (tablo.Rows.Count >= 1)
         {
             Response.Cookies["yonetici"].Value = "girisyapti";
             Response.Cookies["yonetici"].Expires.AddDays(2);
             Response.Redirect("adminPanel.aspx");
         }
         else
         {
             hata.Text    = "Hata: Lütfen kullanıcı adı ve şifrenizi kontrol ediniz.";
             hata.Visible = true;
         }
         baglanti.Close();
         baglanti.Dispose();
     }
     else
     {
         hata.Text    = "Hata: Bu alanları boş geçemezsiniz.";
         hata.Visible = true;
     }
 }
Пример #9
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());

            try
            {
                baglanti.Open();
                SqlCommand komut = new SqlCommand();
                komut.Connection  = baglanti;
                komut.CommandType = CommandType.Text;
                komut.CommandText = "UPDATE iletisim SET iletisim_baslik=@iletisim_baslik,iletisim_icerik=@iletisim_icerik";
                komut.Parameters.AddWithValue("@iletisim_baslik", iletisim_baslik.Text);
                komut.Parameters.AddWithValue("@iletisim_icerik", iletisim_icerik.Value);
                komut.ExecuteNonQuery();
                lbl_iletisim_guncelle.Text    = "Bilgiler Kaydedildi!";
                lbl_iletisim_guncelle.Visible = true;
            }
            catch (Exception ex)
            {
                Response.Write("<font color=red>HATA:</font>" + ex.Message);
            }
            finally
            {
                baglanti.Close();
                baglanti.Dispose();
            }
        }
        protected void btn_makale_kydt_Click(object sender, EventArgs e)
        {
            if (txt_kat_baslik.Text != string.Empty && txt_mkl_icerigi.Value != string.Empty)
            {
                // Makale kaydı için veri tabanı kodlarının başlangıcı.
                string mkl_ozt = string.Empty;

                if (txt_mkl_icerigi.Value.Length > 500)
                {
                    mkl_ozt = txt_mkl_icerigi.Value.Substring(0, 497) + "...";
                }
                else
                {
                    mkl_ozt = txt_mkl_icerigi.Value;
                }
                SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
                try
                {
                    baglanti.Open();
                    SqlCommand komut = new SqlCommand();
                    komut.Connection  = baglanti;
                    komut.CommandType = CommandType.Text;
                    komut.CommandText = "INSERT INTO makaleler (makale_basligi,makale_tarihi,makale_icerigi,kategori_ID,makale_etiketleri,makale_ozet) VALUES (@makale_basligi,@makale_tarihi,@makale_icerigi,@kategori_ID,@makale_etiketleri,@makale_ozet)";
                    komut.Parameters.AddWithValue("@makale_basligi", txt_kat_baslik.Text);
                    komut.Parameters.AddWithValue("@makale_tarihi", DateTime.Now.ToString());
                    komut.Parameters.AddWithValue("@makale_icerigi", txt_mkl_icerigi.Value);
                    komut.Parameters.AddWithValue("@kategori_ID", deger);
                    komut.Parameters.AddWithValue("@makale_etiketleri", txt_makale_etiket.Text);
                    komut.Parameters.AddWithValue("@makale_ozet", mkl_ozt);
                    komut.ExecuteNonQuery();
                    txt_makale_etiket.Text = string.Empty;
                    Response.Write("<font color=green>Kayıt Başarılı!</font>");
                }

                catch (Exception ex)
                {
                    Response.Write("<font color=red>Hata : </font>" + ex.Message);
                }

                finally
                {
                    if (baglanti.State == ConnectionState.Open)
                    {
                        baglanti.Close();
                    }
                }

                // Makale kaydı sonu.
                txt_kat_baslik.Text   = "";
                txt_mkl_icerigi.Value = "";
            }
            else
            {
                Label5.Text    = "<font color=red>Hata : </font>Alanları boş geçemezsiniz!";
                Label5.Visible = true;
            }
        }
Пример #11
0
        protected void btn_makale_kydt_Click(object sender, EventArgs e)
        {
            if (txt_kat_baslik.Text != string.Empty && txt_makale_etiket.Text != string.Empty && txt_mkl_icerigi.Value != string.Empty)
            {
                string makale_ozet = string.Empty;
                if (txt_mkl_icerigi.Value.Length > 500)
                {
                    makale_ozet = txt_mkl_icerigi.Value.Substring(0, 497) + "...";
                }
                else
                {
                    makale_ozet = txt_mkl_icerigi.Value;
                }

                SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
                try
                {
                    baglanti.Open();
                    SqlCommand komut = new SqlCommand();
                    komut.Connection  = baglanti;
                    komut.CommandType = CommandType.Text;
                    komut.CommandText = "UPDATE makaleler SET makale_basligi=@makale_basligi,makale_icerigi=@makale_icerigi,makale_etiketleri=@makale_etiketleri,makale_ozet=@makale_ozet WHERE makale_ID=@ID";
                    komut.Parameters.AddWithValue("@makale_basligi", txt_kat_baslik.Text);
                    komut.Parameters.AddWithValue("@makale_icerigi", txt_mkl_icerigi.Value);
                    komut.Parameters.AddWithValue("@makale_etiketleri", txt_makale_etiket.Text);
                    komut.Parameters.AddWithValue("@makale_ozet", makale_ozet);
                    komut.Parameters.AddWithValue("ID", Request.QueryString["ID"].ToString());
                    komut.ExecuteNonQuery();
                    Label5.Text    = "Değişiklikler başarıyla kaydedildi.";
                    Label5.Visible = true;
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }
                finally
                {
                    baglanti.Close();
                    baglanti.Dispose();
                }
            }
        }
Пример #12
0
        protected void btn_yrm_gonder_Click(object sender, EventArgs e)
        {
            if (txt_yrmcu_adi.Text == "" || txt_yrm_icerigi.Text == "")
            {
                string ID = Request.QueryString["ID"].ToString();
                Response.Redirect("makaleDetay.aspx?ID=" + ID);
            }
            else
            {
                string        ID       = Request.QueryString["ID"].ToString();
                SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
                try
                {
                    baglanti.Open();
                    SqlCommand komut = new SqlCommand();
                    komut.Connection  = baglanti;
                    komut.CommandType = CommandType.Text;
                    komut.CommandText = "INSERT INTO yorumlar (makale_ID,yorum_tarihi,yorumcu_adi,yorumcu_eposta,yorum_icerigi) VALUES (@makale_ID,@yorum_tarihi,@yorumcu_adi,@yorumcu_eposta,@yorum_icerigi)";
                    komut.Parameters.AddWithValue("@makale_ID", ID);
                    komut.Parameters.AddWithValue("@yorum_tarihi", DateTime.Now.ToString());
                    komut.Parameters.AddWithValue("@yorumcu_adi", txt_yrmcu_adi.Text);
                    komut.Parameters.AddWithValue("@yorumcu_eposta", txt_yrmcu_eposta.Text);
                    komut.Parameters.AddWithValue("@yorum_icerigi", txt_yrm_icerigi.Text);
                    komut.ExecuteNonQuery();
                    Response.Redirect("makaleDetay.aspx?ID=" + ID);
                }
                catch (Exception ex)
                {
                    Response.Write("<font color=red>HATA:</font>Yorum eklenirken hata meydana geldi!<br>" + ex.Message);
                }

                finally
                {
                    if (baglanti.State == ConnectionState.Open)
                    {
                        baglanti.Close();
                    }
                }
            }
        }
Пример #13
0
        protected void btn_ekle_Click(object sender, EventArgs e)
        {
            if (txt_yon_adi.Text != string.Empty && txt_yon_sifre.Value != string.Empty)
            {
                SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
                try
                {
                    baglanti.Open();
                    SqlCommand komut = new SqlCommand();
                    komut.Connection  = baglanti;
                    komut.CommandType = CommandType.Text;
                    komut.CommandText = "INSERT INTO hesaplar (kullanici_adi,kullanici_sifre) VALUES (@kullanici_adi,@kullanici_sifre)";
                    komut.Parameters.AddWithValue("@kullanici_adi", txt_yon_adi.Text);
                    komut.Parameters.AddWithValue("@kullanici_sifre", txt_yon_sifre.Value);
                    komut.ExecuteNonQuery();
                    lbl_eklendi.Visible = true;
                }

                catch (Exception ex)
                {
                    lbl_eklenmedi.Visible = true;
                }

                finally
                {
                    if (baglanti.State == ConnectionState.Open)
                    {
                        baglanti.Close();
                    }
                }

                txt_yon_adi.Text    = string.Empty;
                txt_yon_sifre.Value = string.Empty;
            }
            else
            {
                bosAlan.Visible = true;
            }
        }
Пример #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["yonetici"] == null)
     {
         Response.Redirect("Anasayfa.aspx");
     }
     else
     {
         SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
         try
         {
             baglanti.Open();
             SqlCommand komut = new SqlCommand();
             komut.Connection  = baglanti;
             komut.CommandType = CommandType.Text;
             komut.CommandText = "select * from iletisim";
             DataTable      tablo = new DataTable();
             SqlDataAdapter adapt = new SqlDataAdapter(komut);
             adapt.Fill(tablo);
             foreach (DataRow item in tablo.Rows)
             {
                 if (!IsPostBack)
                 {
                     iletisim_baslik.Text  = item["iletisim_baslik"].ToString();
                     iletisim_icerik.Value = item["iletisim_icerik"].ToString();
                 }
             }
         }
         catch (Exception ex)
         {
             Response.Write("<font color=red>HATA:</font>" + ex.Message);
         }
         finally
         {
             baglanti.Close();
             baglanti.Dispose();
         }
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (kategori_adi.Text != string.Empty)
            {
                // kategori için veri tabanı kodlarının başlangıcı.
                SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
                try
                {
                    baglanti.Open();
                    SqlCommand komut = new SqlCommand();
                    komut.Connection  = baglanti;
                    komut.CommandType = CommandType.Text;
                    komut.CommandText = "INSERT INTO kategoriler (kategori_adi) VALUES (@kategori_adi)";
                    komut.Parameters.AddWithValue("@kategori_adi", kategori_adi.Text);
                    komut.ExecuteNonQuery();
                }

                catch (Exception ex)
                {
                    Literal1.Visible = true;
                }

                finally
                {
                    if (baglanti.State == ConnectionState.Open)
                    {
                        baglanti.Close();
                    }
                }
                // kategori kaydı sonu.
                kategori_adi.Text = string.Empty;
                Response.Redirect("kategori_ekle.aspx");
            }
            else
            {
                Literal2.Visible = true;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["yonetici"] == null)
     {
         Response.Redirect("Anasayfa.aspx");
     }
     else
     {
         if (Request.QueryString.Count <= 0)
         {
             Response.Write("<font color=red>QueryString Girilmedi!");
             Response.Redirect("Anasayfa.aspx");
         }
         else
         {
             SqlConnection baglanti = new SqlConnection(Fonksiyonlar.connectionString());
             baglanti.Open();
             SqlCommand komut = new SqlCommand();
             komut.Connection  = baglanti;
             komut.CommandType = CommandType.Text;
             komut.CommandText = "select * from hesaplar where kullanici_ID=" + Request.QueryString["ID"].ToString();
             DataTable      tablo = new DataTable();
             SqlDataAdapter adapt = new SqlDataAdapter(komut);
             adapt.Fill(tablo);
             foreach (DataRow item in tablo.Rows)
             {
                 if (!IsPostBack)
                 {
                     kln_adi.Text = item["kullanici_adi"].ToString();
                     kln_sif.Text = item["kullanici_sifre"].ToString();
                 }
             }
             baglanti.Close();
             baglanti.Dispose();
         }
     }
 }