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

📄 addtocart.aspx.cs

📁 The purpose of this code is to assist developers get some good ideas for how to build a PayPal shop
💻 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;

public partial class AddToCart : System.Web.UI.Page
{
    private Invoice _selectedInvoice = new Invoice();
    public Invoice SelectedInvoice
    {
        get
        {
            if (_selectedInvoice.InvoiceId == "")
            {
                try
                {
                    _selectedInvoice = (Invoice)Session["Invoice"];
                }
                catch { }
            }
            return _selectedInvoice;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        int qty = 1; //default is 1 unless pass in another value

        if (Request["qty"] != null)
        {
            qty = int.Parse(Request["qty"].ToString());
        }
        if (Request["ProductId"] != null)
        {
            SelectedInvoice.AddToInvoice(int.Parse(Request["ProductId"].ToString()), qty);
        }
        Response.Redirect("ViewCart.aspx");
    }
}

⌨️ 快捷键说明

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