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

📄 bbs_addreply.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_AddReply : System.Web.UI.Page
{
    WebService webService = new WebService();
    string strSql;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null || Session["UserLevel"] == null)
        {
            Response.Redirect("~/Error.aspx");
        }
        strSql = "Select BM_Title from z_BbsMessage where BM_ID = '" + Request.QueryString["bid"] + "';";
        DataTable table = webService.ExcuteSelect(strSql);
        this.lblTitle.Text = table.Rows[0]["BM_Title"].ToString();
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.tbContent.Text == "")
        {
            this.lblMsg.Text = "请输入完整信息!";
        }
        else
        {
            //插入回复信息数据表
            strSql = "Insert into z_Reply(BBS_ID,Reply_Content,Reply_AddDate,Reply_AddPersonID) values ('" + Request.QueryString["bid"] + "','" + this.tbContent.Text + "','" + DateTime.Now + "','" + Session["UserID"].ToString() + "');";
            webService.ExcuteSql(strSql);
            //修改主题表中的回复数
            strSql = "Update z_BbsMessage set BM_Replies=BM_Replies+1 where BM_ID='" + Request.QueryString["bid"] + "';";
            webService.ExcuteSql(strSql);
            Response.Redirect("BBS_Info.aspx?bid="+Request.QueryString["bid"]);
        }
    }
}

⌨️ 快捷键说明

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