void InsertMoney <AdminMethod>(string nula, string username, string amount)
        {
            try
            {
                User    user             = GetUser(username);
                decimal _amount          = Convert.ToDecimal(amount);
                InsertCashTransaction tr = Stregsystem.AddCreditsToAccount(user, _amount);

                UI.DisplayUserInfo(user);
            }
            catch (UserNotFoundException e)
            {
                UI.DisplayUserNotFound(e.username);
            }
            catch (ArgumentNullException)
            {
                UI.DisplayUserNotFound(username);
            }
            catch (FormatException)
            {
                UI.DisplayQuantityMustBeANumber();
            }
            catch (OverflowException)
            {
                UI.DisplayQuantityMustBeANumber();
            }
            catch (Exception e)
            {
                UI.DisplayGeneralError(e.Message);
            }
        }
예제 #2
0
        public InsertCashTransaction AddCreditsToAccount(User user, decimal amount)
        {
            InsertCashTransaction tr = new InsertCashTransaction(user, amount);

            ExecuteTransaction(tr);
            return(tr);
        }