//************************************************** // Method: cRegister // // Purpose: Registering a Customer account. //************************************************** static void cRegister() { Customer c = new Customer(); string[] args = { "false" }; PropertyInfo[] properties = typeof(Customer).GetProperties(); foreach (PropertyInfo property in properties) { if (property.Name != "Addresses" && property.Name != "Orders") { Console.Write(property.Name + ": "); property.SetValue(c, Console.ReadLine()); } } if (!check("c", c.Email, args)) { dataStore.Customers.Add(c); save(); MenuC menu = new MenuC(c, dataStore.Businesses); } else { Console.Write("An account was already made with this email."); string wait = Console.ReadLine(); } }
//************************************************** // Method: login // // Purpose: Logging in. //************************************************** static void login() { Console.Clear(); Account a; string email, password = ""; string[] args = { "true", password }; Console.Write("Email: "); email = Console.ReadLine(); Console.Write("Password: "******"Welcome back!"); string wait = Console.ReadLine(); if (cCheck("email", a.Email)) { MenuC menu = new MenuC((Customer)a, dataStore.Businesses); } else if (bCheck("email", a.Email)) { MenuB menu = new MenuB((Business)a, dataStore.Businesses); } else if (dCheck("email", a.Email)) { MenuD menu = new MenuD((Person)a, dataStore.Customers); } save(); } else { Console.WriteLine("Invalid user."); string wait = Console.ReadLine(); } }