Exemplo n.º 1
0
        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");
            }
        }
Exemplo n.º 2
0
        /*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));
            }
        }
Exemplo n.º 3
0
        public async void Save(goalmoney1 item1)
        {
            await App.Database1.SaveItemAsync(item1);

            await DisplayAlert("DATA", "登録しました", "OK");
        }
Exemplo n.º 4
0
        public async void Delete(goalmoney1 item1)
        {
            await App.Database1.DeleteItemAsync(item1);

            await DisplayAlert("削除", "", "OK");
        }
Exemplo n.º 5
0
 public Task <int> DeleteItemAsync(goalmoney1 item)
 {
     return(database.DeleteAsync(item));
 }