internal Transaction(int amount, FinancialAccount from, FinancialAccount to, string description = "") { FromAccount = from; FromAccountID = from.accountID; ToAccount = to; ToAccountID = to.accountID; Amount = amount; Description = description; }
internal static bool MakeTransaction(Bank bank, int amount, FinancialAccount from, FinancialAccount to, string description = "") { if (from.currentMoney < amount || from == to) { return(false); } else { Transaction transaction = new Transaction(amount, from, to, description); AddTransactionToLedger(bank, transaction); return(true); } }