您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->MyShop网络商城源码(mvc开发)>>BLL/Cart.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:MyShop网络商城源码(mvc开发)


当前文件路径:MyShop/BLL/Cart.cs 文件类型
普通视图
		            
1using System; 2using System.Collections.Generic; 3using System.Data; 4//该源码下载自www.51aspx.com(51aspx.com) 5 6 7using MyShop.DALFactory; 8using MyShop.IDAL; 9using MyShop.Model; 10 11namespace MyShop.BLL 12{ 13 public class Cart 14 { 15 private ConfigInfo configInfo = new ConfigInfo(); 16 private string tableName = "Ljh_Cart"; 17 18 private ICart dal = DataAccess.CreateCart(); 19 public Cart() 20 { 21 Config config = new Config(); 22 configInfo = config.GetModel(); 23 24 if (!string.IsNullOrEmpty(configInfo.TablePrefix.Trim())) 25 tableName = configInfo.TablePrefix + "Cart"; 26 } 27 28 ICart member 89 90 common 299 300 301 /// <summary> 302 /// 更新当前会员的购物车的总价 303 /// 用于会员登录后,正常更新要用Add方法 304 /// </summary> 305 /// <param name="cartId"></param> 306 /// <param name="isMember">会员为true游客为false</param> 307 /// <returns></returns> 308 public bool Update(string cartId, bool isMember) 309 { 310 if (string.IsNullOrEmpty(cartId)) 311 return false; 312 CartInfo model = new CartInfo(); 313 Cart cart = new Cart(); 314 DataSet dataset = new DataSet(); 315 dataset = cart.GetDataSet(" cartId='" + cartId + "'"); 316 if (dataset.Tables[0].Rows.Count == 0) 317 return false; 318 foreach (DataRow d