protected void GetReplies() { int postID = int.Parse(Request.QueryString["postID"]); LabMS.BLL.PostReply postReply = new LabMS.BLL.PostReply(); DataSet ds = postReply.GetList(" [PosterID] = " + postID); AspNetPager.RecordCount = ds.Tables[0].Rows.Count; HandleReply(ds); }
/// <summary> /// �ظ� /// </summary> protected void BindReply() { int postID = int.Parse(Request.QueryString["id"]); LabMS.BLL.PostReply postReply = new LabMS.BLL.PostReply(); DataSet ds = postReply.GetList(" [PosterID] = " + postID); ds = HandleReply(ds); RepeaterPostReply.DataSource = ds.Tables[0].DefaultView; RepeaterPostReply.DataBind(); }
/// <summary> /// �����ظ� /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnReply_Click(object sender, EventArgs e) { int postID = int.Parse(Request.QueryString["id"]); LabMS.BLL.PostReply postReply = new LabMS.BLL.PostReply(); LabMS.Model.PostReply postReplyInfo = new LabMS.Model.PostReply(); postReplyInfo.ReplierID = 1; // TBD postReplyInfo.PosterID = postID; postReplyInfo.PostReplyContent = Server.HtmlEncode(ReplyNew.Text); postReplyInfo.PostReplyTime = DateTime.Now; postReply.Add(postReplyInfo); // �ظ� BindReply(); ReplyNew.Text = ""; }
public void ProcessRequest(HttpContext context) { try { string idJson = System.Web.HttpContext.Current.Server.UrlDecode(context.Request.Form.ToString()); LabMS.Model.PostReply ppInfo = (LabMS.Model.PostReply)Newtonsoft.Json.JavaScriptConvert.DeserializeObject(idJson, typeof(LabMS.Model.PostReply)); LabMS.BLL.PostReply pr = new LabMS.BLL.PostReply(); pr.Delete(ppInfo.ID); context.Response.ContentType = "application/json"; context.Response.Write("{success: true}"); } catch { context.Response.ContentType = "application/json"; context.Response.Write("{error: true}"); } }
/// <summary> /// 新增回复 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnReply_Click(object sender, EventArgs e) { int postID = int.Parse(Request.QueryString["postID"]); LabMS.BLL.PostReply postReply = new LabMS.BLL.PostReply(); LabMS.Model.PostReply postReplyInfo = new LabMS.Model.PostReply(); postReplyInfo.ReplierID = int.Parse(Session["UserID"].ToString()); postReplyInfo.ReplierType = Base.PrivilegeManager.GetUserTypeCode(); postReplyInfo.PosterID = postID; postReplyInfo.PostReplyContent = Server.HtmlEncode(ReplyNew.Text); postReplyInfo.PostReplyTime = DateTime.Now; postReply.Add(postReplyInfo); // 绑定回复 GetPost(); GetReplies(); ReplyNew.Text = ""; }