ck/cglist.aspx.cs

(完整代码) 1KB

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 cglist : System.Web.UI.Page
    {
        SQLHelper db = new SQLHelper();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bind();
            }
        }
        //
        public string bind_pro(int id)
        {
            string sql = "select * from product where pro_id=" + id;
            DataTable d = db.ExecuteQuery(sql, CommandType.Text);
            return d.Rows[0]["product"].ToString();
        }
        //
        public string bind_depot(int id)
        {
            pub p = new pub();
            return p.turn_depot(id);
        }
        //
        //
        public void bind()
        {
            int depot_id = int.Parse(Session["depot_id"].ToString());
            string sql = "select * from cg where depot_id="+depot_id+" order by cg_id desc";//构造选出行业所有字段的SQL语句
            DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
            this.gv.DataSource = dt;
            this.gv.DataBind();
        }

        protected void gv_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int id = Convert.ToInt32(this.gv.DataKeys[e.RowIndex].Value.ToString());
            string sql = "delete from cg where cg_id=" + id;
            int r = db.ExecuteNonQuery(sql, CommandType.Text);
            bind();
        }

        protected void gv_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            this.gv.PageIndex = e.NewPageIndex;
            bind();
        }
        //
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。