Пример #1
0
        public afmelden(entiteiten.Les les)
        {
            Entry reden = new Entry {
                Placeholder = "Reden (optioneel)"
            };

            Button verzendknop = new Button {
                Text = "Meld af", BackgroundColor = Color.FromHex("#FF4081"), TextColor = Color.White
            };
            string gebruikersnaam = helper.Settings.UsernameSettings;

            verzendknop.Clicked += async(object sender, EventArgs e) =>
            {
                laadscherm scherm = new laadscherm();
                await Navigation.PushPopupAsync(scherm);

                await Task.Run(() =>    // by putting this Task.Run only the Activity Indicator is shown otherwise its not shown.  So we have added this.
                {
                    email.SendMail mail = new email.SendMail();
                    mail.EmailVerzenden("Afmelding",
                                        "Afmelding van: " + gebruikersnaam + "\r\n" +
                                        "Voor de les: " + les.naam + " van " + les.dag + "\r\n" +
                                        "Reden: " + reden.Text);
                });

                await Navigation.RemovePopupPageAsync(scherm);
                await DisplayAlert("Gelukt!", "Je hebt je succesvol afgemeld.", "Ok");

                await PopupNavigation.Instance.PopAsync();
            };
            Button terugknop = new Button {
                Text = "Terug", BackgroundColor = Color.FromHex("#FF4081"), TextColor = Color.White
            };

            terugknop.Clicked += (object sender, EventArgs e) =>
            {
                PopupNavigation.Instance.PopAsync();
            };

            Content = new StackLayout {
                Margin   = new Thickness(10, 10, 10, 10),
                Children =
                {
                    new Frame             {
                        BackgroundColor = Color.White, CornerRadius = 5, HasShadow = true, VerticalOptions = LayoutOptions.CenterAndExpand,
                        Content         = new StackLayout
                        {
                            Children =
                            {
                                new Label {
                                    Text = "Afmelden", TextColor = Color.Black, HorizontalTextAlignment = TextAlignment.Center, FontSize = 20
                                },
                                new BoxView()
                                {
                                    Color = Color.Black, HeightRequest = 1
                                },

                                reden,
                                verzendknop,
                                terugknop
                            }
                        }
                    }
                }
            };
        }
Пример #2
0
        public Inschrijf(entiteiten.Les les)
        {
            Title = les.naam;

            voornaam = new Entry();
            voornaam.HorizontalTextAlignment = TextAlignment.Start;
            voornaam.PlaceholderColor        = Color.Gray;
            voornaam.TextColor   = Color.Black;
            voornaam.Placeholder = "Voornaam";

            achternaam = new Entry();
            achternaam.HorizontalTextAlignment = TextAlignment.Start;
            achternaam.PlaceholderColor        = Color.Gray;
            achternaam.TextColor   = Color.Black;
            achternaam.Placeholder = "Achternaam";

            straatnaam = new Entry();
            straatnaam.HorizontalTextAlignment = TextAlignment.Start;
            straatnaam.PlaceholderColor        = Color.Gray;
            straatnaam.TextColor   = Color.Black;
            straatnaam.Placeholder = "Straatnaam";

            huisnummer = new Entry();
            huisnummer.HorizontalTextAlignment = TextAlignment.Start;
            huisnummer.PlaceholderColor        = Color.Gray;
            huisnummer.TextColor   = Color.Black;
            huisnummer.Keyboard    = Keyboard.Numeric;
            huisnummer.Placeholder = "Huisnr";

            geboortedatum_dag = new Entry();
            geboortedatum_dag.HorizontalTextAlignment = TextAlignment.Center;
            geboortedatum_dag.PlaceholderColor        = Color.Gray;
            geboortedatum_dag.TextColor   = Color.Black;
            geboortedatum_dag.Keyboard    = Keyboard.Numeric;
            geboortedatum_dag.Placeholder = "DD";

            geboortedatum_maand = new Entry();
            geboortedatum_maand.HorizontalTextAlignment = TextAlignment.Center;
            geboortedatum_maand.PlaceholderColor        = Color.Gray;
            geboortedatum_maand.TextColor   = Color.Black;
            geboortedatum_maand.Keyboard    = Keyboard.Numeric;
            geboortedatum_maand.Placeholder = "MM";

            geboortedatum_jaar = new Entry();
            geboortedatum_jaar.HorizontalTextAlignment = TextAlignment.Center;
            geboortedatum_jaar.PlaceholderColor        = Color.Gray;
            geboortedatum_jaar.TextColor   = Color.Black;
            geboortedatum_jaar.Keyboard    = Keyboard.Numeric;
            geboortedatum_jaar.Placeholder = "JJJJ";



            postcode = new Entry();
            postcode.HorizontalTextAlignment = TextAlignment.Start;
            postcode.PlaceholderColor        = Color.Gray;
            postcode.TextColor   = Color.Black;
            postcode.Placeholder = "Postcode";

            woonplaats = new Entry();
            woonplaats.HorizontalTextAlignment = TextAlignment.Start;
            woonplaats.PlaceholderColor        = Color.Gray;
            woonplaats.TextColor   = Color.Black;
            woonplaats.Placeholder = "Woonplaats";

            telefoonnummer = new Entry();
            telefoonnummer.HorizontalTextAlignment = TextAlignment.Start;
            telefoonnummer.PlaceholderColor        = Color.Gray;
            telefoonnummer.TextColor   = Color.Black;
            telefoonnummer.Placeholder = "Telefoonnummer (optioneel)";
            telefoonnummer.Keyboard    = Keyboard.Numeric;

            emailadres = new Entry();
            emailadres.HorizontalTextAlignment = TextAlignment.Start;
            emailadres.PlaceholderColor        = Color.Gray;
            emailadres.TextColor   = Color.Black;
            emailadres.Placeholder = "Emailadres";

            rekeningnummer = new Entry();
            rekeningnummer.HorizontalTextAlignment = TextAlignment.Start;
            rekeningnummer.PlaceholderColor        = Color.Gray;
            rekeningnummer.TextColor   = Color.Black;
            rekeningnummer.Placeholder = "Rekeningnummer (IBAN)";

            rekeninghouder = new Entry();
            rekeninghouder.HorizontalTextAlignment = TextAlignment.Start;
            rekeninghouder.PlaceholderColor        = Color.Gray;
            rekeninghouder.TextColor   = Color.Black;
            rekeninghouder.Placeholder = "Naam rekeninghouder";

            geboortedatum      = new Label();
            geboortedatum.Text = "Geboortedatum";
            geboortedatum.HorizontalOptions = LayoutOptions.Start;
            geboortedatum.TextColor         = Color.Black;
            geboortedatum.VerticalOptions   = LayoutOptions.Center;
            geboortedatum.TextColor         = Color.Gray;
            geboortedatum.FontSize          = 17.5;

            controls.CheckBox machtiging_checkbox = new controls.CheckBox();
            machtiging_checkbox.IsChecked = false;
            machtiging_checkbox.CheckedBackgroundImageSource = "checkbox_background";
            machtiging_checkbox.CheckmarkImageSource         = "checkbox_check";
            machtiging_checkbox.BorderImageSource            = "checkbox_border";
            machtiging_checkbox.Title = "Hiermee machtig ik L-Joy Dancefactory om per kwartaal automatisch de contributie af te laten schrijven.";


            controls.CheckBox algemenevoorwaarden_checkbox = new controls.CheckBox();
            algemenevoorwaarden_checkbox.IsChecked = false;
            algemenevoorwaarden_checkbox.CheckedBackgroundImageSource = "checkbox_background";
            algemenevoorwaarden_checkbox.CheckmarkImageSource         = "checkbox_check";
            algemenevoorwaarden_checkbox.BorderImageSource            = "checkbox_border";
            algemenevoorwaarden_checkbox.Title = "Hiermee verklaar ik akkoord te gaan met de Algemene Voorwaarden van L-Joy dancefactory.*";

            controls.CheckBox nieuwsbrief_checkbox = new controls.CheckBox();
            nieuwsbrief_checkbox.IsChecked = false;
            nieuwsbrief_checkbox.CheckedBackgroundImageSource = "checkbox_background";
            nieuwsbrief_checkbox.CheckmarkImageSource         = "checkbox_check";
            nieuwsbrief_checkbox.BorderImageSource            = "checkbox_border";
            nieuwsbrief_checkbox.Title = "Ik wil de nieuwsbrief en info per email ontvangen.";

            controls.CheckBox fotofilmmateriaal_checkbox = new controls.CheckBox();
            fotofilmmateriaal_checkbox.IsChecked = false;
            fotofilmmateriaal_checkbox.CheckedBackgroundImageSource = "checkbox_background";
            fotofilmmateriaal_checkbox.CheckmarkImageSource         = "checkbox_check";
            fotofilmmateriaal_checkbox.BorderImageSource            = "checkbox_border";
            fotofilmmateriaal_checkbox.Title = "Ik geef toestemming voor het maken van foto en filmmateriaal.";

            btn1 = new Button {
                Margin = new Thickness(0, 0, 0, 7.5), Text = "Schrijf je in", HorizontalOptions = LayoutOptions.FillAndExpand, FontAttributes = FontAttributes.Bold, FontSize = 14, BackgroundColor = Color.FromHex("#FF4081"), TextColor = Color.White
            };
            btn1.Clicked += async(object sender, EventArgs e) =>
            {
                if (voornaam.Text == null || achternaam.Text == null || straatnaam.Text == null || huisnummer.Text == null || geboortedatum_dag.Text == null || geboortedatum_maand.Text == null || geboortedatum_jaar.Text == null || postcode.Text == null || woonplaats.Text == null || telefoonnummer.Text == null || emailadres.Text == null || rekeningnummer.Text == null || rekeninghouder.Text == null || "".Equals(voornaam.Text) || "".Equals(achternaam.Text) || "".Equals(straatnaam.Text) || "".Equals(huisnummer.Text) || "".Equals(geboortedatum_dag.Text) || "".Equals(geboortedatum_maand.Text) || "".Equals(geboortedatum_jaar.Text) || "".Equals(postcode.Text) || "".Equals(woonplaats.Text) || "".Equals(telefoonnummer.Text) || "".Equals(emailadres.Text) || "".Equals(rekeningnummer.Text) || "".Equals(rekeninghouder.Text))
                {
                    await DisplayAlert("Mislukt!", "Niet alle velden zijn ingevuld.", "Ok");
                }
                else if (!algemenevoorwaarden_checkbox.IsChecked)
                {
                    await DisplayAlert("Mislukt!", "Om in te schrijven moet u akkoord gaan met de algemene voorwaarden.", "Ok");
                }
                else
                {
                    popups.laadscherm scherm = new popups.laadscherm();
                    await Navigation.PushPopupAsync(scherm);

                    await Task.Run(async() =>     // by putting this Task.Run only the Activity Indicator is shown otherwise its not shown.  So we have added this.
                    {
                        RestService con = new RestService();
                        result          = await con.lesToevoegen(helper.Settings.IdSettings, les.lesid);
                    });

                    if ("0".Equals(result))
                    {
                        await Task.Run(() =>    // by putting this Task.Run only the Activity Indicator is shown otherwise its not shown.  So we have added this.
                        {
                            email.SendMail email = new email.SendMail();
                            //Email naar de gebruiker
                            email.EmailVerzenden("U heeft zich ingeschreven!",
                                                 "U heeft zich succesvol ingeschreven voor " + les.naam + " op " + les.dag + "." + "\r\n" +
                                                 "Wij verwachten u om " + les.tijdstip + " in de les." + "\r\n" + "\r\n" +
                                                 "Met vriendelijke groet," + "\r\n" +
                                                 "L-Joy Dancefactory",
                                                 emailadres.Text, voornaam.Text);

                            //Email naar l-joy
                            email.EmailVerzenden("Inschrijving",
                                                 "Voornaam: " + voornaam.Text + "\r\n" +
                                                 "Achternaam: " + achternaam.Text + "\r\n" +
                                                 "Straatnaam: " + straatnaam.Text + "\r\n" +
                                                 "Huisnummer: " + huisnummer.Text + "\r\n" +
                                                 "Geboortedatum: " + geboortedatum_dag.Text + " - " + geboortedatum_maand.Text + " - " + geboortedatum_jaar.Text + "\r\n" +
                                                 "Postcode: " + postcode.Text + "\r\n" +
                                                 "Woonplaats: " + woonplaats.Text + "\r\n" +
                                                 "Telefoonnummer: " + telefoonnummer.Text + "\r\n" +
                                                 "Email: " + emailadres.Text + "\r\n" +
                                                 "Rekeningnummer: " + rekeningnummer.Text + "\r\n" +
                                                 "Rekeninghouder: " + rekeninghouder.Text + "\r\n" +
                                                 "Les: " + les.naam + "\r\n" +
                                                 "Docent: " + les.docent + "\r\n" +
                                                 "Dag: " + les.dag + "\r\n" +
                                                 "Tijdstip: " + les.tijdstip + "\r\n" +
                                                 "Machtiging: " + machtiging_checkbox.IsChecked + "\r\n" +
                                                 "Info en nieuwsbrief: " + nieuwsbrief_checkbox.IsChecked + "\r\n" +
                                                 "Fotomateriaal: " + fotofilmmateriaal_checkbox.IsChecked);
                        });

                        await Navigation.RemovePopupPageAsync(scherm);
                        await DisplayAlert("Gelukt!", "Je hebt je succesvol ingeschreven.", "Ok");
                    }
                    else
                    {
                        await Navigation.RemovePopupPageAsync(scherm);
                        await DisplayAlert("Mislukt!", "Er is iets fout gegaan, probeer het nog eens.", "Ok");
                    }
                }
            };

            algemenevoorwaarden_link.Clicked += (object sender, EventArgs e) =>
            {
                Navigation.PushPopupAsync(new popups.algemenevoorwaarden());
            };


            Grid sGrid = new Grid();

            sGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(240)
            });
            sGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            sGrid.Children.Add(straatnaam, 0, 0);
            sGrid.Children.Add(huisnummer, 1, 0);

            Grid gGrid = new Grid();

            gGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(150)
            });
            gGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            gGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            gGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            gGrid.Children.Add(geboortedatum, 0, 0);
            gGrid.Children.Add(geboortedatum_dag, 1, 0);
            gGrid.Children.Add(geboortedatum_maand, 2, 0);
            gGrid.Children.Add(geboortedatum_jaar, 3, 0);



            Content = new ScrollView
            {
                Content = new StackLayout
                {
                    Margin   = new Thickness(10, 10, 10, 10),
                    Children =
                    {
                        new Frame             {
                            Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.FromHex("#FF4081"), Content = new StackLayout{
                                Children =
                                {
                                    new Label {
                                        Text = "Persoonlijke gegevens", HorizontalTextAlignment = TextAlignment.Center, TextColor = Color.White, FontSize = 18, FontAttributes = FontAttributes.Bold
                                    },
                                    new BoxView()
                                    {
                                        Color = Color.White, HeightRequest = 1
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                voornaam
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                achternaam
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                sGrid
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                postcode
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                woonplaats
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                telefoonnummer
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                emailadres
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                gGrid
                                            }
                                        }, HasShadow = true,
                                    }
                                }
                            }, HasShadow = true,
                        },
                        new Frame             {
                            Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.FromHex("#FF4081"), Content = new StackLayout{
                                Children =
                                {
                                    new Label {
                                        Text = "Bankgegevens", HorizontalTextAlignment = TextAlignment.Center, TextColor = Color.White, FontSize = 18, FontAttributes = FontAttributes.Bold
                                    },
                                    new BoxView()
                                    {
                                        Color = Color.White, HeightRequest = 1
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                rekeningnummer
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                rekeninghouder
                                            }
                                        }, HasShadow = true,
                                    }
                                }
                            }, HasShadow = true,
                        },
                        new Frame             {
                            Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.FromHex("#FF4081"), Content = new StackLayout{
                                Children =
                                {
                                    new Label {
                                        Text = "Toestemmingen", HorizontalTextAlignment = TextAlignment.Center, TextColor = Color.White, FontSize = 18, FontAttributes = FontAttributes.Bold
                                    },
                                    new BoxView()
                                    {
                                        Color = Color.White, HeightRequest = 1
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                machtiging_checkbox
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                algemenevoorwaarden_checkbox
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                nieuwsbrief_checkbox
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                fotofilmmateriaal_checkbox
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Label {
                                        Text = "* verplichte velden	", TextColor = Color.White
                                    }
                                }
                            }, HasShadow = true,
                        },
                        algemenevoorwaarden_link,
                        btn1
                    }
                }
            };
        }
Пример #3
0
        public Proefles(entiteiten.Les les)
        {
            Title = les.naam;

            voornaam = new Entry();
            voornaam.HorizontalTextAlignment = TextAlignment.Start;
            voornaam.PlaceholderColor        = Color.Gray;
            voornaam.TextColor   = Color.Black;
            voornaam.Placeholder = "Voornaam";

            achternaam = new Entry();
            achternaam.HorizontalTextAlignment = TextAlignment.Start;
            achternaam.PlaceholderColor        = Color.Gray;
            achternaam.TextColor   = Color.Black;
            achternaam.Placeholder = "Achternaam";

            straatnaam = new Entry();
            straatnaam.HorizontalTextAlignment = TextAlignment.Start;
            straatnaam.PlaceholderColor        = Color.Gray;
            straatnaam.TextColor   = Color.Black;
            straatnaam.Placeholder = "Straatnaam";

            huisnummer = new Entry();
            huisnummer.HorizontalTextAlignment = TextAlignment.Start;
            huisnummer.PlaceholderColor        = Color.Gray;
            huisnummer.TextColor   = Color.Black;
            huisnummer.Keyboard    = Keyboard.Numeric;
            huisnummer.Placeholder = "Huisnr";

            geboortedatum_dag = new Entry();
            geboortedatum_dag.HorizontalTextAlignment = TextAlignment.Center;
            geboortedatum_dag.PlaceholderColor        = Color.Gray;
            geboortedatum_dag.TextColor   = Color.Black;
            geboortedatum_dag.Keyboard    = Keyboard.Numeric;
            geboortedatum_dag.Placeholder = "DD";

            geboortedatum_maand = new Entry();
            geboortedatum_maand.HorizontalTextAlignment = TextAlignment.Center;
            geboortedatum_maand.PlaceholderColor        = Color.Gray;
            geboortedatum_maand.TextColor   = Color.Black;
            geboortedatum_maand.Keyboard    = Keyboard.Numeric;
            geboortedatum_maand.Placeholder = "MM";

            geboortedatum_jaar = new Entry();
            geboortedatum_jaar.HorizontalTextAlignment = TextAlignment.Center;
            geboortedatum_jaar.PlaceholderColor        = Color.Gray;
            geboortedatum_jaar.TextColor   = Color.Black;
            geboortedatum_jaar.Keyboard    = Keyboard.Numeric;
            geboortedatum_jaar.Placeholder = "JJJJ";



            postcode = new Entry();
            postcode.HorizontalTextAlignment = TextAlignment.Start;
            postcode.PlaceholderColor        = Color.Gray;
            postcode.TextColor   = Color.Black;
            postcode.Placeholder = "Postcode";

            woonplaats = new Entry();
            woonplaats.HorizontalTextAlignment = TextAlignment.Start;
            woonplaats.PlaceholderColor        = Color.Gray;
            woonplaats.TextColor   = Color.Black;
            woonplaats.Placeholder = "Woonplaats";

            telefoonnummer = new Entry();
            telefoonnummer.HorizontalTextAlignment = TextAlignment.Start;
            telefoonnummer.PlaceholderColor        = Color.Gray;
            telefoonnummer.TextColor   = Color.Black;
            telefoonnummer.Placeholder = "Telefoonnummer (optioneel)";
            telefoonnummer.Keyboard    = Keyboard.Numeric;

            emailadres = new Entry();
            emailadres.HorizontalTextAlignment = TextAlignment.Start;
            emailadres.PlaceholderColor        = Color.Gray;
            emailadres.TextColor   = Color.Black;
            emailadres.Placeholder = "Emailadres";

            geboortedatum      = new Label();
            geboortedatum.Text = "Geboortedatum";
            geboortedatum.HorizontalOptions = LayoutOptions.Start;
            geboortedatum.TextColor         = Color.Black;
            geboortedatum.VerticalOptions   = LayoutOptions.Center;
            geboortedatum.TextColor         = Color.Gray;
            geboortedatum.FontSize          = 17.5;

            btn1 = new Button {
                Margin = new Thickness(0, 0, 0, 7.5), Text = "Meld je aan", HorizontalOptions = LayoutOptions.FillAndExpand, FontAttributes = FontAttributes.Bold, FontSize = 14, BackgroundColor = Color.FromHex("#FF4081"), TextColor = Color.White
            };
            btn1.Clicked += async(object sender, EventArgs e) =>
            {
                if (voornaam.Text == null || achternaam.Text == null || straatnaam.Text == null || huisnummer.Text == null || geboortedatum_dag.Text == null || geboortedatum_maand.Text == null || geboortedatum_jaar.Text == null || postcode.Text == null || woonplaats.Text == null || telefoonnummer.Text == null || emailadres.Text == null || "".Equals(voornaam.Text) || "".Equals(achternaam.Text) || "".Equals(straatnaam.Text) || "".Equals(huisnummer.Text) || "".Equals(geboortedatum_dag.Text) || "".Equals(geboortedatum_maand.Text) || "".Equals(geboortedatum_jaar.Text) || "".Equals(postcode.Text) || "".Equals(woonplaats.Text) || "".Equals(telefoonnummer.Text) || "".Equals(emailadres.Text))
                {
                    await DisplayAlert("Mislukt!", "Niet alle velden zijn ingevuld.", "Ok");
                }
                else
                {
                    popups.laadscherm scherm = new popups.laadscherm();
                    await Navigation.PushPopupAsync(scherm);

                    await Task.Run(() =>    // by putting this Task.Run only the Activity Indicator is shown otherwise its not shown.  So we have added this.
                    {
                        email.SendMail email = new email.SendMail();
                        //Email naar de gebruiker
                        email.EmailVerzenden("U heeft zich aangemeld voor een proefles!",
                                             "U heeft zich succesvol aangemeld voor een proefles " + les.naam + " op " + les.dag + "." + "\r\n" +
                                             "Wij verwachten u om " + les.tijdstip + " in de les." + "\r\n" + "\r\n" +
                                             "Met vriendelijke groet," + "\r\n" +
                                             "L-Joy Dancefactory",
                                             emailadres.Text, voornaam.Text);

                        //Email naar l-joy
                        email.EmailVerzenden("Aanmelding proefles",
                                             "Voornaam: " + voornaam.Text + "\r\n" +
                                             "Achternaam: " + achternaam.Text + "\r\n" +
                                             "Straatnaam: " + straatnaam.Text + "\r\n" +
                                             "Huisnummer: " + huisnummer.Text + "\r\n" +
                                             "Geboortedatum: " + geboortedatum_dag.Text + "-" + geboortedatum_maand.Text + "-" + geboortedatum_jaar.Text + "\r\n" +
                                             "Postcode: " + postcode.Text + "\r\n" +
                                             "Woonplaats: " + woonplaats.Text + "\r\n" +
                                             "Telefoonnummer: " + telefoonnummer.Text + "\r\n" +
                                             "Email: " + emailadres.Text + "\r\n" +
                                             "Les: " + les.naam + "\r\n" +
                                             "Dag: " + les.dag + "\r\n" +
                                             "Tijdstip: " + les.tijdstip + "\r\n" +
                                             "Docent: " + les.docent);
                    });

                    await Navigation.RemovePopupPageAsync(scherm);
                    await DisplayAlert("Gelukt!", "Je hebt je succesvol ingeschreven voor een proefles.", "Ok");
                }
            };

            Grid sGrid = new Grid();

            sGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(240)
            });
            sGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            sGrid.Children.Add(straatnaam, 0, 0);
            sGrid.Children.Add(huisnummer, 1, 0);

            Grid gGrid = new Grid();

            gGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(150)
            });
            gGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            gGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            gGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            gGrid.Children.Add(geboortedatum, 0, 0);
            gGrid.Children.Add(geboortedatum_dag, 1, 0);
            gGrid.Children.Add(geboortedatum_maand, 2, 0);
            gGrid.Children.Add(geboortedatum_jaar, 3, 0);



            Content = new ScrollView
            {
                Content = new StackLayout
                {
                    Margin   = new Thickness(10, 10, 10, 10),
                    Children =
                    {
                        new Frame             {
                            Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.FromHex("#FF4081"), Content = new StackLayout{
                                Children =
                                {
                                    new Label {
                                        Text = "Persoonlijke gegevens", HorizontalTextAlignment = TextAlignment.Center, TextColor = Color.White, FontSize = 18, FontAttributes = FontAttributes.Bold
                                    },
                                    new BoxView()
                                    {
                                        Color = Color.White, HeightRequest = 1
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                voornaam
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                achternaam
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                sGrid
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                postcode
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                woonplaats
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                telefoonnummer
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                emailadres
                                            }
                                        }, HasShadow = true,
                                    },
                                    new Frame {
                                        Padding = 7.5, CornerRadius = 5, BackgroundColor = Color.White, Content = new StackLayout{
                                            Children =
                                            {
                                                gGrid
                                            }
                                        }, HasShadow = true,
                                    }
                                }
                            }, HasShadow = true,
                        },
                        btn1
                    }
                }
            };
        }