예제 #1
0
 DataTable GetComments()
 {
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     DataTable dt = db.GetDataTable("Select * from Yorum");
     GridViewComments.DataSource = dt;
     GridViewComments.DataBind();
     db.CloseConnection();
     return dt;
 }
예제 #2
0
 protected void btn_Deneme2_Click(object sender, ImageClickEventArgs e)
 {
     decimal basID = Convert.ToDecimal((sender as ImageButton).CommandArgument);
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     db.Delete("Delete from Yorum Where YorumId = " + basID + ";");
     db.CloseConnection();
     //Response.Redirect("GridViewDeneme.aspx");
     GetComments();
 }
예제 #3
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];
 }
예제 #4
0
 protected void btn_Comment_Click(object sender, ImageClickEventArgs e)
 {
     string yorum = txt_Comment.Text;
     string user_id = Session["User_id"].ToString();
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     db.Insert("Insert into Yorum (YorumIcerik , MakaleID , User_id , Tarih ) values ('" + yorum + "'," + makale_id + "," + user_id + ",GETDATE())");
     txt_Comment.Text = "";
     db.CloseConnection();
     Response.Redirect("Blog.aspx?id="+makale_id+"&page="+Session["Comment_Page"].ToString());
 }
예제 #5
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];
 }
예제 #6
0
 DataTable GetComments(String id)
 {
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     DataTable dt = db.GetDataTable("Select y.YorumId ,  y.YorumIcerik , y.MakaleID , y.Tarih , y.Onay , u.Name from Yorum y , Users u where y.User_id = u.User_Id and y.MakaleId=" + makale_id);
     rpt_Comment.DataSource = dt;
     rpt_Comment.DataBind();
     db.CloseConnection();
     return dt;
 }
예제 #7
0
 string GetCommentCount()
 {
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     DataTable dt = db.GetDataTable("Select COUNT(y.MakaleID) as Comment_Count from Yorum y where y.MakaleID = " + makale_id);
     db.CloseConnection();
     return dt.Rows[0]["Comment_Count"].ToString();
 }
예제 #8
0
 void GetTags(String id)
 {
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     DataTable dt = db.GetDataTable("SELECT e.EtiketAd FROM Makale m , MakaleEtiket me , Etiket e WHERE me.MakaleId = m.MakaleId AND me.EtiketId = e.EtiketId AND m.MakaleId = " + makale_id);
     dl_Tags.DataSource = dt;
     dl_Tags.DataBind();
     db.CloseConnection();
 }
예제 #9
0
 void GetContent(String id)
 {
     DatabaseMethods db = new DatabaseMethods();
     db.OpenConnection();
     DataTable dt = db.GetDataTable("Select * from Makale Where MakaleId =" + makale_id);
     rpt_Makale.DataSource = dt;
     rpt_Makale.DataBind();
     db.CloseConnection();
 }