Admin/ggEdit.aspx.cs
(完整代码) 1KBusing 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 Admin_ggEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DataTable dt = new DataTable();
if (Request.QueryString["ID"] != null)
{
//显示当前的班级公告
this.TextBox1.ReadOnly = true;
dt = db.GetData("select * from 班级公告 where 公告代码='" + Request.QueryString["ID"] + "'");
if (dt.Rows.Count > 0)
{
this.TextBox1.Text = dt.Rows[0]["公告主题"].ToString();
this.TextBox3.Text = dt.Rows[0]["公告内容"].ToString();
this.TextBox2.Text = dt.Rows[0]["公告时间"].ToString();
}
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
//跳转页面
Response.Redirect("Ggxx.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
//根据标志 添加或修改公告信息 跳转页面
if (Request.QueryString["ID"] != null)
{
db.Execute("update 班级公告 set 公告主题='" + TextBox1.Text + "',公告内容='" + TextBox3.Text + "',公告时间='" + TextBox2.Text + "' where 公告代码='" + Request.QueryString["ID"] + "'");
}
else
{
db.Execute("insert into 班级公告(公告主题,公告内容,公告时间) values('" + this.TextBox1.Text + "','" + TextBox3.Text + "','" + TextBox2.Text + "')");
}
Response.Redirect("Ggxx.aspx");
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。