예제 #1
0
파일: shopping.cs 프로젝트: Hcq/Rain
        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
파일: BaseMasterPage.cs 프로젝트: Hcq/Rain
        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
파일: BaseMasterPage.cs 프로젝트: Hcq/Rain
 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);
 }