/// <summary> /// Invoke DigiSphere API to retrieve a list of sectors /// </summary> /// <returns></returns> public List <BusinessKeywordInfo> GetBusinessKeyWords(int sectorID, int siteCatID, int[] businessTypeIDs) { FetchRest fetchRest = new FetchRest(); fetchRest.Method = "Get"; List <BusinessKeywordInfo> lstTotalKeywords = new List <BusinessKeywordInfo>(); for (int i = 0; i < businessTypeIDs.Length; i++) { string businessKeywordURL = string.Format(APIEndPoint.GetSpecificBusinessKeyWords, sectorID, siteCatID, businessTypeIDs[i]); string returnValue = fetchRest.GetData(businessKeywordURL, string.Empty); if (returnValue != string.Empty) { List <BusinessKeywordInfo> lstBusinessKeywords = JsonParser.Deserializer.DeserializeJSON <List <BusinessKeywordInfo> >(returnValue); if (lstBusinessKeywords != null && lstBusinessKeywords.Count > 0) { for (int j = 0; j < lstBusinessKeywords.Count; j++) { if (!lstTotalKeywords.Exists(x => x.Keyword.ToLower() == lstBusinessKeywords[j].Keyword.ToLower())) { lstTotalKeywords.Add(lstBusinessKeywords[j]); } } } } } return(lstTotalKeywords); }
public void TriggerSiteConfig(string domainName, string configcode) { FetchRest fetchRest = new FetchRest(); fetchRest.Method = "POST"; string data = JsonConvert.SerializeObject(new ConfigSuccess() { DomainName = domainName, Configcode = configcode }); string returnValue = fetchRest.GetData(APIEndPoint.TriggerConfig, string.Empty); }
/// <summary> /// Invoke DigiSphere API to retrieve a list of sectors /// </summary> /// <returns></returns> public List <SectorTypeInfo> GetSectorTypes() { FetchRest fetchRest = new FetchRest(); fetchRest.Method = "Get"; string returnValue = fetchRest.GetData(APIEndPoint.GetAllSectors, string.Empty); if (returnValue != string.Empty) { List <SectorTypeInfo> lstSectors = JsonParser.Deserializer.DeserializeJSON <List <SectorTypeInfo> >(returnValue); return(lstSectors); } return(null); }
/// <summary> /// Invoke DigiSphere API to retrieve a list of Site Categories by Sector ID /// </summary> /// <param name="sectorID"></param> /// <returns></returns> public List<SiteTypeInfo> GetSiteCategoriesBySectorID(int sectorID) { FetchRest fetchRest = new FetchRest(); fetchRest.Method = "Get"; string siteCategoryURL = string.Format(APIEndPoint.GetSiteCategoriesBySectorID, sectorID); string returnValue = fetchRest.GetData(siteCategoryURL, string.Empty); if (returnValue != string.Empty) { List<SiteTypeInfo> lstSectors = JsonParser.Deserializer.DeserializeJSON<List<SiteTypeInfo>>(returnValue); return lstSectors; } return null; }
/// <summary> /// Invoke DigiSphere API to retrieve a list of all the available sectors /// </summary> /// <returns></returns> public List <BusinessKeywordInfo> GetAvailableKeywords() { FetchRest fetchRest = new FetchRest(); fetchRest.Method = "Get"; string returnValue = fetchRest.GetData(APIEndPoint.GetAvailalbeBusinessKeyWords, string.Empty); if (returnValue != string.Empty) { List <BusinessKeywordInfo> lstBusinessKeywords = JsonParser.Deserializer.DeserializeJSON <List <BusinessKeywordInfo> >(returnValue); return(lstBusinessKeywords); } return(null); }
public List <BusinessTypeInfo> GetBusinessType(int sectorID, int siteCatID) { FetchRest fetchRest = new FetchRest(); fetchRest.Method = "Get"; string businessTypeURL = string.Format(APIEndPoint.GetBusinessTypeBySectorAndSite, sectorID, siteCatID); string returnValue = fetchRest.GetData(businessTypeURL, string.Empty); if (returnValue != string.Empty) { List <BusinessTypeInfo> lstBusinessTypes = JsonParser.Deserializer.DeserializeJSON <List <BusinessTypeInfo> >(returnValue); return(lstBusinessTypes); } return(null); }
public KeywordDetailInfo FindByKeywords(string keywords) { FetchRest fetchRest = new FetchRest(); fetchRest.Method = "Get"; string keyWordURL = string.Format(APIEndPoint.GetByKeywords, keywords); string returnValue = fetchRest.GetData(keyWordURL, string.Empty); if (returnValue != string.Empty) { KeywordDetailInfo lstBusinessKeywords = JsonParser.Deserializer.DeserializeJSON <KeywordDetailInfo>(returnValue); return(lstBusinessKeywords); } return(null); }
public SiteResourceConsumptionInfo GetSiteConsumptionDetail(string domainName) { string configurecode = Config.GetSetting("configurecode").ToString(); FetchRest fetchRest = new FetchRest(); fetchRest.Method = "Get"; domainName = domainName.Replace('.', '_'); string siteConsumptionURL = string.Format(APIEndPoint.GetSiteConsumption, domainName); string returnValue = fetchRest.GetData(siteConsumptionURL, string.Empty); if (returnValue != string.Empty) { SiteResourceConsumptionInfo siteConsumptionInfo = JsonParser.Deserializer.DeserializeJSON <SiteResourceConsumptionInfo>(returnValue); return(siteConsumptionInfo); } return(null); }