Ejemplo n.º 1
0
        /// <summary>
        /// 礼品详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult GiftDetails(int id)
        {
            var gift = GiftBll.LoadEntities(g => g.Id == id).FirstOrDefault();

            ViewData.Model = gift as Gift;
            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult ConfirmGiftOrder()
        {
            string guid = Request["userId"];
            //从分布式缓存拿出来的对象不能进行延迟加载。
            var    user         = Common.CacheHelper.Get(guid) as PersonalUser;
            int    giftId       = int.Parse(Request["giftId"]);
            string currentColor = Request["color"];
            int    num          = int.Parse(Request["num"]);
            var    gift         = GiftBll.LoadEntities(g => g.Id == giftId).FirstOrDefault();

            ViewData.Model = gift as Gift;
            //总价格
            ViewBag.TotalPrice = (float)gift.Price * num;
            //索要的数量
            ViewBag.Num   = num;
            ViewBag.Color = currentColor;
            return(View());
        }