Esempio n. 1
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);
        }
Esempio n. 2
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);
            }
        }
Esempio n. 3
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);
     }
 }
Esempio n. 4
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);
 }