public void UpdateObject(Notes note) { using (var db = new SQLiteConnection(dbPath)) { // var existing = db.Query<Notes>("select * from Notes where id = " + note.ID).FirstOrDefault(); db.RunInTransaction(() => { db.Update(note); }); } }
public new ObservableCollection<Notes> GetListObject() { using (var db = new SQLiteConnection(ProcessDataBase.dbPath)) { Notes temp = new Notes(); List<Notes> obCollection = db.Table<Notes>().ToList<Notes>(); for (int i = 0,j=obCollection.Count-1; i < obCollection.Count; ++i) { if (i < obCollection.Count / 2) { temp = obCollection[i]; obCollection[i] = obCollection[j]; obCollection[j] = temp; --j; } else break; } ObservableCollection<Notes> listNote = new ObservableCollection<Notes>(obCollection); return listNote; } }
private void NoteItem_Click(object sender, ItemClickEventArgs e) { notes = e.ClickedItem as Notes; this.Frame.Navigate(typeof(ViewNote)); }
private void CreateNote_Tapped(object sender, TappedRoutedEventArgs e) { notes = new Notes(); this.Frame.Navigate(typeof(ViewNote)); }