An abstract class that represents an account. There are five concrete account types - Assets, Liabilities, Expenses, Revenue and Equity.
Inheritance: AccountingDomainObject, IComparable
Ejemplo n.º 1
0
 public LedgerTransaction(Transaction wrappedTransaction, Account ownerAccount, Workbook workbook)
 {
     _wrappedTransaction = wrappedTransaction;
     _ownerAccount = ownerAccount;
     _workbook = workbook;
     _wrappedTransaction.PropertyChanged += new PropertyChangedEventHandler(WrappedTransaction_PropertyChanged);
 }
Ejemplo n.º 2
0
 public LedgerTransaction(Transaction wrappedTransaction, ChangeCoordinator<Transaction> changeCoordinator, Account ownerAccount, Workbook workbook)
 {
     _wrappedTransaction = wrappedTransaction;
     _ownerAccount = ownerAccount;
     _workbook = workbook;
     _changeCoordinator = changeCoordinator;
     _wrappedTransaction.PropertyChanged += new PropertyChangedEventHandler(WrappedTransaction_PropertyChanged);
     _changeCoordinator.EditableItem.PropertyChanged += new PropertyChangedEventHandler(WrappedTransaction_PropertyChanged);
 }
        /// <summary>
        /// Private constructor.
        /// </summary>
        /// <param name="workbook">The workbook that this ledger window uses.</param>
        /// <param name="account">The account to display in the window.</param>
        private AccountLedgerWindow(Account account)
        {
            InitializeComponent();
            this.EnableWindowDragging();
            this.EnableGlass(new Thickness(7, 70, 7, 7));

            this.Account = account;

            this.Loaded += new RoutedEventHandler(AccountLedgerWindow_Loaded);
        }
 /// <summary>
 /// A static method to show the window. 
 /// </summary>
 /// <param name="account">The account to edit.</param>
 /// <returns>The newly created ledger window.</returns>
 public static AccountLedgerWindow Show(Account account)
 {
     AccountLedgerWindow result = null;
     if (_openWindows.ContainsKey(account)) {
         result = _openWindows[account];
         result.Activate();
     } else {
         result = new AccountLedgerWindow(account);
         result.Closed += new EventHandler(Window_Closed);
         result.Show();
         _openWindows[account] = result;
     }
     return result;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Deletes a given account.
 /// </summary>
 /// <param name="account">The account to delete.</param>
 public abstract void DeleteAccount(Account account);
Ejemplo n.º 6
0
 /// <summary>
 /// Loads all transactions for the current business from the data source that were applied to a given account.
 /// </summary>
 /// <param name="workbook">
 /// The workbook used to associate the loaded transactions with.
 /// </param>
 /// <param name="account">The account that will be used to search for transactions.</param>
 /// <returns>The loaded transactions.</returns>
 public abstract TransactionCollection FetchTransactions(Workbook workbook, Account account);
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="account">The account to create.</param>
 public AccountEventArgs(Account account)
 {
     _account = account;
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="workbook">The workbook to search for the name.</param>
 /// <param name="account">The account to validate.</param>
 public UniqueAccountNameRule(Workbook workbook, Account account)
     : base("Name", "Account names must be unique.")
 {
     _workbook = workbook;
     _account = account;
 }