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

📄 bbs_editreply.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_EditReply : System.Web.UI.Page
{
    string strSql;
    WebService webService = new WebService();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null || Session["UserLevel"] == null)
        {
            Response.Redirect("~/Error.aspx");
        }
        if (!Page.IsPostBack)
        {
            strSql = "SELECT z_BbsMessage.BM_Title, z_Reply.BBS_ID, z_Reply.Reply_ID, z_Reply.Reply_Content, z_Reply.Reply_AddPersonID FROM z_BbsMessage INNER JOIN z_Reply ON z_BbsMessage.BM_ID = z_Reply.BBS_ID WHERE z_Reply.Reply_ID = '" + Request.QueryString["rid"] + "';";
            DataTable table = webService.ExcuteSelect(strSql);
            this.lblTitle.Text = table.Rows[0]["BM_Title"].ToString();
            this.tbContent.Text = table.Rows[0]["Reply_Content"].ToString();
            if (table.Rows[0]["Reply_AddPersonID"].ToString() != Session["UserID"].ToString())
            {
                Response.Redirect("~/Error.aspx");
            }
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.tbContent.Text == "")
        {
            this.lblMsg.Text = "请填写完整信息!";
        }
        else
        {
            strSql = "Update z_Reply set Reply_Content = '" + this.tbContent.Text + "',Reply_ModifyDate='" + DateTime.Now + "' where Reply_ID='" + Request.QueryString["rid"] + "';";
            webService.ExcuteSql(strSql);
            Response.Redirect("BBS_Info.aspx?bid="+Request.QueryString["bid"]);
        }
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        Response.Redirect("BBS_Info.aspx?bid=" + Request.QueryString["bid"]);
    }
}

⌨️ 快捷键说明

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