コード例 #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");
        }
コード例 #2
0
        public static MoneyItemDatabase getDatabase()

        {
            if (db == null)

            {
                db = new MoneyItemDatabase(DependencyService.Get <IFileHelper>().GetLocalFilePath("MoneyItemSQLite.db3"));
            }

            return(db);
        }
コード例 #3
0
        private async void btnListClicked(object sender, EventArgs e)
        {
            var db = MoneyItemDatabase.getDatabase();

            List <MoneyItem> itemList;

            //            itemList = await db.GetItemsNotDoneAsync();
            itemList = await db.GetItemsAsync();

            int size = itemList.Count;

            await DisplayAlert("SQLite", size + "件のデータ", "OK");
        }