edit_drug.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 淮安协和门诊
{
public partial class edit_drug : 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 drug where drug_id=" + id;
DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
this.txt_drug.Text = dt.Rows[0]["drug"].ToString();
this.txt_price.Text = dt.Rows[0]["price"].ToString();
this.txt_sl.Text = dt.Rows[0]["price"].ToString();
}
//
protected void Button1_Click(object sender, EventArgs e)
{
int id = int.Parse(Request.QueryString["id"].ToString());
string drug = this.txt_drug.Text.ToString();
int sl =int.Parse(this.txt_sl.Text.ToString());
int price = int.Parse(this.txt_price.Text.ToString());
string sql = "update drug set drug='"+drug+"',sl='"+sl+"',price='"+price+"' where drug_id="+id;
int d = db.ExecuteNonQuery(sql, CommandType.Text);
Response.Write("<script>alert('成功!');location='manage_drug.aspx'</script>");
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。