Exemple #1
0
        static void CreateEmployee(AdminClient adminClient)
        {
            Prompt createEmployeePrompt = new Prompt($"Create new employee?", new string[] { "Y", "n" });

            createEmployeePrompt.Answered += (sender, e) => {
                if (e.answer == "Y")
                {
                    new Task(async() => {
                        var employee = await adminClient.CreateEmployee(new FunBankLib.Models.Employee()
                        {
                            Id       = null,
                            Hash     = null,
                            Username = new Prompt("username:"******"first name:").Execute(),
                                Last  = new Prompt("last name:").Execute()
                            },
                            PasswordHash = new Prompt("password:").Execute()
                        });

                        createEmployeePrompt.Execute();
                    }).Start();
                }
                else
                {
                    CreateATM(adminClient);
                }
            };
            createEmployeePrompt.Execute();
        }