static void Main(string[] args) { var st1 = new Customer("Pesho", "Peshov", "Peshov", "9087654323"); var st3 = new Customer("Kolio", "Peshov", "Peshov", "9087654323"); var st2 = (Customer)st3.Clone(); st2.FirstName = "Typanar"; var st4 = st2.Clone(); st4.ID = "098872356354"; var p = new Payment(); Console.WriteLine(st1.Equals(st1)); var customers = new List<Customer>(){ st1,st2,st3,st4 }; customers.Sort(); customers.ForEach(x=>Console.WriteLine(x)); }
public static void Main() { Payment hdd = new Payment("WD HDD 2TB", 189.99m); Payment mouse = new Payment("Mouse", 9.90m); Customer geek = new Customer("Bill", "Gates", 8712013812, CustomerType.Diamond, hdd, mouse); Payment vacation = new Payment("Vacation", 1250); Customer slacker = new Customer("Pesho", "Ivanov", "Georgiev", 9203131111, CustomerType.OneTime, "Sofia", null, null, vacation); Customer geekCopy = (Customer)geek.Clone(); Customer anotherPesho = new Customer("Pesho", "Georgiev", 9912121212, CustomerType.Golden, hdd, vacation, mouse); Console.WriteLine(geek == slacker); Console.WriteLine(geek == geekCopy); Console.WriteLine(); Customer[] customers = new[] { anotherPesho, geek, slacker }; Array.Sort(customers); Console.WriteLine(string.Join("\n", customers.ToList())); }