예제 #1
0
        /// <summary>
        /// Fetches all possible hulls
        /// </summary>
        /// <param name="output"></param>
        /// <returns></returns>
        public static bool FetchAll(ref List <Hull> output)
        {
            output = new List <Hull>();

            SQLiteDataReader reader = DBI.DoQuery(
                "SELECT * FROM Hull ORDER BY ordering ASC;");

            while (reader != null && reader.Read())
            {
                Hull h = Hull.Factory(reader);
                output.Add(h);
            }
            return(true);
        }
예제 #2
0
        /// <summary>
        /// Fetches a hull by ID
        /// </summary>
        /// <param name="output"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool FetchById(ref Hull output, int id)
        {
            SQLiteDataReader reader = DBI.DoPreparedQuery(
                @"SELECT * FROM Hull 
				WHERE id = @id LIMIT 1;"                ,
                new Tuple <string, object>("@id", id));

            if (reader != null && reader.Read())
            {
                output = Hull.Factory(reader);
                return(true);
            }
            return(false);
        }