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

            dummyNote.Text = text;
            return(text);
        }
示例#2
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;
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#6
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();
            }
        }
示例#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;
 }
示例#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;
 }
示例#9
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);
        }
示例#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);
        }
示例#11
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);
            }
        }
示例#12
0
 void INoteCollectionRepo.Add(ITaskCore task, INoteCore note)
 {
     throw new NotSupportedException (
         "Notes can only belong to one task.");
 }
示例#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 ();
     }
 }
示例#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);
     }
 }
示例#15
0
 void NoteCollectionRepo.Add(ITaskCore container, INoteCore item)
 {
     throw new NotSupportedException (
         "A note can only belong to a single task.");
 }
示例#16
0
 public string UpdateTitle(INoteCore note, string title)
 {
     return null;
 }
示例#17
0
 public string UpdateText(INoteCore note, string text)
 {
     var dummyNote = backend.GetNoteBy (note.Id);
     dummyNote.Text = text;
     return text;
 }
示例#18
0
 string INoteRepository.UpdateText(INoteCore note, string text)
 {
     UpdateNote(note, note.Title, text);
     return(note.Text);
 }
示例#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);
 }
示例#20
0
 void NoteCollectionRepo.Add(ITaskCore container, INoteCore item)
 {
     throw new NotSupportedException(
               "A note can only belong to a single task.");
 }
示例#21
0
 public string UpdateTitle(INoteCore note, string title)
 {
     UpdateNote (note, title, note.Text);
     return note.Title;
 }
示例#22
0
 public INoteCore UpdateNote(ITaskCore task, INoteCore note)
 {
     throw new NotSupportedException (
         "This backend supports multiple notes.");
 }
示例#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);
 }
示例#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);
 }
示例#25
0
 void INoteCollectionRepo.Add(ITaskCore task, INoteCore note)
 {
     throw new NotSupportedException(
               "Notes can only belong to one task.");
 }
示例#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);
 }
示例#27
0
 public string UpdateTitle(INoteCore note, string title)
 {
     UpdateNote(note, title, note.Text);
     return(note.Title);
 }
示例#28
0
 string INoteRepository.UpdateText(INoteCore note, string text)
 {
     UpdateNote (note, note.Title, text);
     return note.Text;
 }
示例#29
0
 INoteCore ITaskRepository.UpdateNote(ITaskCore task, INoteCore note)
 {
     throw new NotSupportedException(
               "This backend supports multiple notes.");
 }
示例#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;
 }
示例#31
0
 public string UpdateTitle(INoteCore note, string title)
 {
     return(null);
 }