zoukankan      html  css  js  c++  java
  • 购物车购物

      if (Session["Pro"] == null)
                {
                    DataTable dt = new DataTable();
                    dt.Columns.Add("_id", typeof(int));//商品id
                    dt.Columns.Add("_title", typeof(string));//商品名
                    dt.Columns.Add("_color", typeof(string));//商品颜色
                    dt.Columns.Add("_sizename", typeof(String));//商品尺码
                    dt.Columns.Add("_catename", typeof(String));//商品类别
                    dt.Columns.Add("_imageurl", typeof(String));//商品类别


                    DataRow dr = dt.NewRow();
                    dr["_id"] = _id.Text;
                    dr["_title"] = title_l.Text;
                    dr["_color"] = d_color.Text;
                    dr["_sizename"] = _SizeOne.Text;
                    dr["_catename"] = _Cate.Text;
                    dr["_imageurl"] = Image_1.ImageUrl;
                    dt.Rows.Add(dr);

                    Session["Pro"] = dt;
                    Response.Redirect("shoplist.aspx");
                    Response.End();
                }
                else
                {
                    //datatable是在第一条数据上累加的
                    DataTable dt = Session["Pro"] as DataTable;
                    DataRow dr = dt.NewRow();
                    dr["_id"] = _id.Text;
                    dr["_title"] = title_l.Text;
                    dr["_color"] = d_color.Text;
                    dr["_sizename"] = _SizeOne.Text;
                    dr["_catename"] = _Cate.Text;
                    dr["_imageurl"] = Image_1.ImageUrl;
                    dt.Rows.Add(dr);

                    Session["Pro"] = dt;
                    Response.Redirect("shoplist.aspx");
                    Response.End();
                }

  • 相关阅读:
    506Relative Ranks(LeetCode)
    计算二进制中1的个数
    vector<vector<int>> 简单知识介绍
    167. Two Sum II
    561. Array Partition I(LeetCode)
    sizeof 用法部分总结
    530. Minimum Absolute Difference in BST(LeetCode)
    JS计算两个日期之间的天数
    路演会上会登记结论的委员信息页面
    eclipse安装SVN插件
  • 原文地址:https://www.cnblogs.com/G-XiaoHua/p/4832243.html
Copyright © 2011-2022 走看看