Ejemplo n.º 1
0
        public override IEnumerable <IAccount> GetAllAccounts()
        {
            _table.InitializeDatabase();
            var lines = _table.SelectAll();

            return(lines.Select(objects => ObjectToIAccountConverter.Convert(objects, AccountFactory)).ToList());
        }
Ejemplo n.º 2
0
 public override IAccount CreateAccount(IAccount account)
 {
     _table.InitializeDatabase();
     if (account.Id == 0)
     {
         account.Id = _table.AddData(ObjectToIAccountConverter.ConvertToKeyPairList(account));
     }
     else
     {
         _table.AddData(ObjectToIAccountConverter.ConvertToKeyPairListWithId(account));
     }
     return(account);
 }
Ejemplo n.º 3
0
 public override void UpdateAccount(IAccount account)
 {
     _table.InitializeDatabase();
     _table.UpdateData(ObjectToIAccountConverter.ConvertToKeyPairList(account), account.Id);
 }