示例#1
0
        private async void nextButton_Clicked(object sender, EventArgs e)
        {
            //await Navigation.PushAsync(new MainScreen());
            //If both the fields aren't empty, perform login.
            if (!string.IsNullOrEmpty(username_register.Text) && !string.IsNullOrEmpty(password_register.Text))
            {
                try
                {
                    await Task.Run(() => NextPoster());
                }
                catch (Exception NextException)
                {
                    await DisplayAlert("NextException", NextException.ToString(), "ok");

                    //Console.WriteLine("NextException : " + NextException);
                    throw;
                }
                if (SignUpFirstStage)
                {
                    await Navigation.PushAsync(new Register());
                }
                else
                {
                    await DisplayAlert("Failure!", message, "ok");
                }
            }
            else
            {
                await DisplayAlert("Empty Fields", "Make Sure The Fields Are Filled.", "Ok");
            }
        }
示例#2
0
        private async void submitButton_Clicked(object sender, EventArgs e)
        {
            submitButton.BackgroundColor = Color.FromHex("#c79400");
            submitButton.TextColor       = Color.FromHex("#000000");
            submitButton.Text            = "Posting...";

            //await DisplayAlert("Posted", "Posting", "ok");
            if (!string.IsNullOrEmpty(question_description.Text) && !string.IsNullOrEmpty(question_tags.Text) && !string.IsNullOrEmpty(question_title.Text))
            {
                if (models.post.so_username != "None" && models.post.so_password != "None" &&
                    models.post.reddit_username != "None" && models.post.reddit_password != "None")
                {
                    try
                    {
                        await Task.Run(() => QuestionPoster());
                    }
                    catch (Exception NextException)
                    {
                        SubmitButtonColorReset();
                        await DisplayAlert("NextException", NextException.ToString(), "ok");

                        //Console.WriteLine("NextException : " + NextException);
                        throw;
                    }
                    if (QuestionPosted)
                    {
                        SubmitButtonColorReset();
                        await DisplayAlert("Success!", "Your Question Was Posted!", "ok");

                        question_title.Text       = "";
                        question_description.Text = "";
                        question_tags.Text        = "";
                        base.OnBackButtonPressed();
                    }
                    else
                    {
                        SubmitButtonColorReset();
                        await DisplayAlert("Failure!", message, "ok");
                    }
                }
                else
                {
                    SubmitButtonColorReset();
                    await DisplayAlert("Failure!", "Make sure you have saved your credentials.", "ok");
                }
            }
            else
            {
                SubmitButtonColorReset();
                await DisplayAlert("Empty Fields", "Make Sure The Fields Are Filled.", "Ok");
            }
        }
示例#3
0
        private async void nextButton_Clicked(object sender, EventArgs e)
        {
            nextButton.BackgroundColor = Color.FromHex("#ffc400");
            nextButton.TextColor       = Color.FromHex("#000000");
            nextButton.Text            = "Please Wait...";

            //await Navigation.PushAsync(new MainScreen());
            //If both the fields aren't empty, perform login.
            if (!string.IsNullOrEmpty(username_register.Text) && !string.IsNullOrEmpty(password_register.Text))
            {
                try
                {
                    await Task.Run(() => NextPoster());
                }
                catch (Exception NextException)
                {
                    NextButtonColorReset();
                    await DisplayAlert("NextException", NextException.ToString(), "ok");
                    await DisplayAlert("Server Sleeping", "Seems like our servers are sleeping. We will open a link and you should see when the server is up (generally takes 2-3 minutes). Try after that.", "Ok");

                    //Device.OpenUri(new Uri("http://auth.fillip72.hasura-app.io/ui"));
                    await Task.Run(() => { Device.OpenUri(new Uri("http://auth.fillip72.hasura-app.io/ui")); });

                    return;

                    //Console.WriteLine("NextException : " + NextException);
                    throw;
                }
                if (SignUpFirstStage)
                {
                    await Navigation.PushAsync(new Register());

                    NextButtonColorReset();
                }
                else
                {
                    NextButtonColorReset();
                    await DisplayAlert("Failure!", message, "ok");
                }
            }
            else
            {
                NextButtonColorReset();
                await DisplayAlert("Empty Fields", "Make Sure The Fields Are Filled.", "Ok");
            }
        }
示例#4
0
        private async void registerButton_Clicked(object sender, EventArgs e)
        {
            registerButton.BackgroundColor = Color.FromHex("#c79400");
            registerButton.TextColor       = Color.FromHex("#000000");
            registerButton.Text            = "Finishing Up...";

            //DisplayAlert("Register Clicked", "You Clicked Regsiter", "Ok");
            //If both the fields aren't empty, perform login.
            if (!string.IsNullOrEmpty(name_register.Text) && !string.IsNullOrEmpty(age_register.Text) &&
                (!string.IsNullOrEmpty(userEmail_Sign.Text) && !string.IsNullOrEmpty(phone_register.Text))
                )
            {
                //await DisplayAlert("Registered", "Successfuly Registered, Select \"ok\" to continue.", "Ok");
                //await Navigation.PushAsync(new Dashboard());
                try
                {
                    await Task.Run(() => NextPoster());
                }
                catch (Exception NextException)
                {
                    FinishButtonColorReset();
                    await DisplayAlert("NextException", NextException.ToString(), "ok");

                    //Console.WriteLine("NextException : " + NextException);
                    throw;
                }
                if (SignUpSecondStage)
                {
                    await Navigation.PushAsync(new Dashboard());

                    FinishButtonColorReset();
                }
                else
                {
                    FinishButtonColorReset();
                    await DisplayAlert("Failure!", message, "ok");
                }
            }
            else
            {
                FinishButtonColorReset();
                await DisplayAlert("Empty Fields", "Make Sure The Fields Are Filled.", "Ok");
            }
        }