public Boolean WriteBoard(NumbBoard board) { String sqlQuery = "REPLACE INTO Boards (email_id,name) " + "VALUES (@email_id, @name)"; String[] parameters = { "email_id", "name" }; String[] args = { board.boardID, board.name }; return(WriteElement(sqlQuery, parameters, args)); }
private List <NumbColumn> getEmptyNumbColumnsList(NumbBoard board) { List <NumbColumn> columns = new List <NumbColumn>(); string sql = "SELECT * FROM Columns " + "WHERE Columns.board_id = @param_board_id AND Columns.board_name = @param_board_name "; SQLiteCommand getColumnsComm = new SQLiteCommand(sql, connection); SQLiteParameter param_board_id = new SQLiteParameter(@"param_board_id", board.boardID); getColumnsComm.Parameters.Add(param_board_id); SQLiteParameter param_board_name = new SQLiteParameter(@"param_board_name", board.name); getColumnsComm.Parameters.Add(param_board_name); getColumnsComm.Connection = connection; getColumnsComm.Prepare(); SQLiteDataReader reader = getColumnsComm.ExecuteReader(); while (reader.Read()) { columns.Add(new NumbColumn(reader.GetValue(0).ToString(), reader.GetValue(1).ToString(), (int)reader.GetInt64(2), new List <NumbTask>())); } return(columns); }