private async void SaveUserandLinktoErac(Erac erac, EracUser user)
        {
            await App.Database.SaveEracUserAsync(user);

            erac.EracUsers.Add(user);
            await App.Database.PopulateEracEracQues(erac);
        }
        private async void OnAddClicked(object sender, EventArgs e)
        {
            if (Name.Text == null || NRIC.Text == null || Rank.Text == null)
            {
                await DisplayAlert("Missing Information", "Some Fields are not filled in", "Ok");

                return;
            }
            else
            {
                Erac     erac = (Erac)BindingContext;
                EracUser user = new EracUser();
                user.Name = Name.Text.ToUpper();
                user.Nric = NRIC.Text.ToUpper();
                user.Rank = Rank.Text.ToUpper();
                SaveUserandLinktoErac(erac, user);
                await Navigation.PopModalAsync();
            }
        }
Esempio n. 3
0
 public Task <int> DeleteEracUserAsync(EracUser eracUser)
 {
     return(_database.DeleteAsync(eracUser));
 }
Esempio n. 4
0
 public Task <int> SaveEracUserAsync(EracUser eracUser)
 {
     return(_database.InsertAsync(eracUser));
 }