ck/add_cg.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 仓库管理系统.ck
{
public partial class add_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();
//
}
protected void Button1_Click(object sender, EventArgs e)
{
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());
pub p = new pub();
DataTable dt = p.turn_pro(pro_id);
int c_id = int.Parse(dt.Rows[0]["c_id"].ToString());
string sql = "insert into cg(rq,dh,pro_id,sl,depot_id,c_id) values('" + rq + "','" + dh + "','" + pro_id + "','" + sl + "','" + depot_id + "','"+c_id+"')";
int s = db.ExecuteNonQuery(sql, CommandType.Text);
Response.Write("<script>alert('成功!');location='add_cg.aspx'</script>");
//
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
