protected void btnCommit_ServerClick(object sender, EventArgs e) { int aid = Convert.ToInt32(Request.QueryString["aid"]); CommentOperate cp = new CommentOperate(); string comment = Server.HtmlEncode(this.txtComment.Text.ToString()); if (comment.Length > 250) { comment = comment.Substring(0, 250); } Comment ct = new Comment(aid, comment); bool b = cp.insert(ct); if (b) { this.lblErrorComment.Visible = false; this.DataListAllComment.DataBind(); Response.Redirect("article.aspx?aid=" + aid); } else { this.lblErrorComment.Visible = true; this.lblErrorComment.Text = "评论发表失败,请重新尝试!"; } }
protected void summit_Btn_Click(object sender, EventArgs e) { CommentOperate cop = new CommentOperate(); Comment co = new Comment(); co.gid = Request.QueryString["id"].ToString(); co.gcontent = FCKeditor1.Value; co.gauthor = tb_author.Text; bool flag = cop.insert(co); if (flag) { id = Request.QueryString["id"].ToString(); at = aot.getByAid(id); at.gentieCount++; aot.update(at);//跟帖次数加一后修改 this.DataListAllComment.DataBind(); this.Label1.Visible = false; Response.Redirect("newsarticle.aspx?id=" + id); } else { Label1.Text = "发贴失败!"; } }
protected void Page_Load(object sender, EventArgs e) { string Sid = Request.QueryString["id"].ToString() ; ArticleOperate ap = new ArticleOperate(); bool b=ap.delete(Sid); CommentOperate co=new CommentOperate(); bool bb = co.deletebyarticle(Sid); if (b) { Response.Redirect("~/Blog.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { string Sid = Request.QueryString["id"].ToString(); ArticleOperate ap = new ArticleOperate(); bool b = ap.delete(Sid); CommentOperate co = new CommentOperate(); bool bb = co.deletebyarticle(Sid); if (b) { Response.Redirect("~/Blog.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { //asdfasdfasdfasdfaasddf if (!IsPostBack) { this.Title = SetTitle.getTitle(); try { int aid = Convert.ToInt32(Request.QueryString["aid"]); Article at = (new ArticleOperate()).getByAid(aid); if (at == null || at.Equals(null)) { this.Page.Title = "此文章不存在,或被管理员删除,请见谅" + " " + Title; this.lblcontent.Text = "此文章不存在,或被管理员删除,请见谅!"; this.txtComment.Text = "此文章不存在,不允许发表评论"; this.txtComment.Enabled = false; this.btnCommit.EnableTheming = false; } else { this.lbltitle.Text = at.title; this.Page.Title = at.title + " " + Title; this.lblposttime.Text = at.posttime.ToString(); this.lblcontent.Text = at.content; this.lblcname.Text = at.cname; this.hklist.NavigateUrl = "list.aspx?cid=" + at.cid.ToString(); this.hklastArticle.NavigateUrl = "article.aspx?aid=" + (at.aid - 1).ToString(); this.hknextArticle.NavigateUrl = "article.aspx?aid=" + (at.aid + 1).ToString(); this.lblCommet.Text = at.countcomment.ToString(); CommentOperate cop = new CommentOperate(); this.DataListAllComment.DataSource = cop.viewAllbyAid(aid); this.DataListAllComment.DataBind(); } } catch { Response.Redirect("refresh.aspx?msg=" + "此文章不存在,或被管理员删除,请见谅!"); } } }
protected void Page_Load(object sender, EventArgs e) { //url = "admin/editpage.aspx?id=" + Request.QueryString["id"].ToString(); if (!IsPostBack) { try { id = Request.QueryString["id"].ToString(); ii = id; Url = "admin/editpage.aspx?id=" + id; Durl = "admin/deletepage.aspx?id=" + id; at = aot.getByAid(id); if (at == null || at.Equals(null)) { this.Page.Title = "此文章不存在" + " " + Title; this.lblcontent.Text = "此文章不存在!"; } else { this.lbltitle.Text = at.title; this.Page.Title = at.title + " " + Title; this.lblposttime.Text = at.postdatetime.ToString(); this.Lbl_readcount.Text = at.readcount.ToString(); this.lblcontent.Text = at.content; this.lblcname.Text = at.author; this.lblCommet.Text = at.gentieCount.ToString(); CommentOperate cop = new CommentOperate(); this.DataListAllComment.DataSource = cop.viewAllbyAid(id); this.DataListAllComment.DataBind(); at.readcount++; aot.update(at); } } catch { // Response.Write("文章不存在!"); } } }
protected void Page_Load(object sender, EventArgs e) { try { string id = Request.QueryString["artid"].ToString(); string Sid = Request.QueryString["id"].ToString(); Article ar = new Article(); ArticleOperate ao = new ArticleOperate(); ar = ao.getByAid(id); ar.gentieCount--; ao.update(ar); CommentOperate co = new CommentOperate(); bool b = co.delete(Sid); if (b) { Response.Redirect("~/newsarticle.aspx?id=" + id); } } catch { } }
protected void Page_Load(object sender, EventArgs e) { try { string id = Request.QueryString["artid"].ToString(); string Sid = Request.QueryString["id"].ToString(); Article ar = new Article(); ArticleOperate ao = new ArticleOperate(); ar = ao.getByAid(id); ar.gentieCount--; ao.update(ar); CommentOperate co = new CommentOperate(); bool b = co.delete(Sid); if (b) { Response.Redirect("~/newsarticle.aspx?id="+id); } } catch { } }