Пример #1
0
        private void OnClickSend(object sender, EventArgs e)
        {
            FieldCheckerMethod a = new FieldCheckerMethod();

            a.AddBericht(replyText.Text, Onderwerp, Ontvanger);
            App.Current.MainPage = From;
        }
Пример #2
0
        public bool CheckCredentials(string email, string pass)
        {
            var a      = new FieldCheckerMethod();
            var client = new GebruikerClient();

            if (a.IsFilled(email) && a.IsFilled(pass))
            {
                try
                {
                    Gebruiker gebruiker = client.Get(email);
                    if (gebruiker != null && gebruiker.Wachtwoord == pass)
                    {
                        Xamarin.Forms.Application.Current.Properties["loggedIn"] = gebruiker;
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                catch (AggregateException)
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
        public void OnClickPlaceOffer(Object sender, EventArgs e)
        {
            var c = new FieldCheckerMethod();

            if (c.IsFilled(price.Text) && c.IsFilled(title.Text) && c.IsFilled(desc.Text))
            {
                c.AddAanbieding(title.Text, desc.Text, float.Parse(price.Text), (Gebruiker)Application.Current.Properties["loggedIn"]);
                App.Current.MainPage = new OfferPage();
            }
            else
            {
                DisplayAlert("Alert", "Je hebt niet alle velden ingevoerd.", "Oke");
            }
        }
Пример #4
0
        public void OnClickHub(object sender, EventArgs e)
        {//Sign-in / login brings you here
            var b = new Login();
            var a = new FieldCheckerMethod();

            if (b.CheckCredentials(email.Text, pass.Text) && a.IsValidEmail(email.Text))
            {
                App.Current.MainPage = new HubPage();
            }
            if (!a.IsValidEmail(email.Text))
            {
                DisplayAlert("Alert", "Vul een geldige e-mail in.", "Oke");
            }
            if (!b.CheckCredentials(email.Text, pass.Text))
            {
                DisplayAlert("Alert", "Email en/of wachtwoord komen niet overeen.", "Oke");
            }
        }
Пример #5
0
        public void OnClickHub(object sender, EventArgs e)
        {
            var a = new FieldCheckerMethod();

            if (a.IsFilled(email.Text) && a.IsFilled(voornaam.Text) && a.IsFilled(achternaam.Text) && a.IsFilled(pass1.Text) && a.PassEqual(pass1.Text, pass2.Text) && a.IsValidEmail(email.Text))
            {
                a.AddGebruiker(voornaam.Text, tussen.Text, achternaam.Text, email.Text, pass1.Text, pass2.Text);
                App.Current.MainPage = new MainPage();
            }
            if (!a.IsValidEmail(email.Text))
            {
                DisplayAlert("Alert", "Vul een geldige e-mail in.", "Oke");
            }
            if (!(a.IsFilled(email.Text) && a.IsFilled(voornaam.Text) && a.IsFilled(achternaam.Text) && a.IsFilled(pass1.Text) && a.PassEqual(pass1.Text, pass2.Text)))
            {
                DisplayAlert("Alert", "Je hebt niet alle verplichte velden ingevuld!", "Oke");
            }
        }
Пример #6
0
        async void OnUpload(object sender, EventArgs e)
        {
            try
            {
                FileData filedata = await CrossFilePicker.Current.PickFile();

                var a = new FieldCheckerMethod();
                a.AddFoto(filedata.FileName, "Entry field Titel", "Entry field Beschrijving", filedata.DataArray);

                // the dataarray of the file will be found in filedata.DataArray
                // file name will be found in filedata.FileName;
                //etc etc.
            }
            catch (Exception ex)
            {
                await DisplayAlert("Alert", $"Error: {ex}", "Oke");

                //ExceptionHandler.ShowException(ex.Message);
            }
        }