Example #1
0
 internal void addCustomer()
 {
     int id, number;
     string name, address;
     try_again:
     try
     {
         Console.Clear();
         Console.WriteLine("Write the ID");
         id = int.Parse(Console.ReadLine());
         Console.WriteLine("Write the name");
         name = Console.ReadLine();
         Console.WriteLine("Write the address");
         address = Console.ReadLine();
         Console.WriteLine("Write the telephone number");
         number = int.Parse(Console.ReadLine());
         Console.Clear();
     }
     catch (Exception)
     {
         goto try_again;
     }
     Customer ps = new Customer(id, name, address, number);
     List<Customer> customerList = per.CustomerList;
     foreach (var item in customerList)
     {
         if (item.CustomerId1 == ps.CustomerId1)
         {
             goto try_again;
         }
     }
     per.addCustomer(ps);
     Console.WriteLine("Press enter to continue");
     Console.Read();
 }
Example #2
0
 public Order(string OrdreDate, int Quantity, Customer Customer, Product Product)
 {
     this.OrdreDate = OrdreDate;
     QuantityOrdered = Quantity;
     OrderedBy = Customer;
     OrderedProduct = Product;
 }