Exemple #1
0
        public JsonResult AddWish(PurchaseHomeTotalInfo purchaseHomeTotalInfo)
        {
            Session.Remove("ReturnToWishList");
            string mem_phone = Session["mem_phone"].ToString();
            int    goods_id  = purchaseHomeTotalInfo.wish_goods_id;

            ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
            if (memberPurchase.addWishList(mem_phone, goods_id))
            {
            }
            else
            {
                memberPurchase.deleteWishList(mem_phone, goods_id);
            }
            /*memberPurchase.addWishList(mem_phone, goods_id);*/
            return(Json("心愿单更新成功"));
        }
Exemple #2
0
        public ActionResult Index(int DeleteWishId)
        {
            Session.Remove("ReturnToWishList");
            string mem_phone = Session["mem_phone"].ToString();
            int    goods_id  = DeleteWishId;

            ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
            memberPurchase.deleteWishList(mem_phone, goods_id);
            var wish_list = memberPurchase.getWishLists(Session["mem_phone"].ToString()).Select(wish_info => new MemberWishListViewModel()
            {
                goods_id         = wish_info.goods_id,
                goods_name       = memberPurchase.getGoods(wish_info.goods_id).goods_name,
                goods_unit_price = memberPurchase.getGoods(wish_info.goods_id).goods_price,
                goods_img_path   = memberPurchase.getGoods(wish_info.goods_id).goods_img_path,
            }).ToList();
            var resView = new MemberWishListViewModel()
            {
                mem_phone  = Session["mem_phone"].ToString(),
                wish_lists = wish_list,
            };

            return(PartialView("WishListPart1", resView));
        }