BookShop.Web/ShoppingCart.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using CTL.Common;

namespace BookShop.Web
{
    public partial class ShoppingCart : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Model.User userInfo = BookShopUtils.GetUserInfoByCookie();

            if (userInfo != null)
            {
                BookShop.ShoppingCart shoppingcartInfo = new BookShop.ShoppingCart(userInfo);

                txtQuantity.Text = shoppingcartInfo.Total.ToString();
                txtTotalPrice.Text = shoppingcartInfo.TotalPrice.ToString();

                if (shoppingcartInfo.UsableCartItemList.Count <= 0)
                {
                    errorMsg.Visible = true;
                    subitBtn.Enabled = false;
                    subitBtn.CssClass = "btn1";
                }
                else
                {
                    repeater.DataSource = shoppingcartInfo.UsableCartItemList;
                    repeater.DataBind();
                }
            }
            else
            {
                Response.Redirect("login.aspx?returnurl=" + Requests.GetRawUrl());
            }
        }
        /// <summary>
        /// 立即结算按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void subitBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect("ConfirmOrder.aspx");
        }
    }
}

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

AI 解读 AI

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

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