📄 zxjla.aspx.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 + -