void repcomment() { string commentdesc = string.Empty; StreamReader rd = new StreamReader(Server.MapPath("emotion/key.txt")); string keyword = rd.ReadLine(); try { commentdesc = HttpContext.Current.Request.Form.Get("commentdesc").ToString(); } catch (Exception) { commentdesc = ""; } if (commentdesc.Trim() != null && commentdesc.Trim() != "") { commentdesc = JQDialog.FilterKeyWord(commentdesc, keyword); commentdesc = JQDialog.GetTextFromHTML(commentdesc); MSForumComment commentModel = new MSForumComment(); MSForumCommentDAL commentDal = new MSForumCommentDAL(); commentModel.ID = Guid.NewGuid().ToString("N").ToUpper(); commentModel.Ctext = commentdesc; commentModel.Review = 1; commentModel.TID = strTid; commentModel.UID = strUid; commentModel.UpID = strupid; commentModel.Cstate = 0; if (commentDal.AddComment(commentModel)) { errorscript = JQDialog.alertOKMsgBox(3, "回复成功", "MyCommentList.aspx?fid=" + strfid, "error"); } else { errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请核对后再操作!", true); } } else { errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请重新再操作!", true); } }
void topicpublish() { string topicdesc = string.Empty; #region --------获取标题和内容--------------- try { topictitle = HttpContext.Current.Request.Form.Get("topictitle").ToString(); } catch (Exception) { topictitle = ""; } try { topicdesc = HttpContext.Current.Request.Form.Get("topicdeschidden").ToString(); } catch (Exception) { topicdesc = ""; } #endregion MSForumTopicDAL forumtopicDal = new MSForumTopicDAL(); MSForumTopic forumtopicModel = new MSForumTopic(); StreamReader rd = new StreamReader(Server.MapPath("emotion/key.txt")); string keyword = rd.ReadLine(); if (topictitle != null && topictitle != "") { topictitle = JQDialog.FilterKeyWord(topictitle, keyword); topictitle = JQDialog.GetTextFromHTML(topictitle); forumtopicModel.TopicTitle = topictitle; } if (topicdesc != null && topicdesc != "") { topicdesc = JQDialog.FilterKeyWord(topicdesc, keyword); topicdesc = JQDialog.GetTextFromHTML(topicdesc); forumtopicModel.TopicDesc = topicdesc; } if (!forumtopicDal.ExistMSForumTopic(topictitle, strfid, strUid)) { strTid = Guid.NewGuid().ToString("N").ToUpper(); forumtopicModel.ID = strTid; forumtopicModel.TopicState = 0; forumtopicModel.FID = strfid; forumtopicModel.Treview = 1; forumtopicModel.UID = strUid; SaveImages(); if (forumtopicDal.AddMSForumTopic(forumtopicModel)) { errorscript = JQDialog.alertOKMsgBox(5, "操作成功", "MyTopicList.aspx?fid=" + strfid, "succeed"); } else { errorscript = JQDialog.alertOKMsgBoxGoBack(5, "操作失败<br/>请核对后再操作!", true); } } else { errorscript = JQDialog.alertOKMsgBoxGoBack(5, "操作失败<br/>请核对后再操作!", true); } }