public async Task <IActionResult> Index() { var basket = await _basketservice.GetBasketItems(Request); foreach (var item in basket.CartItems) { item.Product.PriceModel = await _priceCalculator.CalculateBookPrice(item.Product.P_Id, _lang.GetLang()); } ViewBag.CVRT = 1000; ViewBag.BINPERC = 1; var cvrtbase = ((List <OptionsModel>)(await _optionrepository.GetAll()).Data).FirstOrDefault(x => x.O_Key == "CVRTTOMANTOPOINT"); var bin = ((List <OptionsModel>)(await _optionrepository.GetAll()).Data).FirstOrDefault(x => x.O_Key == "GIFTBINPERCENTAGE"); if (bin != null) { ViewBag.BINPERC = int.Parse(bin.O_Value); } if (cvrtbase != null) { ViewBag.CVRT = int.Parse(cvrtbase.O_Value); } ViewBag.LoggedIn = TokenService.AuthorizeUser(Request) > 0; ViewBag.User = await _userrepository.GetById(TokenService.AuthorizeUser(Request)); return(View(basket)); }
public async Task <IActionResult> Index() { var basket = await _basketservice.GetBasketItems(Request); ViewBag.LoggedIn = TokenService.AuthorizeUser(Request) > 0; ViewBag.User = await _userrepository.GetById(TokenService.AuthorizeUser(Request)); return(View(basket)); }
public async Task <IActionResult> PaymentSuccess(string code)//step 4 { var basket = await _basketservice.GetBasketItems(Request); ViewBag.LoggedIn = TokenService.AuthorizeUser(Request) > 0; ViewBag.User = await _userrepository.GetById(TokenService.AuthorizeUser(Request)); ViewBag.Code = code; return(View()); }