public async Task <ActionResult> FeaturedCurrencySlot() { var item = await PaytopiaReader.GetItem(PaytopiaItemType.FeaturedCurrency); var items = await PaytopiaReader.GetFeaturedCurrencySlotItems(); var balance = await UserBalanceReader.GetBalance(User.Identity.GetUserId(), item.CurrencyId); return(View("FeaturedCurrencySlotModal", new FeaturedSlotModel { Items = items, Balance = balance?.Available ?? 0, Currency = item.Symbol, Price = item.Price, Name = item.Name, Description = item.Description })); }
public async Task <ActionResult> FeaturedCurrencySlot(FeaturedSlotModel model) { if (!ModelState.IsValid) { model.Items = await PaytopiaReader.GetFeaturedCurrencySlotItems(); return(View("FeaturedCurrencySlotModal", model)); } var result = await PaytopiaWriter.UpdateFeaturedCurrencySlot(User.Identity.GetUserId(), model); if (!ModelState.IsWriterResultValid(result)) { model.Items = await PaytopiaReader.GetFeaturedCurrencySlotItems(); return(View("FeaturedCurrencySlotModal", model)); } return(CloseModal(result)); }