-
Notifications
You must be signed in to change notification settings - Fork 5k
/
Program.cs
36 lines (32 loc) · 1.16 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Linq;
namespace customer_relationship
{
class Program
{
static void Main(string[] args)
{
SampleCustomer c = new SampleCustomer("customer one", new DateTime(2010, 5, 31))
{
Reminders =
{
{ new DateTime(2010, 08, 12), "childs's birthday" },
{ new DateTime(1012, 11, 15), "anniversary" }
}
};
SampleOrder o = new SampleOrder(new DateTime(2012, 6, 1), 5m);
c.AddOrder(o);
o = new SampleOrder(new DateTime(2103, 7, 4), 25m);
c.AddOrder(o);
Console.WriteLine($"Data about {c.Name}");
Console.WriteLine($"Joined on {c.DateJoined}. Made {c.PreviousOrders.Count()} orders, the last on {c.LastOrder}");
Console.WriteLine("Reminders:");
foreach (var item in c.Reminders)
{
Console.WriteLine($"\t{item.Value} on {item.Key}");
}
foreach (IOrder order in c.PreviousOrders)
Console.WriteLine($"Order on {order.Purchased} for {order.Cost}");
}
}
}