Ejemplo n.º 1
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     id = HotoRequest.GetQueryInt("id");
     Hoto.BLL.article bll = new Hoto.BLL.article();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetGoodsModel(id);
     //浏览数+1
     bll.UpdateField(id, "click=click+1");
     //跳转URL
     if (model.link_url != null)
         model.link_url = model.link_url.Trim();
     if (!string.IsNullOrEmpty(model.link_url))
     {
         HttpContext.Current.Response.Redirect(model.link_url);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得购物车列表
        /// </summary>
        public static IList <Hoto.Model.cart_items> GetList(int group_id)
        {
            IDictionary <string, int> dic = GetCart();

            if (dic != null)
            {
                IList <Hoto.Model.cart_items> iList = new List <Hoto.Model.cart_items>();

                foreach (var item in dic)
                {
                    Hoto.BLL.article         bll   = new Hoto.BLL.article();
                    Hoto.Model.article_goods model = bll.GetGoodsModel(Convert.ToInt32(item.Key));
                    if (model == null)
                    {
                        continue;
                    }
                    Hoto.Model.cart_items modelt = new Hoto.Model.cart_items();
                    modelt.id             = model.id;
                    modelt.title          = model.title;
                    modelt.img_url        = model.img_url;
                    modelt.point          = model.point;
                    modelt.price          = model.sell_price;
                    modelt.user_price     = model.sell_price;
                    modelt.stock_quantity = model.stock_quantity;
                    //会员价格
                    if (model.goods_group_prices != null)
                    {
                        Hoto.Model.goods_group_price gmodel = model.goods_group_prices.Find(p => p.group_id == group_id);
                        if (gmodel != null)
                        {
                            modelt.user_price = gmodel.price;
                        }
                    }
                    modelt.quantity = item.Value;
                    iList.Add(modelt);
                }
                return(iList);
            }
            return(null);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     id = HotoRequest.GetQueryInt("id");
     Hoto.BLL.article bll = new Hoto.BLL.article();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetGoodsModel(id);
     //浏览数+1
     bll.UpdateField(id, "click=click+1");
     //跳转URL
     if (model.link_url != null)
     {
         model.link_url = model.link_url.Trim();
     }
     if (!string.IsNullOrEmpty(model.link_url))
     {
         HttpContext.Current.Response.Redirect(model.link_url);
     }
 }