ck/edit_cg.aspx.cs
(完整代码) 2KBusing 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 仓库管理系统.ck
{
public partial class edit_cg : System.Web.UI.Page
{
SQLHelper db = new SQLHelper();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
this.txt_rq.Attributes["onClick"] = "WdatePicker()";
}
}
//
public void bind()
{
string sql = "select * from product order by pro_id desc";//构造选出行业所有字段的SQL语句
DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
this.ddl_product.DataSource = dt;
this.ddl_product.DataTextField = "product";
this.ddl_product.DataValueField = "pro_id";
this.ddl_product.DataBind();
//
int id = int.Parse(Request.QueryString["id"].ToString());
string cx = "select * from cg where cg_id="+id;
DataTable d = db.ExecuteQuery(cx, CommandType.Text);
this.txt_dh.Text = d.Rows[0]["dh"].ToString();
this.txt_rq.Text = d.Rows[0]["rq"].ToString();
this.txt_sl.Text = d.Rows[0]["sl"].ToString();
this.ddl_product.Items.FindByValue(d.Rows[0]["pro_id"].ToString()).Selected = true;
//
}
//
protected void Button1_Click(object sender, EventArgs e)
{
int id = int.Parse(Request.QueryString["id"].ToString());
int depot_id = int.Parse(Session["depot_id"].ToString());
DateTime rq = Convert.ToDateTime(this.txt_rq.Text.ToString());
string dh = this.txt_dh.Text.ToString();
int sl = int.Parse(this.txt_sl.Text.ToString());
int pro_id = int.Parse(this.ddl_product.SelectedValue.ToString());
string sql = "update cg set rq='" + rq + "',dh='" + dh + "',pro_id='" + pro_id + "',sl='" + sl + "' where cg_id="+id;
int s = db.ExecuteNonQuery(sql, CommandType.Text);
Response.Write("<script>alert('成功!');location='cglist.aspx'</script>");
//
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
