Пример #1
0
        public ActionResult TireCouponManage()
        {
            var dat      = ThirdShopManager.TireCouponManage();
            var ShopList = new List <string>
            {
                "自有平台",
                "途虎淘宝",
                "途虎淘宝2",
                "途虎天猫1",
                "途虎天猫2",
                "途虎天猫3",
                "途虎天猫4",
                "途虎京东2",
                "途虎京东旗舰"
            };
            var result = new List <TireCouponResultModel>();

            ShopList.ForEach(g =>
            {
                result.Add(dat.FirstOrDefault(t => t.ShopName == g) ?? new TireCouponResultModel
                {
                    ShopName = g
                });
            });
            return(View(result));
        }
Пример #2
0
        public JsonResult TireCouponList(string ShopName)
        {
            var data   = ThirdShopManager.TireCouponManage(ShopName).FirstOrDefault();
            var result = new List <TireCouponModel>();

            if (data != null)
            {
                result.AddRange(data.CouponA);
                result.AddRange(data.CouponB);
                result.AddRange(data.CouponC);
            }
            return(Json(result));
        }