コード例 #1
0
        public async void LoginUser(string username, string password, string customerId, bool persistPassword)
        {
            LoginSettings = new LoginSettings
                {
                    CreateDate = DateTime.Now,
                    UserName = username,
                    Password = password,
                    CustomerId = customerId,
                    PersistLogin = persistPassword
                };


            await DoLogin();

            Execute.InUIThread(() =>
                {
                    if (_success)
                    {
                        ApplicationCommands.LoginSucceeded.Execute(null);
                    }
                    else
                    {
                        ApplicationCommands.LoginFailed.Execute(_statusMessage);
                    } 
                });            
        }
コード例 #2
0
        public ILoginSettings GetSettings()
        {
            var loginSettings = new LoginSettings()
            {
                CreateDate   = DateTime.Now,
                UserName     = _appSettings.UserName,
                Password     = _appSettings.Password,
                PersistLogin = _appSettings.PersistLogin,
                CustomerId   = _appSettings.CustomerId,
                UserId       = _appSettings.UserId,
                UserFullName = _appSettings.UserDisplayName
            };

            if (string.IsNullOrEmpty(loginSettings.UserName) || string.IsNullOrEmpty(loginSettings.Password) || string.IsNullOrEmpty(loginSettings.CustomerId))
            {
                return(null);
            }

            if (!loginSettings.PersistLogin)
            {
                return(null);
            }

            return(loginSettings);
        }
コード例 #3
0
 public void AttachUserNameAndCustomerId(string username, string customerId)
 {
     LoginSettings = new LoginSettings
         {
             CreateDate = DateTime.Now,
             UserName = username,
             CustomerId = customerId,
         };
 }