ShoppingCart.aspx.cs

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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;

public partial class ProductInfo : System.Web.UI.Page
{
    int ischeckorder = 0;
    decimal t1 = 0, t2 = 0, t3 = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["ischeckorder"]))
            ischeckorder = int.Parse(Request.QueryString["ischeckorder"]);
        if (!this.IsPostBack)
        {
            this.BindData();
        }
    }

    #region 方法:获取数据
    /// <summary>
    /// 获取数据
    /// </summary>
    private void BindData()
    {
        if (Request.Cookies["ShoppingCart"] != null && !string.IsNullOrEmpty(Request.Cookies["ShoppingCart"]["ProductId"]) && !string.IsNullOrEmpty(Request.Cookies["ShoppingCart"]["BuyNumber"]))
        {
            string expcon = "ProductId in(" + Request.Cookies["ShoppingCart"]["ProductId"] + ")";
            
            if (ischeckorder == 0)
            {
                Panel1.Visible = true;
                Panel2.Visible = false;
                this.gvGridView.DataSource = DB.getDataTable("select * from product where " + expcon + " order by ProductId desc");
                this.gvGridView.DataBind();
            }
            else
            {
                Panel1.Visible = false;
                Panel2.Visible = true;
                this.gvGridView2.DataSource = DB.getDataTable("select * from product where " + expcon + " order by ProductId desc");
                this.gvGridView2.DataBind();
            }
        }
        else
        {
            if (ischeckorder == 0)
            {
                Panel1.Visible = true;
                Panel2.Visible = false;
                btnClearCart.Enabled = false;
                btnCheckOrder.Enabled = false;
                this.gvGridView.DataSource = DB.getDataTable("select * from product where 1>1 order by ProductId desc");
                this.gvGridView.DataBind();
后面还有 256 行代码,购买后查看完整代码

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

AI 解读 AI

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

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