예제 #1
0
        private static string getConfigValue(int companyID, AspectEnums.ConfigKeys key)
        {
            string config = AppUtil.GetAppSettings(key);

            if (config.Contains(','))
            {
                return(config.Split(',').ToArray()[(companyID - 1)]);
            }
            else
            {
                return(config);
            }
        }
예제 #2
0
파일: AppUtil.cs 프로젝트: accuit/IqHealth
        /// <summary>
        /// Method to get the Application Configuration Settings value using key name of settings
        /// </summary>
        /// <param name="key">config key name enum</param>
        /// <returns>returns application settings value</returns>
        public static string GetAppSettings(AspectEnums.ConfigKeys key)
        {
            string value;

            try
            {
                value = ConfigurationManager.AppSettings[key.ToString()];
            }
            catch (Exception)
            {
                value = string.Empty;
                //LogTraceEngine.WriteLog(ex.Message);
            }
            return(value);
        }
예제 #3
0
        /// <summary>
        /// Method to get the Application Configuration Settings value using key name of settings
        /// </summary>
        /// <param name="key">config key name enum</param>
        /// <returns>returns application settings value</returns>
        public static string GetAppSettings(AspectEnums.ConfigKeys key)
        {
            string value = string.Empty;

            try
            {
                value = ConfigurationManager.AppSettings[key.ToString()];
            }
            catch (Exception ex)
            {
                value = string.Empty;
                ActivityLog.SetLog(ex.Message, LogLoc.ERROR);
            }
            return(value);
        }