Backup/WEB/UpdateStudent.aspx.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;
namespace WEB
{
public partial class UpdateStudent : System.Web.UI.Page
{
private GradeBll gradeBll = new GradeBll();
private StuBll stuBll = new StuBll();
private TeacherBll teacherBll = new TeacherBll();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)//首次加载
{
// string stuID = string.Empty;
if (Request.QueryString["stuId"] != null)
{
int stuId = int.Parse(Request.QueryString["stuId"]);
List<Model.StuInfo> stuInfo = stuBll.GetStuInfoByID(stuId);
foreach (var i in stuInfo)
{
this.txtNmae.Text = i.stuName;
this.txtPwd.Text = i.stuPwd;
}
this.btnAdd.Visible = false;
}
else
{
this.btnUpdate.Visible = false;
}
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
Model.StuInfo s = new StuInfo();
s.stuName = this.txtNmae.Text;
s.stuPwd = this.txtPwd.Text;
int stuId = int.Parse(Request.QueryString["stuId"]);
s.stuId = stuId;
bool result = stuBll.UpdateStuInfo(s);
if (result == true)
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "update", "<script language='javascript' type='text/javascript'>alert('修改成功!');window.opener.location.href=window.opener.location.href;window.close();</script>");
}
else
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "update", "<script language='javascript' type='text/javascript'>alert('修改成功!');</script>");
}
}
后面还有 18 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。