fix Withdrawal.UpdateAccounts
This commit is contained in:
parent
24299f86ce
commit
b8b4fb24e5
@ -86,16 +86,17 @@ namespace BankDatabaseImplement.Models
|
||||
context.SaveChanges();
|
||||
foreach (var wa in WithdrawalAccounts)
|
||||
{
|
||||
wa.Sum = model.WithdrawalAccounts[wa.AccountId].Item2;
|
||||
model.WithdrawalAccounts.Remove(wa.AccountId);
|
||||
}
|
||||
context.SaveChanges();
|
||||
}
|
||||
var Withdrawal = context.Withdrawals.First(x => x.Id == Id);
|
||||
var withdrawal = context.Withdrawals.First(x => x.Id == Id);
|
||||
foreach (var account in model.WithdrawalAccounts)
|
||||
{
|
||||
context.AccountWithdrawals.Add(new AccountWithdrawal
|
||||
{
|
||||
Withdrawal = Withdrawal,
|
||||
Withdrawal = withdrawal,
|
||||
Account = context.Accounts.First(x => x.Id == account.Key),
|
||||
Sum = account.Value.Item2,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user