Example #1
0
 private static void InvokeCallbackWithAuthCodeParameter(AuthentificationCode param)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         _authCallback.Invoke(param);
     });
 }
Example #2
0
 private static void AuthentificateUserCallback(AuthentificationCode result)
 {
     if (result == AuthentificationCode.LoginSuccessed)
     {
         SetCurrentUser(_authUser);
     }
     InvokeCallbackWithAuthCodeParameter(result);
 }
        private static void CheckUserDataCallback(AuthentificationCode result)
        {
            if (result == AuthentificationCode.LoginSuccessed)
            {
                using (var userRepository = new UserRepository())
                    _authUser = userRepository.AddNewUser(_authUser);
                SetCurrentUser(_authUser);
            }

            InvokeCallbackWithAuthCodeParameter(result);
        }
Example #4
0
        private static void CheckUserDataCallback(AuthentificationCode result)
        {
            if (result == AuthentificationCode.LoginSuccessed)
            {
                using (var userRepository = new UserRepository())
                    _authUser = userRepository.AddNewUser(_authUser);
                SetCurrentUser(_authUser);
            }

            InvokeCallbackWithAuthCodeParameter(result);
        }
Example #5
0
        private void LoginCallback(AuthentificationCode result)
        {
            this.BusyCount--;
            switch (result)
            {
            case AuthentificationCode.LoginSuccessed:
#if !UNIT_TEST
                using (var settingsRepository = new SettingsRepository())
                    settingsRepository.UpdateCurrentServer(Membership.CurrentUser.ServerID);

                using (var settingsRespository = new SettingsRepository())
                {
                    if (settingsRespository.GetCurrentSettings().CheckForNewSurveys&& InternetChecker.IsInernetActive)
                    {
                        Locator.MySurveysStatic.RefreshExecute();
                    }
                }

                NavigationProvider.Navigate(new System.Uri(HOME_PAGE_SOURCE, System.UriKind.Relative));
#else
                RaiseTestCompleted("LoginSuccess");
#endif
                break;

            case AuthentificationCode.InvalidCredentials:
#if !UNIT_TEST
                MessageBox.Show((Application.Current.Resources["LanguageStrings"] as LanguageStrings).WRONG_PASSWORD);
#else
                RaiseTestCompleted("Wrong username/password");
#endif
                break;

            case AuthentificationCode.ServerNotFound:
                MessageBox.Show((Application.Current.Resources["LanguageStrings"] as LanguageStrings).CANNOT_LOCATE_SERVER);
                break;

            case AuthentificationCode.NoInternetConnection:
                MessageBox.Show((Application.Current.Resources["LanguageStrings"] as LanguageStrings).ERROR_LOGIN_DB);
                break;
            }
        }
 private static void AuthentificateUserCallback(AuthentificationCode result)
 {
     if (result == AuthentificationCode.LoginSuccessed)
         SetCurrentUser(_authUser);
     InvokeCallbackWithAuthCodeParameter(result);
 }
 private static void InvokeCallbackWithAuthCodeParameter(AuthentificationCode param)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         _authCallback.Invoke(param);
     });
 }
Example #8
0
 private void OnUserAuthenticated(AuthentificationCode code)
 {
 }
        private void LoginCallback(AuthentificationCode result)
        {
            this.BusyCount--;
            switch (result)
            {
                case AuthentificationCode.LoginSuccessed:
#if !UNIT_TEST
                    using (var settingsRepository = new SettingsRepository())
                        settingsRepository.UpdateCurrentServer(Membership.CurrentUser.ServerID);

                    using (var settingsRespository = new SettingsRepository())
                    {
                        if (settingsRespository.GetCurrentSettings().CheckForNewSurveys && InternetChecker.IsInernetActive)
                        {
                            Locator.MySurveysStatic.RefreshExecute();
                        }
                    }

                    NavigationProvider.Navigate(new System.Uri(HOME_PAGE_SOURCE, System.UriKind.Relative));
#else
                    RaiseTestCompleted("LoginSuccess");
#endif
                    break;
                case AuthentificationCode.InvalidCredentials:
#if !UNIT_TEST
                    MessageBox.Show((Application.Current.Resources["LanguageStrings"] as LanguageStrings).WRONG_PASSWORD);
#else
                    RaiseTestCompleted("Wrong username/password");
#endif
                    break;
                case AuthentificationCode.ServerNotFound:
                    MessageBox.Show((Application.Current.Resources["LanguageStrings"] as LanguageStrings).CANNOT_LOCATE_SERVER);
                    break;
                case AuthentificationCode.NoInternetConnection:
                    MessageBox.Show((Application.Current.Resources["LanguageStrings"] as LanguageStrings).ERROR_LOGIN_DB);
                    break;
            }  
        }
 private void OnUserAuthenticated(AuthentificationCode code)
 { 
 }