Example #1
0
        public static List <Notes> Sync(NoteStore noteStore)
        {
            var noteToSyncFromServer  = GetDataFromServer(noteStore);
            var notesToSyncFromClient = noteStore.LstNotes;

            foreach (var note in notesToSyncFromClient)
            {
                dbServer.UpsertNotes(note);
            }
            List <Notes> returnList = GetServerDatatoSend(noteToSyncFromServer, notesToSyncFromClient);

            dbServer.UpdateSyncTimeStamp(noteStore);
            return(returnList);
        }
Example #2
0
        private void SaveNote()
        {
            Notes newNote;

            if (!dicNotes.TryGetValue(selectedNote, out newNote))
            {
                newNote = new Notes();
            }
            newNote.Title = txtTitle.Text;
            newNote.Body.Append(NotesBody.Text);
            dbClient.UpsertNotes(newNote);
            isEdited = false;
            if (dicNotes.ContainsKey(newNote.NoteGuid))
            {
                dicNotes[newNote.NoteGuid] = newNote;
            }
            else
            {
                dicNotes.Add(newNote.NoteGuid, newNote);
            }

            UpdateGridView(dicNotes);
        }