Beispiel #1
0
        public async Task SaveChanges()
        {
            await _storage.DeleteAllFiles(Wallet.Id.ToString("N"));

            foreach (var transaction in _transactions)
            {
                var dbTransaction = new DBTransaction(transaction.Wallet.Id.ToString("N"), transaction.Sum, transaction.Currency, transaction.Description, transaction.Date, transaction.Category.Name, transaction.Id);
                await _storage.AddOrUpdateAsync(dbTransaction);
            }
        }
Beispiel #2
0
        public async Task SaveChanges()
        {
            await _storage.DeleteAllFiles(User.Id.ToString("N"));

            foreach (var category in Categories)
            {
                var dbCategory = new DBCategory(category.Name, category.Owner.Id.ToString("N"), category.Description, category.Color, category.Icon, category.Id);
                await _storage.AddOrUpdateAsync(dbCategory);
            }
        }
Beispiel #3
0
        public async Task SaveChanges()
        {
            await _storage.DeleteAllFiles(User.Id.ToString("N"));

            foreach (var wallet in Wallets)
            {
                var dbWallet = new DBWallet(wallet.Name, wallet.Owner.Id.ToString("N"),
                                            wallet.Description, wallet.InitialBalance,
                                            wallet.CurrentBalance, wallet.MainCurrency,
                                            wallet.Id, wallet.AvailabilityOfCategories);
                await _storage.AddOrUpdateAsync(dbWallet);
            }
        }