Пример #1
0
        protected void shopping_Init(object sender, EventArgs e)
        {
            int group_id = 0;

            this.userModel = this.GetUserInfo();
            if (this.userModel == null)
            {
                if (this.orderConfig.anonymous == 0)
                {
                    HttpContext.Current.Response.Redirect(this.linkurl("login"));
                }
            }
            else
            {
                group_id = this.userModel.group_id;
            }
            if (string.IsNullOrEmpty(this.goodsJsonValue))
            {
                HttpContext.Current.Response.Redirect(this.linkurl("error", (object)("?msg=" + Utils.UrlEncode("对不起,无法获取您要购买的商品!"))));
            }
            else
            {
                try
                {
                    this.goodsList  = ShopCart.ToList(JsonHelper.JSONToObject <List <cart_keys> >(this.goodsJsonValue), group_id);
                    this.goodsTotal = ShopCart.GetTotal(this.goodsList);
                }
                catch
                {
                    HttpContext.Current.Response.Redirect(this.linkurl("error", (object)("?msg=" + Utils.UrlEncode("对不起,商品的传输参数有误!"))));
                }
            }
        }
Пример #2
0
        protected List <cart_items> get_cart_list()
        {
            int group_id = 0;

            Rain.Model.users userInfo = this.GetUserInfo();
            if (userInfo != null)
            {
                group_id = userInfo.group_id;
            }
            return(ShopCart.GetList(group_id) ?? new List <cart_items>());
        }
Пример #3
0
 public Rain.Model.users GetUserInfo()
 {
     if (this.IsUserLogin())
     {
         Rain.Model.users users = HttpContext.Current.Session["dt_session_user_info"] as Rain.Model.users;
         if (users != null)
         {
             return(new Rain.BLL.users().GetModel(users.id));
         }
     }
     return((Rain.Model.users)null);
 }