Example #1
0
 public HomeNavigator() : base()
 {
     SonList.Add(new FunctionItem(this, () =>
     {
     }, "用户登录"));
     SonList.Add(new FunctionItem(this, () =>
     {
     }, "注册账户"));
 }
Example #2
0
        public MainNavigator() : base()
        {
            SonList.Add(new FunctionItem(this, () =>
            {
                string account;
                string password;
                bool isSuccess = GetInput("请输入用户名", out account, (input) =>
                {
                    if (string.IsNullOrEmpty(input))
                    {
                        Console.WriteLine("用户名不可为空");
                        return(false);
                    }
                    return(true);
                }) &&
                                 GetInput("请输入密码", out password, (input) =>
                {
                    if (string.IsNullOrEmpty(input))
                    {
                        Console.WriteLine("密码不可为空");
                        return(false);
                    }
                    return(true);
                }) &&
                                 CommonService.CreateAccount(new TAccount()
                {
                    AccountName = account, Password = password
                }).IsSuccess;
                if (!isSuccess)
                {
                    return;
                }

                //new HomeNavigator()
            }, "用户登录"));
            SonList.Add(new FunctionItem(this, () =>
            {
            }, "注册账户"));
        }