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(); }
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); }
public void Delete(Account account) { string query = QueryBuilder.Delete("accounts", "AccountId", account.accountId.ToString()); using (SQLiteCommand delete = new SQLiteCommand(query, m_conn)) delete.ExecuteNonQuery(); }
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); }
public void Add(ref Account account) { m_accountsManager.Add(ref account); }
public void Update(Account account) { m_accountsManager.Update(account); }
public void Delete(Account account) { m_accountsManager.Delete(account); }
public AccountViewModel(Account account, IAccountancyApplication accountancyApplication) : this(account, accountancyApplication, accountancyApplication.GetPerson(account.ownerPersonId)) { }
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); }