//回复 protected void huifu_Click(object sender, EventArgs e) { Button bt = (Button)sender; if (Session["username"] != null) { try { BBS_Comment_Back bcb = new BBS_Comment_Back(); bcb.BCB_BC_ID1 = Int32.Parse((bt.Parent.FindControl("HiddenField1") as HiddenField).Value); bcb.BCB_Content1 = (bt.Parent.FindControl("txtContent") as TextBox).Text; bcb.BCB_Time1 = DateTime.Now; bcb.BCB_Users_Name1 = Session["username"].ToString(); if (BBS_Comment_BackBll.addbcb(bcb) == 1) { txtContent.Text = ""; ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('回复评论成功!');", true); flag = true; BingBC(); } 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); } }
//发表回复 public static int addbcb(BBS_Comment_Back bcb) { string sql = "insert into BBS_Comment_Back values(@BCB_Content,@BCB_Time,@BCB_Users_Name,@BCB_BC_ID)"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@BCB_Content", bcb.BCB_Content1), new SqlParameter("@BCB_Time", bcb.BCB_Time1), new SqlParameter("@BCB_Users_Name", bcb.BCB_Users_Name1), new SqlParameter("@BCB_BC_ID", bcb.BCB_BC_ID1) }; return(DBHelper.GetExcuteNonQuery(sql, sp)); }
//增加回复 public static int addbcb(BBS_Comment_Back bcb) { return(BBS_Comment_BackDal.addbcb(bcb)); }