温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Asp.net2.0电子商务网源码
当前文件路径:AspNetDianZiShangWu/BLL/ShoppingCart.cs

1using System; 2
using System.Collections.Generic; 3
using System.Text; 4
using System.ComponentModel; 5
using Jiaen.Components; 6
using Jiaen.Components.IDAL; 7
using Jiaen.SQLServerDAL; 8
9
namespace Jiaen.BLL 10
{ 11
[DataObjectAttribute] 12
public class ShoppingCart 13
{ 14
private static readonly IShoppingCart carts = DataAccess.CreateShoppingCart(); 15
16
/// <summary> 17
/// 插入信息 18
/// </summary> 19
/// <param name="bookID"></param> 20
public static void InsertCart(int bookID) 21
{ 22
carts.InsertCart(bookID); 23
} 24
25
public static void UpdateCart(int bookID, int quantity, bool isTg) 26
{ 27
carts.UpdateCart(bookID, quantity, isTg); 28
} 29
30
31
/// <summary> 32
/// 验证用户 33
/// </summary> 34
/// <param name="anonymousId"></param> 35
/// <param name="userName"></param> 36
public static void AuthenticateCart(string anonymousId, string userName) 37
{ 38
carts.AuthenticateCart(anonymousId, userName); 39
} 40
41
/// <summary> 42
/// 删除购物车 43
/// </summary> 44
/// <param name="bookID"></param> 45
/// <returns></returns> 46
public static void DeleteCart(int bookID, bool isTg) 47
{ 48
carts.DeleteCart(bookID, isTg); 49
} 50
51
/// <summary> 52
/// 从session中获取 53
/// </summary> 54
/// <returns></returns> 55
public static IList<CartInfo> SelectCart() 56
{ 57
return carts.SelectCart(); 58
} 59
60
public static List<CartInfo> SelectTgCart() 61
{ 62
return carts.SelectTgCart(); 63
} 64
65
public static void InsertTgCart(int bookID) 66
{ 67
carts.InsertTgCart(bookID); 68
} 69
} 70
} 71




[DataObjectAttribute]

}