private void UpdateNote(long noteId, string title, ObservableCollection <TodoNote.TodoEntry> TodoEntries) { string timeStamp = TimeUtil.GetStringTimestamp(); ISQLiteStatement statement = dbConn.Prepare(UPDATE_TODO_NOTE); statement.Bind(1, title); statement.Bind(2, timeStamp); statement.Bind(3, null); statement.Bind(4, noteId); statement.Step(); TodoNote todoNote = (TodoNote)GetNoteById(noteId); // Delete all todo note contents foreach (TodoNote.TodoEntry entry in ((TodoNote)GetNoteById(noteId)).TodoEntries) { statement.Reset(); statement.ClearBindings(); statement = dbConn.Prepare(DELETE_TODO_NOTE_CONTENT); statement.Bind(1, entry.Id); statement.Step(); } // Add all todo note new contents foreach (TodoNote.TodoEntry entry in TodoEntries) { statement.Reset(); statement.ClearBindings(); statement = dbConn.Prepare(INSERT_TODO_NOTE_CONTENT); statement.Bind(1, entry.Content); statement.Bind(2, ConvertBoolToInt(entry.IsDone)); statement.Bind(3, noteId); statement.Bind(4, timeStamp); statement.Step(); } }
public void AddNote(string title, ObservableCollection <TodoNote.TodoEntry> entries, string schedulingId, DateTimeOffset dateTime) { long notificationId = NotificationHelper.AddNotification(schedulingId, dateTime); ISQLiteStatement statement = dbConn.Prepare(INSERT_TODO_NOTE); statement.Bind(1, title); statement.Bind(2, TimeUtil.GetStringTimestamp()); statement.Bind(3, notificationId); statement.Step(); foreach (TodoNote.TodoEntry entry in entries) { statement = dbConn.Prepare(INSERT_TODO_NOTE_CONTENT); statement.Bind(1, entry.Content); int done = ConvertBoolToInt(entry.IsDone); statement.Bind(2, done); ISQLiteStatement stat = dbConn.Prepare(SELECT_LAST_NOTE_INSERT_ID); stat.Step(); long noteID = (long)stat[0]; statement.Bind(3, noteID); statement.Bind(4, TimeUtil.GetStringTimestamp()); statement.Step(); statement.Reset(); statement.ClearBindings(); } }
public Cursor (ISQLiteStatement statement) { this.statement = statement; currentRow = -1; hasRows = statement.Step () == SQLiteResult.ROW; statement.Reset (); }
public Cursor(ISQLiteStatement statement) { this.statement = statement; currentRow = -1; hasRows = statement.Step() == SQLiteResult.ROW; statement.Reset(); }
public void DeleteNote(long id) { ISQLiteStatement statement = dbConn.Prepare(DELETE_PHOTO_NOTE); statement.Bind(1, id); statement.Step(); statement.Reset(); statement.ClearBindings(); DeleteNotificationByNoteId(id); }
public void DeleteNote(long id) { ISQLiteStatement statement = dbConn.Prepare(DELETE_TODO_NOTE_CONTENT); TodoNote todoNote = (TodoNote)GetNoteById(id); foreach (TodoNote.TodoEntry entry in todoNote.TodoEntries) { statement.Bind(1, entry.Id); statement.Step(); statement.Reset(); statement.ClearBindings(); } statement = dbConn.Prepare(DELETE_TODO_NOTE); statement.Bind(1, id); statement.Step(); DeleteNotificationByNoteId(id); }
protected override void OnNavigatedTo(NavigationEventArgs ne) { id = ne.Parameter.ToString(); string CategoryName = @"SELECT * FROM categories WHERE id=" + id; var title = objConn.Prepare(CategoryName); title.Step(); CBTitle.Text = title[1] + " - Quiz {}"; string QuestionPhrase = @"SELECT * FROM questions WHERE categoryid=" + id; question = objConn.Prepare(QuestionPhrase); while (question.Step() == SQLiteResult.ROW) { questiontotal++; } question.Reset(); ChangeQuestion(); }
public static void ResetAndClearBindings(this ISQLiteStatement statement) { statement.Reset(); statement.ClearBindings(); }