Beispiel #1
0
 public Task <int> SaveItemAsync(DBCustomers item)
 {
     if (item.ID != 0)
     {
         return(database.UpdateAsync(item));
     }
     else
     {
         return(database.InsertAsync(item));
     }
 }
Beispiel #2
0
        private async void Register_Clicked(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(Username.Text) && (!string.IsNullOrWhiteSpace(Password1.Text) && !string.IsNullOrWhiteSpace(Password2.Text)))
            {
                if (Password1.Text == Password2.Text)
                {
                    var Customer = new DBCustomers();
                    Customer.Name     = Username.Text;
                    Customer.Password = Password1.Text;
                    await App.Database.SaveItemAsync(Customer);

                    await Navigation.PopAsync();
                }
                else
                {
                    await DisplayAlert("Failed to register", "De wachtwoorden zijn niet identiek.", "OK");
                }
            }
            else
            {
                await DisplayAlert("Failed to register", "Niet alle velden zijn ingevuld.", "OK");
            }
        }
Beispiel #3
0
 public Task <int> DeleteItemAsync(DBCustomers item)
 {
     return(database.DeleteAsync(item));
 }