Esempio n. 1
0
        public void ValidateUser()
        {
            try
            {
                ValidateUserCommand.IsEnabled = false;



                User user = _repository.Validate(CurrentUser.UserId, CurrentUser.Password);

                if (user != null)
                {
                    SessionInfo si = SessionInfo.Instance;
                    si.user = user;
#if !Desktop
                    WebDataClient.UpdateAuthToken(user.SessionToken);
#endif


                    StoreSessionInfoAsync(user);
                    if (LoginSuccess != null)
                    {
                        LoginSuccess.ShowUI();
                    }
                }
                else
                {
                    if (LoginFailed != null)
                    {
                        LoginFailed.ShowUI();
                    }

                    ValidateUserCommand.IsEnabled = true;
                }
            }
            catch (Exception ex)
            {
                msgBox.ShowUI(ex.Message);
            }
        }