public ActionResult Coupon() { var coupons = _couponService.GetAllCoupons(customerId: this.CustomerId, used: false); ViewData["CouponListCount"] = coupons.TotalCount; return(PartialView()); }
public async Task <IActionResult> Index() { IndexViewModel model = new IndexViewModel() { Categories = (await categoryService.GetAllCategories()), MenuItems = (await menuItemService.GetAllMenuItems()), Coupons = (await couponService.GetAllCoupons()).Where(a => a.IsActive).ToList() }; var claimsIdentity = (ClaimsIdentity)this.User.Identity; var claim = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier); if (claim != null) { IEnumerable <ShoppingCart> shoppingCarts = await shoppingCartService.GetShoppingCartsByUserId(claim.Value); HttpContext.Session.SetInt32(SD.ssShoppingCartCount, shoppingCarts.ToList().Count); } return(View(model)); }
public ActionResult List(DataSourceRequest command, CouponListModel model) { var coupons = _couponService.GetAllCoupons( keywords: model.Keywords, used: model.Used, pageIndex: command.Page - 1, pageSize: command.PageSize); var jsonData = new DataSourceResult { Data = coupons.Items.Select(c => new { Id = c.Id, Name = c.Name, Effective = c.Effective.HasValue ? c.Effective.Value.ToString("yyyy-MM-dd") : "-- / --", Amount = c.Amount, Used = c.Used, CreationTime = c.CreationTime, }).ToList(), Total = coupons.TotalCount }; return(AbpJson(jsonData)); }
public async Task <IActionResult> Index() { return(View(await couponService.GetAllCoupons())); }
// GET: Coupons public async Task <IActionResult> Index() { var allCoupons = await _service.GetAllCoupons(); return(View(allCoupons)); }