protected void btnCommit_Click(object sender, EventArgs e) { if (txtTilte.Text.Length == 0) { Javascript.GoHistory(-1, "请填写标题!", Page); return; } if (Textarea1.Value.Length == 0) { Javascript.GoHistory(-1, "请填写内容!", Page); return; } DalOperationAboutBbs dalOperationAboutBbs = new DalOperationAboutBbs(); UserCookiesInfo UserCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo(); BbsTopics topic = new BbsTopics { courseNo = Request["forumId"], topicTitle = CommonUtility.JavascriptStringFilterAll(txtTilte.Text), topicContent = CommonUtility.JavascriptStringFilterAll(Textarea1.Value), topicUserName = (UserCookiesInfo.userType != 3) ? UserCookiesInfo.userName : UserCookiesInfo.userNo + " " + UserCookiesInfo.userName, updateTime = DateTime.Now, topicUserNo = UserCookiesInfo.userNo, topicUserType = UserCookiesInfo.userType, isbigTop=1 }; if (hidAttachmentId.Value.CompareTo(string.Empty) != 0) { topic.attachmentIds = hidAttachmentId.Value; } if (hasControls(Request["forumId"])) { dalOperationAboutBbs.AddTopicByForumId(topic);//添加新话题 } else { Javascript.GoHistory(-1, "您没有权限!", Page); } Javascript.RefreshParentWindow("BBSTopicList.aspx?tagName=" + Request["tagName"] + "&tag=2&forumId=" + Request["forumId"], Page); }
// /// <summary> ///// 提交话题标签功能代码 // /// </summary> // /// <param name="sender"></param> // /// <param name="e"></param> protected void btnCommit_Click(object sender, EventArgs e) { if (txtTilte.Text.Length == 0) { Javascript.GoHistory(-1, "请填写标题!", Page); return; } if (Textarea1.Value.Length == 0) { Javascript.GoHistory(-1, "请填写回复内容!", Page); return; } string tag = Request["tag"]; if (tag == "1") { forumId = Request["forumId"].Trim() + Server.UrlDecode(Request["classID"].Trim()) + Request["termtag"].Trim(); } DalOperationAboutBbs dalOperationAboutBbs = new DalOperationAboutBbs(); UserCookiesInfo UserCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo(); BbsTopics topic = new BbsTopics { courseNo = forumId, topicTitle = CommonUtility.JavascriptStringFilterAll(txtTilte.Text), topicContent = CommonUtility.JavascriptStringFilterAll(Textarea1.Value), topicUserName = (UserCookiesInfo.userType != 3) ? UserCookiesInfo.userName : UserCookiesInfo.userNo + " " + UserCookiesInfo.userName, updateTime = DateTime.Now, topicUserNo = UserCookiesInfo.userNo, topicUserType = UserCookiesInfo.userType }; if (hidAttachmentId.Value.CompareTo(string.Empty) != 0) { topic.attachmentIds = hidAttachmentId.Value; } dalOperationAboutBbs.AddTopicByForumId(topic);//添加新话题 Javascript.AlertAndRedirect("添加主题成功!", "BBSTopicList.aspx?forumId=" + Request["forumId"] + "&classID=" + Server.UrlDecode(Request["classID"]) + "&termTag=" + Request["termTag"] + "&tag=" + tag, Page); }