private async Task <bool> SignIn()
        {
            if (IsInternet())
            {
                //check if fields are completed
                if (String.IsNullOrWhiteSpace(Username) || String.IsNullOrWhiteSpace(Password))
                {
                    await DisplayError(ErrorMsg.CompleteAllFieldsError);
                }
                else
                {
                    await PageService.PushPopupAsync(new WaitForActionView());

                    //create auth password
                    string            authPassword = VaultManager.CreateAuthPassword(Username, Password);
                    Models.TaskStatus statusLogin  = await UserProcessor.LogIn(ApiHelper.ApiClient, Username, authPassword);

                    if (!statusLogin.IsError)
                    {
                        return(true);
                    }
                    else
                    {
                        await PageService.PopPopupAsync();
                        await DisplayError(statusLogin.Message);
                    }
                }
            }
            return(false);
        }
Example #2
0
        private Guid GetUserId(string userName)
        {
            User user = BusinessLogicConverter.ToUser(userName);

            UserProcessor.LogIn(user);
            return(user.Id);
        }
Example #3
0
        public override void Execute()
        {
            User user = BusinessLogicConverter.ToUser(UserName);

            UserProcessor.LogIn(user);
            Result = user.Id;

            Logger.Trace(string.Format("User '{0}' has been logged in. UserId: {1}", UserName, user.Id));
        }