Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.Title = Title + SetTitle.getTitle();
        }
        if (Convert.ToString(Session["admin"]) != "admin")
        {
            Response.Redirect("~/refresh.aspx?msg=" + "对不起,只有管理员才能对文章进行相关的操作0!");
            return;
        }

        int            aid = Convert.ToInt32(Request.QueryString["aid"]);
        ArticleOperate aop = new ArticleOperate();
        bool           b   = aop.delete(aid);

        if (b)
        {
            Response.Redirect("~/refresh.aspx?msg=" + "文章删除成功!");
        }
        else
        {
            Response.Redirect("~/refresh.aspx?msg=" + "文章删除失败!");
        }
    }
Example #2
0
 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");
     }
 }
Example #3
0
    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");
        }
    }