ck/edit_ck.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 System.Data;
using System.Data.SqlClient;
namespace 仓库管理系统.ck
{
public partial class edit_ck : 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 ck where ck_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());
//计算本仓库该商品的库存量
pub p = new pub();
int total = p.pro_total(pro_id, depot_id);
//
if (total >=sl)//如果库存总量大于出库数量
{
string sql = "update ck set rq='" + rq + "',dh='" + dh + "',pro_id='" + pro_id + "',sl='" + sl + "' where ck_id=" + id;
int s = db.ExecuteNonQuery(sql, CommandType.Text);
Response.Write("<script>alert('成功!');location='cklist.aspx'</script>");
}
else
后面还有 7 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
