private static string GetParameterClientByName(ParamIdEnum parameter, string cacheKey, string strDBConnection) { var result = (string)HttpRuntime.Cache["GetParameterClientByName_" + parameter.ToString() + "_" + cacheKey]; if (result == null) { result = SqlApiSqlClient.GetStringRecordValue("EXEC PARAMETROS_CLIENTS_GET_VALUE_BY_NAME '" + parameter.ToString() + "'", strDBConnection); HttpRuntime.Cache.Insert("GetParameterClientByName" + parameter.ToString() + cacheKey, result, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5)); } return(result); }
public static string GetParameterForClient(GetValueByEnum getValueByEnum, ParamIdEnum parameter, string cacheKey, string strDBConnection) { if (getValueByEnum.Equals(GetValueByEnum.GetValueByID)) { return(GetParameterClientById(parameter, cacheKey, strDBConnection)); } if (getValueByEnum.Equals(GetValueByEnum.GetValueByName)) { return(GetParameterClientByName(parameter, cacheKey, strDBConnection)); } return(null); }