BBSWrite.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- 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_BBSWrite : System.Web.UI.Page
- {
- /// <summary>
- /// 论坛模板
- /// </summary>
- Model.BBS MB = new Model.BBS();
- /// <summary>
- /// 论坛业务
- /// </summary>
- BLL.BBS BB = new BLL.BBS();
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "BBS_BBSWrite");
- if (!IsPostBack)
- {
- DropLoadSet();
- }
- }
- public void DropLoadSet()
- {
- DropDownListType.DataTextField = "MC";
- DropDownListType.DataValueField = "ID";
- DropDownListType.DataSource = EnumGet.BBSSmailTYPEGetEnum();
- DropDownListType.DataBind();
- DropDownListType.SelectedIndex = DropDownListType.Items.Count - 1;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- try
- {
- if (TextBoxTitle.Text == "")
- {
- throw new Exception("标题不能为空!");
- }
- if (Editor1.Text == "")
- {
- throw new Exception("内容不能为空!");
- }
- MB.DJ = 0;
- MB.FL = DropDownListType.SelectedValue;
- MB.HF = 0;
- MB.ZHHF = DateTime.Now;
- MB.ZT = TextBoxTitle.Text;
- MB.ZTNR = Editor1.Text;
- MB.ZTZZ = SessionInclude.SessionId;
- BB.Add(MB);
- MessageBox.Show("发表成功","BBSNews.aspx");
- }
- catch(Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
-
- }