YKT_EShop/Controls/getShoppingCart.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.UI.HtmlControls;
using YKT_Common;
using YKT_Model;
using YKT_BLL;
namespace YKT_EShop.Controls
{
public partial class getShoppingCart : BasicControl
{
protected GridView gvProducts;
protected void Page_Load(object sender, EventArgs e)
{
//检查用户登录
if (!this.IsPostBack)
{
int proid = Input.SetInt(Request.QueryString["pid"]);
string action = Input.SetString(Request.Params["act"]);
switch (action.Trim().ToLower())
{
case "edit":
Bind_CartEdit(proid);
break;
case "del":
Bind_CartDel(proid);
break;
default:
Bind_AddToCart(proid);
break;
}
}
}
////添加到购物车
private void Bind_AddToCart(int pid)
{
if (pid < 1)
{
return;
}
DataTable dtProducts = null;
if (Session["dtProducts"] == null)
{
dtProducts = createProductDT();
//开始添加购物
ModelProduct model = new BLLProduct().GetModel(pid, true);
DataRow aProduct = dtProducts.NewRow();
aProduct["proid"] = pid;
aProduct["prototalprice"] = (Input.SetInt(model.ProductMarketPrice) * 1);//市场价
aProduct["proname"] = model.ProductName;
aProduct["proprice"] = model.ProductMarketPrice;//产品价格
aProduct["quantity"] = 1;//产品数量
dtProducts.Rows.Add(aProduct);
后面还有 130 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。