- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections.Generic;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class BBS_BBSView : System.Web.UI.Page
- {
- /// <summary>
- /// 论坛模板
- /// </summary>
- Model.BBS MB = new Model.BBS();
- /// <summary>
- /// 论坛业务
- /// </summary>
- BLL.BBS BB = new BLL.BBS();
- /// <summary>
- /// 回复模板
- /// </summary>
- Model.BBSBack MBB = new Model.BBSBack();
- /// <summary>
- /// 回复业务
- /// </summary>
- BLL.BBSBack BBB = new BLL.BBSBack();
- /// <summary>
- /// 标题
- /// </summary>
- public string TitleStr = "";
- /// <summary>
- /// 内容
- /// </summary>
- public string ContentStr = "";
- /// <summary>
- /// 回复
- /// </summary>
- public string RepBackStr = "";
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "BBS_BBSView");
- if (!IsPostBack)
- {
- if(Request.QueryString["id"]!=null)
- {
- MB = BB.GetModel(int.Parse(Request.QueryString["id"].ToString()));
- MB.DJ = MB.DJ + 1;
- BB.Update(MB);//阅读加一
- DropDownListType.Text = EnumGet.GetBBSSmailTYPEName(int.Parse(MB.FL));
- TextBoxContent.Text = MB.ZTNR;
- TextBoxTitle.Text = MB.ZT;
- string TiaoJian="ZTID="+Request.QueryString["id"].ToString();
- int Count=BBB.GetCount(TiaoJian);
- if (Count > 0)
- {
- List<Model.BBSBack> LMBB = BBB.GetPageList(Count, 1, "ID", false, TiaoJian);
- GetListStr(LMBB);
- }
- }
- }
- }
- public void GetListStr(List<Model.BBSBack> LMBB)
- {
- foreach (Model.BBSBack MB in LMBB)
- {
- RepBackStr+= @"<tr>
- <td class=""usertablerow2"" align=""left"" style=""height: 32px;"" colspan=""2"">
- <br />
- 回复者:" + MB.HFZZ + @" 时间:" + MB.HFSJ + @"
- <hr />
- " + MB.HFNR + @"
- </td>
- </tr>";
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- try
- {
- if (TextBoxBack.Text == "")
- {
- throw new Exception("回复内容不能为空!");
- }
- MBB.HFNR = TextBoxBack.Text;
- MBB.ZTID = int.Parse(Request.QueryString["id"].ToString());
- MBB.HFZZ = SessionInclude.SessionId;
- MBB.HFSJ = DateTime.Now;
- MB = BB.GetModel(int.Parse(Request.QueryString["id"].ToString()));
- MB.HF = MB.HF + 1;
- BB.Update(MB);//阅读加一
- BBB.Add(MBB);
- MessageBox.Show("回复成功", "BBSView.aspx?id=" + Request.QueryString["id"].ToString());
- }
- catch(Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
- }