⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cargo_list1.aspx.cs

📁 一个很好的物流管理系统网站!
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class Cargo_list1 : System.Web.UI.Page
{
    //该源码下载自www.51aspx.com(51aspx.com)

    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);
        strcon.Open();
        SqlDataAdapter sda = new SqlDataAdapter("select * from tb_Cargo order by id desc",strcon);
        DataSet ds = new DataSet();
        sda.Fill(ds, "tb_Cargo");
        this.GridView1.DataSource = ds.Tables["tb_Cargo"];
        this.GridView1.DataKeyNames = new string[] { "id" };
        this.GridView1.DataBind();
    }
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {

    }
    protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        string id = this.GridView1.DataKeys[e.NewSelectedIndex].Value.ToString();
        Response.Write(id);
        if (Session["bus"] == null)
        {
            System.Collections.Hashtable ht = new Hashtable();

            ht.Add(id, 1);
            Session["bus"] = ht;
            //				Session.Add("bus",ht);
        }

        else
        {
            System.Collections.Hashtable ht = (Hashtable)Session["bus"];
            if (ht[id] == null)
            {
                ht[id] = 1;
            }
            else
            {
                ht[id] = (int)ht[id] + 1;
            }
            Session["bus"] = ht;
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Write(Request["Checkbox1"]);
    }

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
    }
    protected void Button1_Click1(object sender, EventArgs e)
    {
        this.DataList1.DataSource =(Hashtable)Session["bus"];
        this.DataList1.DataBind();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
       
    }
    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {

    }
    protected void Button3_Click(object sender, EventArgs e)
    {


    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -