public IActionResult OnPostEjectMoneyInserted()
        {
            UserId = User.FindFirstValue(ClaimTypes.NameIdentifier);

            ChangeReturned = _sodaMachineLogic.IssueFullRefund(UserId);

            return(OnGet());
        }
Пример #2
0
        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();
        }
Пример #3
0
        // Used for canceling our deposit
        public IActionResult OnPostCancel()
        {
            UserId = User.FindFirstValue(ClaimTypes.NameIdentifier);

            DepositedAmount = _sodaMachine.GetMoneyInsertedTotal(UserId);
            _sodaMachine.IssueFullRefund(UserId);

            OutputText = $"You have been refunded { string.Format("{0:C}", DepositedAmount) }";

            return(RedirectToPage(new { OutputText }));
        }
Пример #4
0
        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();
        }