Exemplo n.º 1
0
        /// <summary>
        /// Fetches a specific operation role
        /// </summary>
        /// <param name="output"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool FetchById(ref OperationRole output, int id)
        {
            SQLiteDataReader reader = DBI.DoPreparedQuery(
                "SELECT * FROM OperationRole WHERE id = @id LIMIT 1;",
                new Tuple <string, object>("@id", id));

            if (reader != null && reader.Read())
            {
                output = OperationRole.Factory(reader);
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Fetches all operation roles which can be assigned to a boat
        /// </summary>
        /// <param name="output"></param>
        /// <returns></returns>
        public static bool FetchAllBoats(ref List <OperationRole> output)
        {
            output = new List <OperationRole>();

            SQLiteDataReader reader = DBI.DoQuery(
                @"SELECT * FROM OperationRole
				WHERE onBoats = 1
				ORDER BY id ASC;"                );

            while (reader != null && reader.Read())
            {
                output.Add(OperationRole.Factory(reader));
            }

            return(true);
        }