// Update the SettingName by using inputted SettingValue and return original SettingValue public static string updatePosSettingValue(string settingName, string settingValue, string jurisdictionCode, string companyCode, string managementUnitCode) { string origSettingValue = string.Empty; string envName = CarConfigurationManager.AppSetting("EnvironmentName"); string urlName = "CarWorldspanSCSUri"; ConfigurationDBHelper configurationDBhelper = new ConfigurationDBHelper(CarCommonEnumManager.ServiceName.CarWorldspanSCS, ConfigSettingType.POS); // 1.Search PosConfiguration table by EnvironmentName and POS origSettingValue = configurationDBhelper.SettingValuePOSGet(settingName, envName, jurisdictionCode, companyCode, managementUnitCode); if (!string.IsNullOrEmpty(origSettingValue)) { RequestSender.SendServiceConfigHttpRequest(urlName, settingName, settingValue, jurisdictionCode, companyCode, managementUnitCode); return(origSettingValue); } // 2.Search PosConfiguration table by EnvironmentName and POS as NULL origSettingValue = configurationDBhelper.SettingValuePOSGet(settingName, envName); if (!string.IsNullOrEmpty(origSettingValue)) { RequestSender.SendServiceConfigHttpRequest(urlName, settingName, settingValue); return(origSettingValue); } // 3.Search PosConfiguration table by EnvironmentName as NULL and POS as NULL origSettingValue = configurationDBhelper.SettingValuePOSGet(settingName); if (!string.IsNullOrEmpty(origSettingValue)) { RequestSender.SendServiceConfigHttpRequest(urlName, settingName, setEnv: false); return(origSettingValue); } else { return(origSettingValue); } }
public static string getPoSSettingValue(string settingName, string jurisdictionCode, string companyCode, string managementUnitCode) { string settingValue = string.Empty; string envName = CarConfigurationManager.AppSetting("EnvironmentName"); if (envName == null) { envName = GetEnvFromAPPConfig(); } ConfigurationDBHelper configurationDBhelper = new ConfigurationDBHelper(CarCommonEnumManager.ServiceName.CarWorldspanSCS, ConfigSettingType.POS); // 1.Search PosConfiguration table by EnvironmentName and POS settingValue = configurationDBhelper.SettingValuePOSGet(settingName, envName, jurisdictionCode, companyCode, managementUnitCode); // 2.Search PosConfiguration table by EnvironmentName and POS as NULL if (string.IsNullOrEmpty(settingValue)) { settingValue = configurationDBhelper.SettingValuePOSGet(settingName, envName); } // 3.Search PosConfiguration table by EnvironmentName as NULL and POS as NULL if (string.IsNullOrEmpty(settingValue)) { settingValue = configurationDBhelper.SettingValuePOSGet(settingName); } return(settingValue); }