Пример #1
0
        public async Task LogInCommand_ValidUser_GoesToNextPage()
        {
            _logInViewModel.UserName = "******";
            _logInViewModel.Password = "******";

            await _logInViewModel.LogIn();

            await _fakeNavigation.Received(1).GoToPage <MainTabbedPage>();

            _nameAndPasswordService.Received().NameAndPassword = Arg.Is <NameAndPassword>(x => x.UserName == "Someone" && x.Password == "Password");
        }
Пример #2
0
 public void SubmitLogIn(object sender, EventArgs e)
 {
     if (viewModel.LogIn(UsernameEntry.Text, PasswordEntry.Text) == false)
     {
         ErrorMessage.Text      = "Username or password invalid. Please try again.";
         ErrorMessage.IsVisible = true;
     }
     else
     {
         Navigation.PopModalAsync();
     }
 }
Пример #3
0
        private async void btnLogIn_OnClicked(object sender, EventArgs e)
        {
            _viewModel.LogInData.IsBusy = true;
            string res = await _viewModel.LogIn();

            _viewModel.LogInData.IsBusy = false;

            if (res != null)
            {
                await DisplayAlert("Erreur", res, "OK");
            }
            else
            {
                await DisplayAlert("Succès", "Connexion réussie", "OK");

                App.Container.GetService <INavigation>().GoToMainFlow();
            }
        }
Пример #4
0
        private void LogInButton_Click(object sender, RoutedEventArgs e)
        {
            ViewModelBase viewModel = _loginVM.LogIn();

            if (viewModel != null)
            {
                if (viewModel.GetType() == typeof(OfficeWorkerMenuViewModel))
                {
                    PageCommands.Instance.GoTo(new OfficeWorkerMenuUC());
                }
                else if (viewModel.GetType() == typeof(FitterMenuViewModel))
                {
                    PageCommands.Instance.GoTo(new FitterMenuUC((FitterMenuViewModel)viewModel));
                }
            }
            else
            {
                ErrorMessageLabel.Visibility = Visibility.Visible;
            }
        }
 public void Execute(object parameter)
 {
     logInViewModel.LogIn();
 }