Exemple #1
0
 public void Update(Account account)
 {
     string query = QueryBuilder.Update("accounts", "AccountId", account.accountId.ToString(),
                                                    GetNameColumnPair(account.name),
                                                    GetCurrencyColumnPair(account.currency),
                                                    GetOwnerPersonIdColumnPair(account.ownerPersonId),
                                                    GetTypeColumnPair(account.type));
     using (SQLiteCommand update = new SQLiteCommand(query, m_conn))
         update.ExecuteNonQuery();
 }
Exemple #2
0
        public AccountViewModel(Account account, IAccountancyApplication accountancyApplication, PersonViewModel owner)
        {
            m_accountancyApplication = accountancyApplication;
            m_underlyingData = account;

            Name = account.name;
            Currency = account.currency;
            AccountType = account.type;
            Owner = owner;

            UpdateAccountState();
        }
 public void Update(Account account)
 {
     m_accounts[account.accountId] = account;
 }
 public void Delete(Account account)
 {
     m_accounts.Remove(account.accountId);
 }
 public long AddAccount(string name, string currency, long ownerPersonId, AccountType type)
 {
     Account account = new Account(0, currency, ownerPersonId, name, type);
     Add(ref account);
     return account.accountId;
 }
 public void Add(ref Account account)
 {
     account.accountId = GetNewId();
     m_accounts.Add(account.accountId, account);
 }
Exemple #7
0
 public void Delete(Account account)
 {
     string query = QueryBuilder.Delete("accounts", "AccountId", account.accountId.ToString());
     using (SQLiteCommand delete = new SQLiteCommand(query, m_conn))
         delete.ExecuteNonQuery();
 }
Exemple #8
0
 public void Add(ref Account account)
 {
     account.accountId = AddAccount(account.name, account.currency, account.ownerPersonId, account.type);
 }
 public AccountViewModel GetAccount(PersonViewModel person, Account a)
 {
     if (!m_accountCache.ContainsKey(a.accountId))
         m_accountCache[a.accountId] = new AccountViewModel(a, this, person);
     return m_accountCache[a.accountId];
 }
 public AccountViewModel GetAccount(Account a)
 {
     return GetAccount(a.accountId);
 }
Exemple #11
0
 public void Add(ref Account account)
 {
     m_accountsManager.Add(ref account);
 }
Exemple #12
0
 public void Update(Account account)
 {
     m_accountsManager.Update(account);
 }
Exemple #13
0
 public void Delete(Account account)
 {
     m_accountsManager.Delete(account);
 }
Exemple #14
0
 public AccountViewModel(Account account, IAccountancyApplication accountancyApplication)
     : this(account, accountancyApplication, accountancyApplication.GetPerson(account.ownerPersonId))
 {
 }
Exemple #15
0
 public void UpdateUnderlyingData()
 {
     if (Owner.PersonId != OwnerPersonId)
     {
         m_accountancyApplication.GetPerson(OwnerPersonId).UserAccounts.Remove(this);
         Owner.UserAccounts.Add(this);
     }
     m_underlyingData = new Account(AccountId, Currency, Owner.PersonId, Name, AccountType);
 }