private async void tourokuClicked(object sender, EventArgs e) { try { base.OnAppearing(); var result = await App.Database1.GetItemsAsync(); /*foreach (var loc in result) * { * await App.Database1.DeleteItemAsync(loc); * }*/ int num; num = int.Parse(kingaku.Text); var mokuhyou = new goalmoney1() { goalmoney = num }; Save(mokuhyou); //await DisplayAlert("登録しました","OK",""); } catch (Exception) { DisplayAlert("Alert", "正しい値を入力してください。", "OK"); } }
/*public Task<List<LocationItem>> GetItemDay(System.Collections.Generic.List<System.DateTime> day) * { * var DayList = day; * DateTime Daykd = day[0]; * return database.QueryAsync<LocationItem>("SELECT * FROM [LocationItem] WHERE Day = " + Daykd); * } * * public Task<List<LocationItem>> GetItemNameAsync(String Name, DateTime dates) * { * return database.QueryAsync<LocationItem>("SELECT * FROM [LocationItem] WHERE Name = " + Name + "Day = " + dates); * }*/ public Task <int> SaveItemAsync(goalmoney1 item) { if (item.ID != 0) { return(database.UpdateAsync(item)); } else { return(database.InsertAsync(item)); } }
public async void Save(goalmoney1 item1) { await App.Database1.SaveItemAsync(item1); await DisplayAlert("DATA", "登録しました", "OK"); }
public async void Delete(goalmoney1 item1) { await App.Database1.DeleteItemAsync(item1); await DisplayAlert("削除", "", "OK"); }
public Task <int> DeleteItemAsync(goalmoney1 item) { return(database.DeleteAsync(item)); }