Example #1
0
        static void CreateAccounts(AdminClient adminClient, FunBankLib.Models.Customer customer)
        {
            Prompt createAccountPrompt = new Prompt($"Create a new account for {customer.Username} ({customer.Name.First} {customer.Name.Last}", new string[] { "Y", "n" });

            createAccountPrompt.Answered += (sender, e) => {
                if (e.answer == "Y")
                {
                    new Task(async() => {
                        var account = await adminClient.CreateAccount(customer, new Prompt("Enter a new Password:").Execute());

                        createAccountPrompt.Execute();
                    }).Start();
                }
                else
                {
                    CreateEmployee(adminClient);
                }
            };
            createAccountPrompt.Execute();
        }