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

📄 zxjla.aspx.cs

📁 人才交流的页面 适合人才网的后台试用哦!!!
💻 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;
using System.Data.SqlClient;
using NetCMS.Config;
using NetCMS.Model;
using NetCMS.DALProfile;

namespace NetCMS.Web.manage.news
{
    public partial class zxjla : System.Web.UI.Page
    {
        public string FarthID = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
             qustionbind();
            }
        }
        void qustionbind()
        {
             string qid = Request.QueryString["qid"] == null ? "" : Request.QueryString["qid"].ToString();

                if(qid!="")
                {
                    FarthID = qid;
                    string qusql="select * from ds_news where id="+qid+"";
                    DataTable qidtable = DbHelper.ExecuteTable(DBConfig.CmsConString,CommandType.Text,qusql);
                    this.question.DataSource = qidtable;
                    this.question.DataBind();
                    string anssql = "select * from ds_news where From_ID=" + qid + " order by addtime desc";
                    DataTable anstable = DbHelper.ExecuteTable(DBConfig.CmsConString, CommandType.Text, anssql);
                    this.answer.DataSource = anstable;
                    this.answer.DataBind();
                }
                else
                {
                    Response.Write("<script>alert('参数错误!');history.back();</script>");
                }
        
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string qid = Request.QueryString["qid"] == null ? "" : Request.QueryString["qid"].ToString();
            string comment=Request.Form["Comment"]==null?"":Request.Form["Comment"].ToString();
            if (comment=="")
            {
                Response.Write("<script>alert('请输入回复内容!');history.back()</script>");
            }
            else
            {

                    string upsql = "update ds_news set Append_Cmt = '" + comment + "', flag=1 where id=" + qid;
                    int flag = DbHelper.ExecuteNonQuery(DBConfig.CmsConString, CommandType.Text, upsql);
                    if (flag > 0)
                    {
                        Response.Write("<script>alert('回复成功!');location.href='zxjlq.aspx';</script>");
                        qustionbind();
                    }
                    else
                    {

                        Response.Write("<script>alert('回复失败!');history.back();</script>");
                    }
                
            
            }
        }
    }

}

⌨️ 快捷键说明

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