Beispiel #1
0
        private static void SearchCustomer()
        {
            string input = ConsoleQueries.QueryString("Input name or city: ").ToUpper();

            WriteLine();
            List <Customer> foundCustomers = MyBank.CustomerManager.SearchByNameOrCity(input);

            if (foundCustomers.Count == 0)
            {
                WriteLine("No customers found!");
            }
            else
            {
                foreach (Customer customer in foundCustomers)
                {
                    WriteLine($"{customer.ID}: {customer.Name}");
                }
            }
        }
Beispiel #2
0
        private static void CreateCustomer()
        {
            Customer newCustomer = MyBank.CustomerManager.CreateNewCustomer();

            newCustomer.Name      = ConsoleQueries.QueryString("Input name: ");
            newCustomer.OrgNumber = ConsoleQueries.QueryLong("Input organization number: ");
            if (newCustomer.OrgNumber.ToString().Length != 10)
            {
                Console.WriteLine("Orgnumber has to be 10 numbers. Aborting.");
                return;
            }

            newCustomer.Adress      = ConsoleQueries.QueryString("Input street and number: ");
            newCustomer.City        = ConsoleQueries.QueryString("Input city: ");
            newCustomer.Region      = ConsoleQueries.QueryString("Input region: ");
            newCustomer.PostalCode  = ConsoleQueries.QueryString("Input postal Code: ");
            newCustomer.Country     = ConsoleQueries.QueryString("Input country: ");
            newCustomer.PhoneNumber = ConsoleQueries.QueryString("Input phone number: ");


            MyBank.AccountManager.AddAccount(newCustomer.ID);
        }