⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bbs_add.aspx.cs

📁 OA系统,数据库为SQLSever 。net c#
💻 CS
字号:
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_BBS_Add : System.Web.UI.Page
{
    WebService webService = new WebService();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null || Session["UserLevel"] == null)
        {
            Response.Redirect("~/Error.aspx");
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.tbContent.Text == "" || this.tbTitle.Text == "")
        {
            this.lblMsg.Text = "请输入完整信息";
        }
        else
        {
            string strTitle = this.tbTitle.Text;
            string strContent = this.tbContent.Text;
            string strSql = "Insert into z_BbsMessage(BM_Title,BM_Content,BM_AddDate,BM_AddPersonID,BM_Replies) values ('" + strTitle + "','" + strContent + "','" + DateTime.Now + "','" + Session["UserID"] + "','0');";
            webService.ExcuteSql(strSql);
            Response.Redirect("BBS_List.aspx");
        }
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        Response.Redirect("BBS_List.aspx");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -