Пример #1
0
 DataTable MakaleOzetGetir(string category_id)
 {
     int category_id_int = int.Parse(category_id);
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     DataSet ds = db.GetDataset("SELECT m.MakaleId , m.Baslik , m.Tarih , m.Ozet , Count(y.MakaleID) as Yorum_Count FROM Makale m LEFT JOIN Yorum y ON m.MakaleId = y.MakaleID WHERE m.KategoriID = " + category_id_int + " GROUP BY m.MakaleId , Baslik , m.Tarih , Ozet ORDER BY m.Tarih DESC");
     rptMakaleOzet_Category.DataSource = ds.Tables[0];
     rptMakaleOzet_Category.DataBind();
     db.CloseConnection();
     return ds.Tables[0];
 }
Пример #2
0
 DataTable MakaleOzetGetir(string tag_id)
 {
     int tag_id_int = int.Parse(tag_id);
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     DataSet ds = db.GetDataset("SELECT m.MakaleId , m.Baslik , m.Tarih , m.Ozet , Count(y.MakaleID) as Yorum_Count , e.EtiketAd FROM Makale m LEFT JOIN Yorum y ON m.MakaleId = y.MakaleID , Etiket e , MakaleEtiket me WHERE m.MakaleId = me.MakaleId AND me.EtiketId = e.EtiketId AND e.EtiketId = " + tag_id_int +" GROUP BY m.MakaleID , Baslik , m.Tarih , Ozet , e.EtiketAd  ORDER BY m.Tarih DESC");
     rptMakaleOzet_Tag.DataSource = ds.Tables[0];
     rptMakaleOzet_Tag.DataBind();
     db.CloseConnection();
     return ds.Tables[0];
 }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Admin"] != null)
            {
                if (Convert.ToBoolean(Session["Admin"]))
                {
                    if (!Page.IsPostBack)
                    {
                        if (lb_Tags.Items.Count == 0)
                        {
                            db = new DatabaseMethods();

                            DataSet ds = db.GetDataset("Select * From Etiket");
                            lb_Tags.DataSource = ds;
                            lb_Tags.DataTextField = "EtiketAd";
                            lb_Tags.DataValueField = "EtiketId";
                            lb_Tags.DataBind();
                            ds.Clear();
                            ds.Dispose();

                            ds = db.GetDataset("Select KategoriID , KategoriAd From Kategori");
                            ddl_Category.DataSource = ds;
                            ddl_Category.DataTextField = "KategoriAd";
                            ddl_Category.DataValueField = "KategoriID";
                            ddl_Category.DataBind();
                            ds.Clear();
                            ds.Dispose();
                        }
                    }
                }
                else
                {
                    Response.Redirect("WebForm1.aspx");
                }
            }
            else
            {
                Response.Redirect("WebForm1.aspx");
            }
        }