Exemple #1
0
        public string UpdateText(INoteCore note, string text)
        {
            var dummyNote = backend.GetNoteBy(note.Id);

            dummyNote.Text = text;
            return(text);
        }
        void UpdateNote(INoteCore note, string title, string text)
        {
            var rtmNote = backend.Rtm.NotesEdit(backend.Timeline, note.Id, note.Title, note.Text);

            note.Title = rtmNote.Title;
            note.Text  = rtmNote.Text;
        }
Exemple #3
0
        void INoteCollectionRepo.AddNew(ITaskCore task, INoteCore note)
        {
            var dummyTask = backend.GetTaskBy(task.Id);
            var dummyNote = new DummyNote(note.Text);

            dummyTask.TaskNotes.Add(dummyNote);
        }
Exemple #4
0
        void INoteCollectionRepo.Remove(ITaskCore container, INoteCore item)
        {
            string taskSeriesId, taskId;

            backend.DecodeTaskId(container, out taskSeriesId, out taskId);
            backend.Rtm.NotesDelete(backend.Timeline, item.Id);
        }
Exemple #5
0
        void INoteCollectionRepo.Remove(ITaskCore task, INoteCore note)
        {
            var dummyTask = backend.GetTaskBy(task.Id);
            var dummyNote = dummyTask.TaskNotes.Single(
                n => n.Id.ToString() == note.Id);

            dummyTask.TaskNotes.Remove(dummyNote);
        }
        void NoteCollectionRepo.Remove(ITaskCore container, INoteCore item)
        {
            var command = "DELETE FROM Notes WHERE ID=@id;";

            using (var cmd = new SqliteCommand(database.Connection)) {
                cmd.CommandText = command;
                cmd.Parameters.AddIdParameter(item);
                cmd.ExecuteNonQuery();
            }
        }
Exemple #7
0
 string INoteRepository.UpdateTitle(INoteCore note, string title)
 {
     var command = "UPDATE Notes SET Name=@name WHERE ID=@id";
     using (var cmd = new SqliteCommand (database.Connection)) {
         cmd.CommandText = command;
         cmd.Parameters.AddWithValue ("@name", title);
         cmd.Parameters.AddIdParameter (note);
         cmd.ExecuteNonQuery ();
     }
     return title;
 }
Exemple #8
0
 string INoteRepository.UpdateText(INoteCore note, string text)
 {
     var command = "UPDATE Notes SET Text=@text WHERE ID=@id";
     using (var cmd = new SqliteCommand (database.Connection)) {
         cmd.CommandText = command;
         cmd.Parameters.AddWithValue ("@text", text);
         cmd.Parameters.AddIdParameter (note);
         cmd.ExecuteNonQuery ();
     }
     return text;
 }
        string INoteRepository.UpdateText(INoteCore note, string text)
        {
            var command = "UPDATE Notes SET Text=@text WHERE ID=@id";

            using (var cmd = new SqliteCommand(database.Connection)) {
                cmd.CommandText = command;
                cmd.Parameters.AddWithValue("@text", text);
                cmd.Parameters.AddIdParameter(note);
                cmd.ExecuteNonQuery();
            }
            return(text);
        }
Exemple #10
0
        void INoteCollectionRepo.AddNew(ITaskCore container, INoteCore item)
        {
            var    taskList = container.TaskListContainers.First();
            string taskSeriesId, taskId;

            backend.DecodeTaskId(container, out taskSeriesId, out taskId);
            var note = backend.Rtm.NotesAdd(backend.Timeline, taskList.Id,
                                            taskSeriesId, taskId, item.Title, item.Text);

            item.Text  = note.Text;
            item.Title = note.Title;
            item.SetId(note.ID);
        }
        void NoteCollectionRepo.AddNew(ITaskCore container, INoteCore item)
        {
            var command = "INSERT INTO Notes (Name, Text, Task)" +
                          "VALUES (@name, @text, @id); SELECT last_insert_rowid();";

            using (var cmd = new SqliteCommand(database.Connection)) {
                cmd.CommandText = command;
                cmd.Parameters.AddWithValue("@name", item.Title);
                cmd.Parameters.AddWithValue("@text", item.Text);
                cmd.Parameters.AddIdParameter(container);
                var id = cmd.ExecuteScalar().ToString();
                item.SetId(id);
            }
        }
Exemple #12
0
 void INoteCollectionRepo.Add(ITaskCore task, INoteCore note)
 {
     throw new NotSupportedException (
         "Notes can only belong to one task.");
 }
Exemple #13
0
 void NoteCollectionRepo.Remove(ITaskCore container, INoteCore item)
 {
     var command = "DELETE FROM Notes WHERE ID=@id;";
     using (var cmd = new SqliteCommand (database.Connection)) {
         cmd.CommandText = command;
         cmd.Parameters.AddIdParameter (item);
         cmd.ExecuteNonQuery ();
     }
 }
Exemple #14
0
 void NoteCollectionRepo.AddNew(ITaskCore container, INoteCore item)
 {
     var command = "INSERT INTO Notes (Name, Text, Task)" +
         "VALUES (@name, @text, @id); SELECT last_insert_rowid();";
     using (var cmd = new SqliteCommand (database.Connection)) {
         cmd.CommandText = command;
         cmd.Parameters.AddWithValue ("@name", item.Title);
         cmd.Parameters.AddWithValue ("@text", item.Text);
         cmd.Parameters.AddIdParameter (container);
         var id = cmd.ExecuteScalar ().ToString ();
         item.SetId (id);
     }
 }
Exemple #15
0
 void NoteCollectionRepo.Add(ITaskCore container, INoteCore item)
 {
     throw new NotSupportedException (
         "A note can only belong to a single task.");
 }
Exemple #16
0
 public string UpdateTitle(INoteCore note, string title)
 {
     return null;
 }
Exemple #17
0
 public string UpdateText(INoteCore note, string text)
 {
     var dummyNote = backend.GetNoteBy (note.Id);
     dummyNote.Text = text;
     return text;
 }
 string INoteRepository.UpdateText(INoteCore note, string text)
 {
     UpdateNote(note, note.Title, text);
     return(note.Text);
 }
Exemple #19
0
 void INoteCollectionRepo.AddNew(ITaskCore container, INoteCore item)
 {
     var taskList = container.TaskListContainers.First ();
     string taskSeriesId, taskId;
     backend.DecodeTaskId (container, out taskSeriesId, out taskId);
     var note = backend.Rtm.NotesAdd (backend.Timeline, taskList.Id,
         taskSeriesId, taskId, item.Title, item.Text);
     item.Text = note.Text;
     item.Title = note.Title;
     item.SetId (note.ID);
 }
 void NoteCollectionRepo.Add(ITaskCore container, INoteCore item)
 {
     throw new NotSupportedException(
               "A note can only belong to a single task.");
 }
Exemple #21
0
 public string UpdateTitle(INoteCore note, string title)
 {
     UpdateNote (note, title, note.Text);
     return note.Title;
 }
Exemple #22
0
 public INoteCore UpdateNote(ITaskCore task, INoteCore note)
 {
     throw new NotSupportedException (
         "This backend supports multiple notes.");
 }
Exemple #23
0
 void INoteCollectionRepo.Remove(ITaskCore container, INoteCore item)
 {
     string taskSeriesId, taskId;
     backend.DecodeTaskId (container, out taskSeriesId, out taskId);
     backend.Rtm.NotesDelete (backend.Timeline, item.Id);
 }
Exemple #24
0
 void INoteCollectionRepo.AddNew(ITaskCore task, INoteCore note)
 {
     var dummyTask = backend.GetTaskBy (task.Id);
     var dummyNote = new DummyNote (note.Text);
     dummyTask.TaskNotes.Add (dummyNote);
 }
Exemple #25
0
 void INoteCollectionRepo.Add(ITaskCore task, INoteCore note)
 {
     throw new NotSupportedException(
               "Notes can only belong to one task.");
 }
Exemple #26
0
 void INoteCollectionRepo.Remove(ITaskCore task, INoteCore note)
 {
     var dummyTask = backend.GetTaskBy (task.Id);
     var dummyNote = dummyTask.TaskNotes.Single (
         n => n.Id.ToString () == note.Id);
     dummyTask.TaskNotes.Remove (dummyNote);
 }
 public string UpdateTitle(INoteCore note, string title)
 {
     UpdateNote(note, title, note.Text);
     return(note.Title);
 }
Exemple #28
0
 string INoteRepository.UpdateText(INoteCore note, string text)
 {
     UpdateNote (note, note.Title, text);
     return note.Text;
 }
 INoteCore ITaskRepository.UpdateNote(ITaskCore task, INoteCore note)
 {
     throw new NotSupportedException(
               "This backend supports multiple notes.");
 }
Exemple #30
0
 void UpdateNote(INoteCore note, string title, string text)
 {
     var rtmNote = backend.Rtm.NotesEdit (backend.Timeline, note.Id, note.Title, note.Text);
     note.Title = rtmNote.Title;
     note.Text = rtmNote.Text;
 }
Exemple #31
0
 public string UpdateTitle(INoteCore note, string title)
 {
     return(null);
 }