示例#1
0
 private void InsertClicked()
 {
     db.DeleteAll <DBList>();
     for (int i = 0; i < 300; i++)
     {
         DBList list = new DBList();
         list.ID      = i;
         list.Content = "Item " + i;
         db.Insert(list);
         if (i == 299)
         {
             foreach (var entry in db.Table <DBList>())
             {
                 dbList.Add(new DBList {
                     ID = entry.ID, Content = entry.Content
                 });
             }
         }
     }
 }
示例#2
0
 private void DeleteBtn_Click(object sender, RoutedEventArgs e)
 {
     listView.Items.Clear();
     connection.DeleteAll <AddTrip>();
 }
        /// <summary>
        /// Deletes every card in genereatedCards.
        /// </summary>
        public void ClearGeneratedCards()
        {
            using (SQLite.Net.SQLiteConnection db = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.path))
            {
                int size = db.Table<GeneratedCards>().Count();

                if (size > 0)
                {
                    IEnumerable<GeneratedCards> entityQuery = db.Table<GeneratedCards>().ToList();
                    db.DeleteAll<GeneratedCards>();
                }
            }

        }
示例#4
0
 public void DeleteAll <T>()
 {
     _conexao.DeleteAll <T>();
 }