public async Task <ActionResult> Index(int?type, int?id) { var types = await PromoInfoService.GetAllType(); if (!types.HasError) { ViewBag.PromoTypes = types.Data; } var result2 = await PromoInfoService.GetList(null, 0, 20); if (!result2.HasError) { ViewBag.PromoList = result2.Data.list; } var promoImages = await NewsService.GetAds("yc_promo_images_1", 10, 0); if (!promoImages.HasError) { if (promoImages.Data != null && promoImages.Data.count > 0) { ViewBag.Images = promoImages.Data.list; } } var seo = await NewsService.GetSEO("promo"); if (!seo.HasError) { ViewBag.SEO = seo.Data; } return(View()); }
public async Task <ActionResult> GetList(int?type, Int32?pageIndex, Int32?pageSize) { int pIndex = pageIndex.GetValueOrDefault(0); int pSize = pageSize.GetValueOrDefault(10); var result = await PromoInfoService.GetList(type, pIndex, pSize); if (result.HasError) { return(this.JsonError(result.ErrorMessage)); } return(this.JsonOK("", result.Data)); }