示例#1
0
        public override void DeleteNote(INote note)
        {
            SqliteNote sqNote = (note as SqliteNote);

            string command = String.Format("DELETE FROM Notes WHERE ID='{0}'", sqNote.ID);

            backend.Database.ExecuteScalar(command);
        }
示例#2
0
        public override void SaveNote(INote note)
        {
            SqliteNote sqNote = (note as SqliteNote);

            string text    = backend.SanitizeText(sqNote.Text);
            string command = String.Format("UPDATE Notes SET Text='{0}' WHERE ID='{1}'", text, sqNote.ID);

            backend.Database.ExecuteScalar(command);
        }
示例#3
0
        public override TaskNote CreateNote(string text)
        {
            Debug.WriteLine ("Creating New Note Object : {0} (id={1})", text, id);
            text = backend.SanitizeText (text);
            var command = String.Format (
                "INSERT INTO Notes (Task, Text) VALUES ('{0}','{1}'); SELECT last_insert_rowid();",
                id, text);
            var taskId = Convert.ToInt32 (backend.Database.ExecuteScalar (command));

            var note = new SqliteNote (taskId, text);
            note.OnTextChangedAction = delegate { SaveNote (note); };
            return note;
        }