public async void OnRegister(object argParam)
        {
            try
            {
                if (!this.User.Password.Equals(this.User.ConfirmPassword))
                {
                    throw new Exception("The password should be same!");
                }
                var lcManager = App.CenteralIOC.Resolve <IUserManager>();
                var lcUser    = await lcManager.fnRegisterSystem(new User
                {
                    IsActive       = true,
                    CreatedDate    = DateTime.Now,
                    NameSurname    = this.User.NameSurname,
                    SecretQuestion = this.User.SecretQuestion,
                    Username       = this.User.Username
                }, this.User.Password, this.User.SecretAnswer);

                if (lcUser != null)
                {
                    App.CurrentUser = lcUser;
                    NavigationManger.fnNavigateHome();
                }
            }
            catch (System.Exception ex)
            {
                UserAlert.fnInformUser(UserInformType.Error, "Error", ex.Message);
            }
        }
Пример #2
0
        public async void OnResetPassword(object argParam)
        {
            try
            {
                if (!Model.Password.Equals(Model.ConfirmPassword))
                {
                    throw new Exception("The password sould be same!");
                }
                var lcManager = App.CenteralIOC.Resolve <IUserManager>();
                var lcUser    = await lcManager.fnResetPasswordAsync(Model.Username, Model.SecretAnswer, Model.Password);

                if (lcUser == null)
                {
                    throw new Exception("User could not be found!");
                }
                App.CurrentUser = lcUser;
                NavigationManger.fnNavigateHome();
            }
            catch (Exception ex)
            {
                UserAlert.fnInformUser(UserInformType.Error, "Error", ex.Message);
            }
        }