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); } }
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); } }
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); }