예제 #1
0
        private void btnInsertclicked2(object sender, EventArgs e)
        {
            var       db = MoneyItemDatabase.getDatabase();
            MoneyItem m  = new MoneyItem()
            {
                ID = 20, Name = "HELLO", Done = false
            };

            db.SaveItemAsync(m);
            DisplayAlert("SQLite", "追加されたよ", "OK");
        }
        public Task <int> SaveItemAsync(MoneyItem item)

        {
            if (item.ID != 0)

            {
                return(database.UpdateAsync(item));
            }

            else

            {
                return(database.InsertAsync(item));
            }
        }
        public Task <int> DeleteItemAsync(MoneyItem item)

        {
            return(database.DeleteAsync(item));
        }