();
}
diff --git a/ALM.Web/TransactionType.cs b/ALM.Web/TransactionType.cs
new file mode 100644
index 0000000..ee4de8d
--- /dev/null
+++ b/ALM.Web/TransactionType.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace ALM.Web
+{
+ public enum TransactionType
+ {
+ Deposit,
+ Withdrawal
+ }
+}
diff --git a/ALM.Web/Transactioner.cs b/ALM.Web/Transactioner.cs
new file mode 100644
index 0000000..50e4a19
--- /dev/null
+++ b/ALM.Web/Transactioner.cs
@@ -0,0 +1,62 @@
+using ALM.Web.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace ALM.Web
+{
+ public class Transactioner
+ {
+ private readonly BankRepository _repository;
+
+ public Transactioner(BankRepository repository)
+ {
+ _repository = repository;
+ }
+
+ public Transactioner()
+ {
+
+ }
+
+ public decimal Deposit(Account account, decimal amount)
+ {
+ account.Credit(amount);
+ return account.Balance;
+ }
+
+ public decimal Deposit(int accountId, decimal amount)
+ {
+ var account = _repository.GetAccount(accountId);
+ if (account == null)
+ {
+ throw new AccountNotFoundException(accountId);
+ }
+ return Deposit(account, amount);
+ }
+
+
+ public decimal Withdraw(Account account, decimal amount)
+ {
+ if (account.Balance < amount)
+ {
+ throw new InvalidTransactionException($"Cant Withdraw {amount} from account #{account.AccountId}. Balance is only {account.Balance}.");
+ }
+ account.Debit(amount);
+ return account.Balance;
+ }
+
+ public decimal Withdraw(int accountId, decimal amount)
+ {
+ var account = _repository.GetAccount(accountId);
+ if (account == null)
+ {
+ throw new AccountNotFoundException(accountId);
+ }
+ return Withdraw(account, amount);
+ }
+
+
+ }
+}
diff --git a/ALM.Web/Views/Home/Privacy.cshtml b/ALM.Web/Views/Home/Privacy.cshtml
deleted file mode 100644
index af4fb19..0000000
--- a/ALM.Web/Views/Home/Privacy.cshtml
+++ /dev/null
@@ -1,6 +0,0 @@
-@{
- ViewData["Title"] = "Privacy Policy";
-}
-@ViewData["Title"]
-
-Use this page to detail your site's privacy policy.
diff --git a/ALM.Web/Views/Shared/_Layout.cshtml b/ALM.Web/Views/Shared/_Layout.cshtml
index e1ba017..c906c59 100644
--- a/ALM.Web/Views/Shared/_Layout.cshtml
+++ b/ALM.Web/Views/Shared/_Layout.cshtml
@@ -18,11 +18,12 @@
diff --git a/ALM.Web/Views/Transaction/Transact.cshtml b/ALM.Web/Views/Transaction/Transact.cshtml
new file mode 100644
index 0000000..4313778
--- /dev/null
+++ b/ALM.Web/Views/Transaction/Transact.cshtml
@@ -0,0 +1,24 @@
+@model TransactionViewModel
+@{
+ ViewData["Title"] = "Index";
+}
+
+Transaction Time!
+
+
+
+@ViewBag.Message
+
+@if (Model.Account != null)
+{
+ The new balance of account #@Model.Account.AccountId is now @Model.Account.Balance
+}
+
+
+
+