private static void UpdateCustomer() { Console.WriteLine("Select userId"); DbHandler.QueryDb(sql: "execute ListIdAndNames"); int cId = AskForInt(": "); Console.WriteLine("-- Search --"); Console.WriteLine("1. Update name"); Console.WriteLine("2. Update email(s)"); Console.WriteLine("3. Add email(s)"); Console.WriteLine("4. Update phonenumber(s)"); Console.WriteLine("5. Add phonenumber(s)"); Console.WriteLine("6. Back"); int choice = AskForInt(": "); switch (choice) { case 1: SearchDb(Validator.ValidateName, "First name: ", "first_name"); break; case 2: SearchDb(Validator.ValidateName, "Last name: ", "last_name"); break; case 3: SearchDb(Validator.ValidateEmail, "Email: ", "email_address"); break; case 4: SearchDb(Validator.ValidatePhoneNumber, "Phone number: ", "phone_number"); break; default: break; } }
private static void ListAllCustomers() { DbHandler.QueryDb(sql: "execute GetAllUsers"); Console.ReadKey(); }