Exemplo n.º 1
0
 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);
         });
     }
 }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
 private void NoteItem_Click(object sender, ItemClickEventArgs e)
 {
     notes = e.ClickedItem as Notes;
     this.Frame.Navigate(typeof(ViewNote));
 }
Exemplo n.º 4
0
 private void CreateNote_Tapped(object sender, TappedRoutedEventArgs e)
 {
     notes = new Notes();
     this.Frame.Navigate(typeof(ViewNote));
 }