public void OnGet() { UserId = User.FindFirstValue(ClaimTypes.NameIdentifier); SodaPrice = _sodaMachine.GetSodaPrice(); DepositedAmount = _sodaMachine.GetMoneyInsertedTotal(UserId); SodaOptions = _sodaMachine.ListTypesOfSoda(); }
private static void CancelTransaction() { var moneyInserted = _sodaMachine.GetMoneyInsertedTotal(userId); _sodaMachine.IssueFullRefund(userId); Console.Clear(); Console.WriteLine($"You have been refunded {string.Format("{0:$ #.00}", moneyInserted)}"); Message(); }
private static void CancelTransaction() { var amountDposited = _sodaMachine.GetMoneyInsertedTotal(userId); _sodaMachine.IssueFullRefund(userId); Console.Clear(); Console.WriteLine($"Transaction Canceled. Refunded { String.Format("{0:C}", amountDposited) }."); Console.WriteLine("Press enter to continue..."); Console.ReadLine(); }
public IActionResult OnGet() { UserId = User.FindFirstValue(ClaimTypes.NameIdentifier); AcceptedCoinsValue = _sodaMachineLogic.AcceptedCoinValues; SodaPrice = _sodaMachineLogic.GetSodaPrice(); SodasInStock = _sodaMachineLogic.GetSodaInventory(); TypesOfSoda = _sodaMachineLogic.ListTypesOfSoda(); UserCredit = _sodaMachineLogic.GetMoneyInsertedTotal(UserId); SodaSelectList = SodasInStock.Select((sodaModel, index) => { return(new SelectListItem($"{sodaModel.Name} {sodaModel.SlotOccupied}", index.ToString())); }).ToList(); return(Page()); }