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 Button1_Click(object sender, EventArgs e) { string aid = Request.QueryString["id"].ToString(); string title = this.TextBox1.Text.ToString(); int cid = Convert.ToInt32(this.DropDownListclass.SelectedValue); string content = this.FCKeditor1.Value.ToString(); ArticleOperate aop = new ArticleOperate(); Article ac = new Article(aid,cid,title,content); bool b = aop.update(ac); if (b) { Response.Redirect("~/newsarticle.aspx?id="+aid); } }
protected void Button1_Click(object sender, EventArgs e) { string aid = Request.QueryString["id"].ToString(); string title = this.TextBox1.Text.ToString(); int cid = Convert.ToInt32(this.DropDownListclass.SelectedValue); string content = this.FCKeditor1.Value.ToString(); ArticleOperate aop = new ArticleOperate(); Article ac = new Article(aid, cid, title, content); bool b = aop.update(ac); if (b) { Response.Redirect("~/newsarticle.aspx?id=" + aid); } }
protected void btnSubmit_Click(object sender, EventArgs e) { int aid = Convert.ToInt32(Request.QueryString["aid"]); string title = this.txtTitle.Text.ToString(); int cid = Convert.ToInt32(this.DropDownListClass.SelectedValue); string content = this.txtBody.Value; ArticleOperate aop = new ArticleOperate(); Article ac = new Article(aid, cid, title, content); bool b = aop.update(ac); if (b) { Response.Redirect("~/refresh.aspx?msg=" + "恭喜你,更新成功!"); } else { this.lblMsg.Text = "很遗憾,更新失败,请重新尝试!"; } }
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 { } }