Ejemplo n.º 1
0
        //增加新闻评论回复
        public static int cbadd(News_Comment_Back ncb)
        {
            string sql = "insert into News_Comment_Back values(@CB_Content,@CB_Time,@CB_Users_Name,@CB_NC_ID)";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@CB_Content", ncb.CB_Content1),
                new SqlParameter("@CB_Time", ncb.CN_Time1),
                new SqlParameter("@CB_Users_Name", ncb.CB_Users_Name1),
                new SqlParameter("@CB_NC_ID", ncb.CB_NC_ID1)
            };
            return(DBHelper.GetExcuteNonQuery(sql, sp));
        }
Ejemplo n.º 2
0
        //回复
        protected void huifu_Click(object sender, EventArgs e)
        {
            Button bt = (Button)sender;

            if (Session["username"] != null)
            {
                try
                {
                    News_Comment_Back ncb = new News_Comment_Back();
                    ncb.CB_Content1    = (bt.Parent.FindControl("FCKeditor2") as TextBox).Text;
                    ncb.CN_Time1       = DateTime.Now;
                    ncb.CB_Users_Name1 = Session["username"].ToString();
                    ncb.CB_NC_ID1      = Int32.Parse((bt.Parent.FindControl("HiddenField1") as HiddenField).Value);

                    if (News_Comment_BackBLL.cbadd(ncb) == 1)
                    {
                        FCKeditor1.Text = "";
                        ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('回复评论成功!');", true);
                        flag = true;
                        BingNC();
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('回复评论失败!');", true);
                    }
                }
                catch (Exception ex)
                {
                    Response.Write("错误原因:" + ex.Message);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('对不起,请先登录!');", true);
            }
        }
Ejemplo n.º 3
0
 //增加新闻评论的回复
 public static int cbadd(News_Comment_Back ncb)
 {
     return(News_Comment_BackDal.cbadd(ncb));
 }