checkout.aspx.cs

(开头部分) 5KB

这里只显示每个文件的开头 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;
using System.Collections;
namespace 电子商务
{
    public partial class checkout : System.Web.UI.Page
    {
        DataTable dtTable;
        Hashtable hashCar;
        SQLHelper db = new SQLHelper();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["zh"] == null)
                {
                    Response.Write("<script lanuage=javascript>alert('该页必须登录后才能进行操作');location='index.aspx'</script>");
                }
                else
                {
                    bind();
                }
            }
           //
        }
        //
        //
        public void bind()
        {
            //
            //先加载会员信息
            string query = "select * from hy where username='" + Session["zh"].ToString() + "'";
            DataTable dt1 = db.ExecuteQuery(query, CommandType.Text);
            this.txt_address.Text = dt1.Rows[0]["address"].ToString();
            this.txt_email.Text = dt1.Rows[0]["email"].ToString();
            this.txt_name.Text = dt1.Rows[0]["name"].ToString();
            this.txt_phone.Text = dt1.Rows[0]["phone"].ToString();
            //
            //
            hashCar = (Hashtable)Session["ShopCart"];  //获取其购物车
            dtTable = new DataTable();
            DataColumn column1 = new DataColumn("No");
            DataColumn column2 = new DataColumn("pro_id");    //商品ID代号
            DataColumn column3 = new DataColumn("name");  //商品名称
            DataColumn column4 = new DataColumn("Num");       //数量
            DataColumn column5 = new DataColumn("price");     //单价
            DataColumn column6 = new DataColumn("total_price");     //单价
            dtTable.Columns.Add(column1);  //添加新列            
            dtTable.Columns.Add(column2);
            dtTable.Columns.Add(column3);
            dtTable.Columns.Add(column4);
            dtTable.Columns.Add(column5);
            dtTable.Columns.Add(column6);
            DataRow row;
后面还有 62 行代码,购买后查看完整代码

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

AI 解读 AI

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

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