public object GetCommunities(string countryCode, string countyorprovincecode, string countyorprovincename) { string TerritoryName = CountryStatic.GetCountryCodeAndName(countryCode); Type territoryType = Type.GetType(string.Format(Constants.SP_DAL_QUALIFIEDNAME, TerritoryName)); MethodInfo mi = typeof(TerritoriesService).GetMethod("GetGenericCommunities").MakeGenericMethod(territoryType); var Communities = mi.Invoke(this, new string[] { countyorprovincecode ?? "", countyorprovincename }); return(Communities); }
public object GetStates(string countryCode) { string TerritoryName = CountryStatic.GetCountryCodeAndName(countryCode); Type territoryType = Type.GetType(string.Format(Constants.SP_DAL_QUALIFIEDNAME, TerritoryName)); MethodInfo mi = typeof(TerritoriesService).GetMethod("GetGenericStates").MakeGenericMethod(territoryType); var states = mi.Invoke(this, null); return(states); }