public Banknote[] CashOut(CurrencyType c, uint v)
        {
            var result = _handler.CashOut(c, ref v);

            if (v > 0)
            {
                throw new Exception("Введена невалидная сумма");
            }

            return(result);
        }
示例#2
0
        public Dictionary <string, int> CashOut(int sum, string currency)
        {
            Dictionary <string, int> moneyToCashOut = new Dictionary <string, int>()
            {
                { "100$", 0 },
                { "50$", 0 },
                { "10$", 0 },
                { "10RUB", 0 }
            };

            return(_handler.CashOut(sum, currency, moneyToCashOut));
        }
示例#3
0
 public virtual Dictionary <string, int> CashOut(int sum, string currency, Dictionary <string, int> moneyToCashOut)
 {
     if (_nextHandler == null && sum != 0)
     {
         Console.WriteLine($"Осталось на балансе: { sum } {currency}");
         return(moneyToCashOut);
     }
     else if (_nextHandler == null)
     {
         return(moneyToCashOut);
     }
     else
     {
         return(_nextHandler.CashOut(sum, currency, moneyToCashOut));
     }
 }
示例#4
0
 public virtual bool CashOut(string sum, int deepth)
 {
     return(_nextHandler != null && _nextHandler.CashOut(sum, 0));
 }
示例#5
0
 public bool CashOut(string sum)
 {
     Console.Write(sum + " = ");
     return(_handler.CashOut(sum, 0));
 }
示例#6
0
 public virtual bool CashOut(int cash, CurrencyType currency)
 {
     return(_nextHandler != null && _nextHandler.CashOut(cash, currency));
 }
示例#7
0
 public bool CashOut(int cash, CurrencyType currency)
 {
     return(_handler.CashOut(cash, currency));
 }