C# Class PaulStovell.TrialBalance.DomainModel.PackageDataProvider.PackageDataProvider

A data provider for dealing with zip packages.
Inheritance: DataProvider
Afficher le fichier Open project: PaulStovell/trial-balance Class Usage Examples

Méthodes publiques

Méthode Description
CreateFile ( string filePath ) : PackageDataProvider

Creates a new TrialBalance data package at a given location.

DeleteAccount ( Account account ) : void

Deletes a given account.

DeleteTransaction ( Transaction transaction ) : void

Deletes a given transaction from the data source.

FetchAccount ( System.Guid accountID ) : Account

Retrieves an account from the data store.

FetchAccountIDs ( ) : IList

Retrieves a list of the ID's of all accounts in the data store.

FetchAsset ( System.Guid assetID ) : Asset

Retrieves an asset for the current business from the data store.

FetchAssetIDs ( ) : IList

Retrieves all assets for the current business from the data store.

FetchEquity ( System.Guid equityID ) : Equity

Retrieves an equity account for the current business from the data store given the unique identifier for the equity.

FetchEquityIDs ( ) : IList

Retrieves all equity accounts for the current business from the data store.

FetchExpense ( System.Guid expenseID ) : Expense

Retrieves an expense account for the current business from the data store given the unique identifier for the expense.

FetchExpenseIDs ( ) : IList

Retrieves all expense accounts for the current business from the data store.

FetchLiability ( System.Guid liabilityID ) : Liability

Retrieves a liability for the current business from the data store given the unique identifier for the liability.

FetchLiabilityIDs ( ) : IList

Retrieves all liabilities for the current business from the data store.

FetchRevenue ( System.Guid revenueID ) : Revenue

Retrieves a revenue account for the current business from the data store given the unique identifier for the revenue.

FetchRevenueIDs ( ) : IList

Retrieves all revenue accounts for the current business from the data store.

FetchSetting ( string name ) : string

Retrieves a given setting from the data source.

FetchTransactions ( Workbook workbook, Account account ) : TransactionCollection

Loads all transactions for the current business from the data source that were applied to a given account.

OpenFile ( string filePath ) : PackageDataProvider

Opens a TrialBalance data package from a given location.

PersistAsset ( Asset asset ) : void

Saves a given asset.

PersistEquity ( Equity equity ) : void

Saves an equity account to the data store.

PersistExpense ( Expense expense ) : void

Saves an expense account to the data store.

PersistLiability ( Liability liability ) : void

Saves a liability account to the data store.

PersistRevenue ( Revenue revenue ) : void

Saves a revenue account to the data store.

PersistSetting ( string name, string value ) : void

Saves a given setting.

PersistTransaction ( Transaction transaction ) : void

Saves a given transaction to the data store.

Méthodes protégées

Méthode Description
PackageDataProvider ( string filePath ) : System

Constructor.

Private Methods

Méthode Description
ReadAccount ( System.Guid accountId ) : Account
ReadIndex ( AccountType accountType ) : List
ReadSettings ( ) : string>.Dictionary
ReadTransactions ( Workbook workbook, Account account ) : List
SaveAccount ( Account account ) : void
SaveIndex ( List indexItems, AccountType accountType ) : void
SaveSettings ( string>.Dictionary settings ) : void
SaveTransactions ( List transactions ) : void

Method Details

CreateFile() public static méthode

Creates a new TrialBalance data package at a given location.
public static CreateFile ( string filePath ) : PackageDataProvider
filePath string The location where the data package should be stored.
Résultat PackageDataProvider

DeleteAccount() public méthode

Deletes a given account.
public DeleteAccount ( Account account ) : void
account Account The account to delete.
Résultat void

DeleteTransaction() public méthode

Deletes a given transaction from the data source.
public DeleteTransaction ( Transaction transaction ) : void
transaction Transaction The transaction to delete.
Résultat void

FetchAccount() public méthode

Retrieves an account from the data store.
public FetchAccount ( System.Guid accountID ) : Account
accountID System.Guid The ID of the account.
Résultat Account

FetchAccountIDs() public méthode

Retrieves a list of the ID's of all accounts in the data store.
public FetchAccountIDs ( ) : IList
Résultat IList

FetchAsset() public méthode

Retrieves an asset for the current business from the data store.
public FetchAsset ( System.Guid assetID ) : Asset
assetID System.Guid
Résultat Asset

FetchAssetIDs() public méthode

Retrieves all assets for the current business from the data store.
public FetchAssetIDs ( ) : IList
Résultat IList

FetchEquity() public méthode

Retrieves an equity account for the current business from the data store given the unique identifier for the equity.
public FetchEquity ( System.Guid equityID ) : Equity
equityID System.Guid
Résultat Equity

FetchEquityIDs() public méthode

Retrieves all equity accounts for the current business from the data store.
public FetchEquityIDs ( ) : IList
Résultat IList

FetchExpense() public méthode

Retrieves an expense account for the current business from the data store given the unique identifier for the expense.
public FetchExpense ( System.Guid expenseID ) : Expense
expenseID System.Guid
Résultat Expense

FetchExpenseIDs() public méthode

Retrieves all expense accounts for the current business from the data store.
public FetchExpenseIDs ( ) : IList
Résultat IList

FetchLiability() public méthode

Retrieves a liability for the current business from the data store given the unique identifier for the liability.
public FetchLiability ( System.Guid liabilityID ) : Liability
liabilityID System.Guid
Résultat Liability

FetchLiabilityIDs() public méthode

Retrieves all liabilities for the current business from the data store.
public FetchLiabilityIDs ( ) : IList
Résultat IList

FetchRevenue() public méthode

Retrieves a revenue account for the current business from the data store given the unique identifier for the revenue.
public FetchRevenue ( System.Guid revenueID ) : Revenue
revenueID System.Guid
Résultat Revenue

FetchRevenueIDs() public méthode

Retrieves all revenue accounts for the current business from the data store.
public FetchRevenueIDs ( ) : IList
Résultat IList

FetchSetting() public méthode

Retrieves a given setting from the data source.
public FetchSetting ( string name ) : string
name string The name of the setting to retrieve.
Résultat string

FetchTransactions() public méthode

Loads all transactions for the current business from the data source that were applied to a given account.
public FetchTransactions ( Workbook workbook, Account account ) : TransactionCollection
workbook Workbook /// The workbook used to associate the loaded transactions with. ///
account Account The account that will be used to search for transactions.
Résultat TransactionCollection

OpenFile() public static méthode

Opens a TrialBalance data package from a given location.
public static OpenFile ( string filePath ) : PackageDataProvider
filePath string The location where the data package is stored.
Résultat PackageDataProvider

PackageDataProvider() protected méthode

Constructor.
protected PackageDataProvider ( string filePath ) : System
filePath string The path to the file to store TrialBalance data in.
Résultat System

PersistAsset() public méthode

Saves a given asset.
public PersistAsset ( Asset asset ) : void
asset Asset The asset to save.
Résultat void

PersistEquity() public méthode

Saves an equity account to the data store.
public PersistEquity ( Equity equity ) : void
equity Equity The equity account to save.
Résultat void

PersistExpense() public méthode

Saves an expense account to the data store.
public PersistExpense ( Expense expense ) : void
expense Expense The expense account to save.
Résultat void

PersistLiability() public méthode

Saves a liability account to the data store.
public PersistLiability ( Liability liability ) : void
liability Liability The liability to save.
Résultat void

PersistRevenue() public méthode

Saves a revenue account to the data store.
public PersistRevenue ( Revenue revenue ) : void
revenue Revenue The revenue account to save.
Résultat void

PersistSetting() public méthode

Saves a given setting.
public PersistSetting ( string name, string value ) : void
name string The name of the setting.
value string The value of the setting.
Résultat void

PersistTransaction() public méthode

Saves a given transaction to the data store.
public PersistTransaction ( Transaction transaction ) : void
transaction Transaction The transaction to save.
Résultat void