admin/edit_yg.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;
using System.Data.SqlClient;
namespace 仓库管理系统.admin
{
public partial class edit_yg : System.Web.UI.Page
{
SQLHelper db = new SQLHelper();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
//
public void bind()
{
int id = int.Parse(Request.QueryString["id"].ToString());
string sql = "select * from yg where yg_id="+id;//构造选出行业所有字段的SQL语句
DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
this.txt_zh.Text = dt.Rows[0]["zh"].ToString();
this.txt_mima.Text = dt.Rows[0]["mima"].ToString();
this.txt_name.Text = dt.Rows[0]["name"].ToString();
this.txt_tel.Text = dt.Rows[0]["tel"].ToString();
this.rbt_sex.Items.FindByValue(dt.Rows[0]["sex"].ToString()).Selected = true;
}
protected void Button1_Click(object sender, EventArgs e)
{
int id = int.Parse(Request.QueryString["id"].ToString());
string zh = this.txt_zh.Text.ToString();
string mima = this.txt_mima.Text.ToString();
string sex = this.rbt_sex.SelectedValue.ToString();
string name = this.txt_name.Text.ToString();
string tel = this.txt_tel.Text.ToString();
string sql = "update yg set zh='" + zh + "',mima='" + mima + "',name='" + name + "',sex='" + sex + "',tel='" + tel + "' where yg_id="+id;
int d = db.ExecuteNonQuery(sql, CommandType.Text);
Response.Write("<script>alert('成功!');location='yglist.aspx'</script>");
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
