Example #1
0
        async void LoginClick(Object sender, EventArgs e)
        {
            if (LoginForm.Text == null || PasswordForm.Text == null)
            {
                var toastmessage = "Need to fill everything";
                DependencyService.Get <ToastMessage>().ShortTime(toastmessage);
            }
            else
            {
                var accountApiServises = new AccountApiServises();
                var content            = await accountApiServises.AuthenticateUserAsync(LoginForm.Text, PasswordForm.Text);

                if (content != null)
                {
                    CurrentUser.ThisUser = new CurrentUser(content);
                    OpenAuthorizedStackLayout();
                    _viewModel.IsBusy = true;
                }
                else
                {
                    var toastmessage = "Not Found";
                    DependencyService.Get <ToastMessage>().ShortTime(toastmessage);
                }
            }
        }
Example #2
0
        async void LoginClick(Object sender, EventArgs e)
        {
            if (LoginForm.Text == null || PasswordForm.Text == null)
            {
                var toastmessage = "Need to fill everything";
                DependencyService.Get <ToastMessage>().ShortTime(toastmessage);
            }
            else
            {
                var accountApiServises = new AccountApiServises();
                var content            = await accountApiServises.AuthenticateUserAsync(LoginForm.Text, PasswordForm.Text);

                if (content != null)
                {
                    new CurrentUser(content);
                    await Navigation.PushAsync(new LoginSucces());
                }
                else
                {
                    var toastmessage = "Not Found";
                    DependencyService.Get <ToastMessage>().ShortTime(toastmessage);
                }
            }
        }