jiankangfuwu/wentiList.aspx.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class wentiList : System.Web.UI.Page
{
public DataTable tb1=null;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable tb = DbSQL.GetQuery("select a.id,case when a.huifu IS null then '暂无回答' else a.huifu end as huifu,a.wenti,a.shijian,b.znxingming from wenti a left join zinv b on a.znID=b.znID order by shijian desc");
this.Repeater1.DataSource = tb;
this.Repeater1.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (this.wenti.Text == "")
{
MessageBox.Show(this, "问题内容不能为空");
return;
}
if (Session["id"] == null)//验证是否已经登录
{
MessageBox.Show(this, "提问请先登录");
return;
}
string znID = Session["id"].ToString();
string wenti = this.wenti.Text;
//执行问题的插入
string strsql2 = "Insert into wenti(znID,shijian,wenti)values(";
strsql2 += " " + znID + ",'" + DateTime.Now.ToString("yyyy-MM-dd") + "','" + wenti + "')";
int n = DbSQL.zhixing(strsql2);
if (n > 0)
{
MessageBox.ShowAndRedirect(this, "问题提交成功", "wentiList.aspx");
}
else
{
MessageBox.Show(this, "问题提交失败");
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。