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); } }
/// <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); }
/// <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); }