public DataServiceCommon()
 {
     dsNote = new DataServiceNote();
     dsPicture = new DataServicePicture();
     dsPoi = new DataServicePoi();
     dsTrip = new DataServiceTrip();
 }
Ejemplo n.º 2
0
 public DataServiceCommon()
 {
     dsNote    = new DataServiceNote();
     dsPicture = new DataServicePicture();
     dsPoi     = new DataServicePoi();
     dsTrip    = new DataServiceTrip();
 }
        public NoteViewModel(INavigationService navigationService)
        {
            Messenger.Default.Register<Tuple<int, List<Note>>>(this,
             tuple =>
             {
             DataServiceNote dsNote = new DataServiceNote();
             this.Note = dsNote.getNoteById(tuple.Item1);
             NoteList = tuple.Item2;
             TripId = Note.Trip.Id;
             });

            Messenger.Default.Register<int>(this,
            note =>
            {
            DataServiceNote dsNote = new DataServiceNote();
            this.Note = dsNote.getNoteById(note);
            TripId = Note.Trip.Id;
            });
            this._navigationService = navigationService;
        }
 /// <summary>
 /// Supprimer une note
 /// </summary>
 public void DeleteNote()
 {
     DataServiceNote dsNote = new DataServiceNote();
     dsNote.DeleteNote(Note);
     GoBackCommand.Execute(null);
 }
 private void UpdateExistingNote()
 {
     DataServiceNote dsNote = new DataServiceNote();
     dsNote.UpdateNote(Note);
 }
 private Note GetNoteInDB(int noteId)
 {
     DataServiceNote dsNote = new DataServiceNote();
     return dsNote.getNoteById(noteId);
 }
        private void AddNoteInDB()
        {
            // Workaround to retrieve the REAL associated trip.
            // When the app is tombstoned, it creates a copy of the current trip.
            // So when comes the time to save the note in the database, it saves a new trip
            // and duplicate all existing notes attached to this new trip !
            // The result is an Absolute Mess...

            // Calling the current trip method make sure that we deal with the correct data
            // and not simply a copy.
            Note.Trip.Notes.Add(Note);

            DataServiceNote dsNote = new DataServiceNote();
            dsNote.addNote(Note);
        }