//public static T GetEnumParam<T>(this ONLCompetition comp, string paramName, T defaultValue)
        //    where T : struct
        //{
        //    return GetParam<T>(comp, paramName, GetEnumParamNullable<T>, defaultValue);
        //}

        public static T GetEnumParam <T>(this ONLCompetition comp, string paramName, T defaultValue)
        {
            try
            {
                long?l = comp.GetLongParamNullable(paramName);
                if (l == null || !l.HasValue)
                {
                    return(defaultValue);
                }
                return((T)Enum.ToObject(typeof(T), l.Value));
            }
            catch { return(defaultValue); }
        }
        public static bool?GetBooleanParamNullable(this ONLCompetition comp, string paramName)
        {
            string val = comp.GetStringParam(paramName);

            if (String.IsNullOrEmpty(val))
            {
                return(null);
            }
            bool res;

            if (bool.TryParse(val, out res))
            {
                return(res);
            }
            var ip = comp.GetLongParamNullable(paramName);

            return(ip == null ? null : new bool?(ip.Value > 0));
        }
        public static int?GetIntParamNullable(this ONLCompetition comp, string paramName)
        {
            long?res = comp.GetLongParamNullable(paramName);

            return(res == null ? null : new int?((int)res.Value));
        }