Example #1
0
        protected void informbutton_Click(object sender, EventArgs e)
        {
            if (Session["User_ID"] != null)
            {
                if (informflag == false)
                {
                    Inform inform = new Inform();
                    inform.User_ID = int.Parse(Session["User_ID"].ToString());
                    inform.Pro_ID  = int.Parse(Request.QueryString["pro_id"].ToString());
                    inform.results = "等待处理结果";
                    if (InformBll.addInform(inform) == 1)
                    {
                        informbutton.CssClass = "btn btn-large";
                        informbutton.Text     = "已举报";
                        informflag            = true;
                        ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('举报成功!请等待管理员处理');", true);
                    }
                }
                else if (informflag == true)
                {
                    int User_ID = int.Parse(Session["User_ID"].ToString());
                    int Pro_ID  = int.Parse(Request.QueryString["pro_id"].ToString());

                    if (InformBll.deleteInform(User_ID, Pro_ID) == 1)
                    {
                        ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('取消举报成功!');", true);
                        informbutton.CssClass = "btn btn-danger btn-large";
                        informbutton.Text     = "举报";
                        informflag            = false;
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('取消失败!');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('举报失败,请登录!');", true);
            }
        }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CKFinder.FileBrowser fileBrowser = new CKFinder.FileBrowser();
     fileBrowser.BasePath = "../ckfinder/";  //设置CKFinder的基路径
     fileBrowser.SetupCKEditor(txtContent);
     if (!IsPostBack)
     {
         flag = true;
         //id = int.Parse(Request.QueryString["pro_id"].ToString());
         #region 绑定前台数据
         //BindNew();
         //BindTop();
         //BindTally();
         if (Request.QueryString["pro_id"] != null)
         {
             SqlDataReader proclassname = AcgService.select(int.Parse(Request.QueryString["pro_id"].ToString()));
             proclassname.Read();
             string    classname = proclassname["Pro_Class"].ToString();
             DataTable dt        = AcgService.select1(int.Parse(Request.QueryString["pro_id"].ToString()));
             if (classname == "视频")
             {
                 shiping.Visible      = true;
                 otheracg.Visible     = false;
                 acgdetall.DataSource = dt;
                 acgdetall.DataBind();
             }
             else
             {
                 shiping.Visible      = false;
                 otheracg.Visible     = true;
                 Repeater2.DataSource = dt;
                 Repeater2.DataBind();
             }
             BindBC();
             //显示总共多少评论
             num.Text = CommentService.num(int.Parse(Request.QueryString["pro_id"].ToString())).ToString();
         }
         #endregion
         #region 举报收藏
         if (Session["User_ID"] != null && Request.QueryString["pro_id"].ToString() != null)
         {
             SqlDataReader colletdt = CollectionBll.seletcCollect(int.Parse(Session["User_ID"].ToString()), int.Parse(Request.QueryString["pro_id"].ToString()));
             colletdt.Read();
             SqlDataReader informdt = InformBll.seletcInform(int.Parse(Session["User_ID"].ToString()), int.Parse(Request.QueryString["pro_id"].ToString()));
             informdt.Read();
             if (colletdt != null && colletdt.HasRows == true)
             {
                 collectbutton.CssClass = "btn btn-large";
                 collectbutton.Text     = "已收藏";
                 collectflag            = true;
             }
             else
             {
                 collectbutton.CssClass = "btn btn-primary btn-large";
                 collectbutton.Text     = "收藏";
                 collectflag            = false;
             }
             if (informdt != null && informdt.HasRows == true)
             {
                 informbutton.CssClass = "btn btn-large";
                 informbutton.Text     = "已举报";
                 informflag            = true;
             }
             else
             {
                 informbutton.CssClass = "btn btn-danger btn-large";
                 informbutton.Text     = "举报";
                 informflag            = false;
             }
         }
         #endregion
     }
 }