/// <summary> /// Gets a vendor by ID /// </summary> /// <param name="output"></param> /// <param name="id"></param> /// <returns></returns> public static bool FetchById(ref HullVendor output, int id) { SQLiteDataReader reader = DBI.DoPreparedQuery( @"SELECT * FROM HullVendor WHERE id = @id LIMIT 1;" , new Tuple <string, object>("@id", id)); if (reader != null && reader.Read()) { output = HullVendor.Factory(reader); return(true); } return(false); }
/// <summary> /// Gets a vendor by name /// </summary> /// <param name="output"></param> /// <param name="name"></param> /// <returns></returns> public static bool FetchByName(ref HullVendor output, string name) { SQLiteDataReader reader = DBI.DoPreparedQuery( @"SELECT * FROM HullVendor WHERE name = @name LIMIT 1;" , new Tuple <string, object>("@name", name)); if (reader != null && reader.Read()) { output = HullVendor.Factory(reader); return(true); } return(false); }