Ejemplo n.º 1
0
		public void UpdateCal(){
			if (!SyncCalendar) {
				SyncCalendar = true;

				Note n;
				foreach (String[] e in getEvents()) {
					//Debug.WriteLine (e);
					/*
					 * 0=id
					 * 1=title
					 * 2=dstart
					 * 3=dend
					 * 4=desc
					 * 5=loc
					 */
					n = new Note (e [1], mstoDateTime (e [2]), e [5], e [4], "");
					n.CalId = int.Parse (e [0]);
					Debug.WriteLine (n.titleText);
					Debug.WriteLine (n.TimeStamp);
					database.CalendarInsertOrUpdateNote (n);
				}

				SyncCalendar = false;
			}
		}
Ejemplo n.º 2
0
 public int CalendarInsertOrUpdateNote(Note note)
 {
     if (database.Table<Note> ().Where (x => x.CalId == note.CalId).Count () > 0) {
         var n = database.Table<Note> ().First (t => t.CalId == note.CalId);
         note.NoteId = n.NoteId;
         note.Attendees = n.Attendees;
     }
     return InsertOrUpdateNote (note);
 }
Ejemplo n.º 3
0
 public int InsertOrUpdateNote(Note note)
 {
     return database.Table<Note> ().Where (x => x.NoteId == note.NoteId).Count () > 0
         ? database.Update (note) : database.Insert (note);
 }