示例#1
0
        private async System.Threading.Tasks.Task deleteAcoountPageButton_ClickedAsync(object sender, EventArgs e)
        {
            loguotButton.IsEnabled            = false;
            deleteAcoountPageButton.IsEnabled = false;
            deleteActivity.IsRunning          = true;

            string success = GlobalVariables.otherFragmentViewModel.DeleteAccount();

            if (!String.IsNullOrEmpty(success))
            {
                await DisplayAlert(English.Failed(), success, English.OK());
            }
            else
            {
                FileStoreAndLoading.InsertToFile(GlobalVariables.logintxt, String.Empty);

                var page = new LoginPage();

                await Navigation.PushModalAsync(new NavigationPage(page)
                {
                    Style = GlobalVariables.NavigationPageStyle
                });
            }
            loguotButton.IsEnabled            = true;
            deleteAcoountPageButton.IsEnabled = true;
            deleteActivity.IsRunning          = false;
        }
示例#2
0
        private async System.Threading.Tasks.Task loguotButton_Clicked(object sender, EventArgs e)
        {
            loguotButton.IsEnabled = false;

            FileStoreAndLoading.InsertToFile(GlobalVariables.logintxt, String.Empty);

            var page = new LoginPage();

            await Navigation.PushModalAsync(new NavigationPage(page)
            {
                Style = GlobalVariables.NavigationPageStyle
            });

            loguotButton.IsEnabled = true;
        }
        private void loginButton_Clicked(object sender, EventArgs e)
        {
            loginButton.IsEnabled = false;

            string success = GlobalVariables.loginPageViewModel.Login(emailEntry.Text, pwEntry.Text);

            if (!String.IsNullOrEmpty(success))
            {
                Device.BeginInvokeOnMainThread(() => loginActivator.IsRunning = false);

                DisplayAlert(English.Failed(), success, English.OK());
            }
            else
            {
                FileStoreAndLoading.InsertToFile(GlobalVariables.logintxt, emailEntry.Text);

                Navigation.PushModalAsync(new NotPrimaryPages.JustActivityIndicator("login"));
            }

            loginButton.IsEnabled = true;
        }
        private async void SetPageContent(FacebookProfile facebookProfile)
        {
            FacebookProfilePageViewModel facebookProfilePageViewModel = new FacebookProfilePageViewModel();

            var page = Navigation.NavigationStack[Navigation.NavigationStack.Count - 2];

            if (page is LoginPage)
            {
                string success = facebookProfilePageViewModel.isThereAnyUser(facebookProfile.Id);

                if (success == English.NoAccountFindWithThisFacebookAccount())
                {
                    DependencyService.Get <IClearCookies>().ClearAllWebAppCookies();

                    await Navigation.PopToRootAsync();

                    await DisplayAlert(English.Failed(), success, English.OK());
                }
                else
                {
                    FileStoreAndLoading.InsertToFile(GlobalVariables.logintxt, success);

                    //var pages = Navigation.NavigationStack;

                    //while (pages.Count > 1)
                    //{
                    //    Navigation.RemovePage(pages.Last());
                    //}

                    await Navigation.PushModalAsync(new JustActivityIndicator("facebook"));
                }
            }
            else if (page is SignUpPage)
            {
                DependencyService.Get <IClearCookies>().ClearAllWebAppCookies();

                var success = facebookProfilePageViewModel.isThereAnyUser(facebookProfile.Id);

                if (success == English.NoAccountFindWithThisFacebookAccount())
                {
                    await Navigation.PushAsync(new SomeInformationPage(facebookProfile));
                }
                else
                {
                    await Navigation.PopAsync();
                }
            }
            else if (page is UpdateProfilePage)
            {
                DependencyService.Get <IClearCookies>().ClearAllWebAppCookies();

                FileStoreAndLoading.GetSomethingText(GlobalVariables.logintxt);

                var success = facebookProfilePageViewModel.ChangeFacebookId(facebookProfile.Id, facebookProfile.Picture.Data.Url, GlobalVariables.ActualUsersEmail);

                if (String.IsNullOrEmpty(success))
                {
                    await Navigation.PushAsync(new MyAccountPage());
                }
                else
                {
                    await Navigation.PushAsync(new UpdateProfilePage());

                    await DisplayAlert(English.Failed(), success, English.OK());
                }
            }
        }