aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Views/CheckOrdersView.cs')
-rw-r--r--Views/CheckOrdersView.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/Views/CheckOrdersView.cs b/Views/CheckOrdersView.cs
new file mode 100644
index 0000000..bedf38f
--- /dev/null
+++ b/Views/CheckOrdersView.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using KukaPizza.Controllers;
+using KukaPizza.Models;
+
+namespace KukaPizza.Views
+{
+ public class CheckOrdersView : View
+ {
+ private CheckOrdersController _controller;
+ private List<PizzaOrder> orders;
+ public CheckOrdersView(CheckOrdersController controller)
+ {
+ _controller = controller;
+ orders = controller.Orders;
+ Init(_controller);
+ }
+
+ protected override void Draw()
+ {
+ Console.Clear();
+ Console.Write(
+@"================================================================================
+ Your orders
+================================================================================
+");
+ foreach (var o in orders)
+ {
+ Console.WriteLine($" Base pizza: {o.BasePizza.Name}");
+ Console.WriteLine($" Extra toppings: {o.ExtraToppingsToString()}");
+ Console.WriteLine($" Size: {o.Size}");
+ Console.Write("--------------------------------------------------------------------------------");
+ }
+
+ Console.WriteLine("\n 0. Go back");
+ }
+
+ protected override void Interact()
+ {
+ int choice = 0;
+
+ do
+ {
+ choice = Console.ReadKey(true).KeyChar;
+
+ Draw();
+ } while (choice != '0');
+ }
+ }
+} \ No newline at end of file