diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs index a8a7155..f5ec2a1 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs @@ -1472,7 +1472,7 @@ namespace EasyBL.WEBAPP.SYS } - public List QueryCategoryExhibition(string sLanguageID) { + public List QueryCategoryExhibition(string sLanguageID, List IncludeCountryIDs, List ExcludeCountryIDs) { Dictionary rsResult = new Dictionary(); @@ -1482,6 +1482,14 @@ namespace EasyBL.WEBAPP.SYS var rsExhibitionList = QueryAllDetailExhibitionAsDictionary(sLanguageID).Values.Where(w => w.MainCategories.Count > 0); + if (IncludeCountryIDs.Count > 0) { + rsExhibitionList = rsExhibitionList.Where(w => IncludeCountryIDs.Contains(w.Country.CountryID)); + } + + if (ExcludeCountryIDs.Count > 0) { + rsExhibitionList = rsExhibitionList.Where(w => !ExcludeCountryIDs.Contains(w.Country.CountryID)); + } + foreach (var Exhibition in rsExhibitionList) { List MainCategoryList = Exhibition.MainCategories; diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs index 1125589..b4fb110 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs @@ -511,7 +511,7 @@ namespace EasyBL.WEBAPP.SYS return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm)); } - public HttpResponseMessage GetCategoryExhibition(string sLanguageID) { + public HttpResponseMessage GetCategoryExhibition(string sLanguageID, List IncludeCountryIDs, List ExcludeCountryIDs) { SuccessResponseMessage srm = null; string sError = null; @@ -526,7 +526,7 @@ namespace EasyBL.WEBAPP.SYS } ExhibMaintain_QryService em_qry = new ExhibMaintain_QryService(); - var rsResult = em_qry.QueryCategoryExhibition(sLanguageID); + var rsResult = em_qry.QueryCategoryExhibition(sLanguageID, IncludeCountryIDs, ExcludeCountryIDs); //返回token信息 srm = new SuccessResponseMessage(null, null); diff --git a/EuroTran/WebApp/Controllers/ExhibitionController.cs b/EuroTran/WebApp/Controllers/ExhibitionController.cs index 0d0a8a8..68d0692 100644 --- a/EuroTran/WebApp/Controllers/ExhibitionController.cs +++ b/EuroTran/WebApp/Controllers/ExhibitionController.cs @@ -216,10 +216,22 @@ namespace WebApp.Controllers } [HttpGet] - public HttpResponseMessage CategoryExhibition(string Lang) + public HttpResponseMessage CategoryExhibition(string Lang, string IncludeCountryIDs, string ExcludeCountryIDs) { - return new ExhibitionService().GetCategoryExhibition(Lang); + List rsIncludeCountryIDs = new List(); + List rsExcludeCountryIDs = new List(); + + if (!string.IsNullOrEmpty(IncludeCountryIDs)) { + rsIncludeCountryIDs = JsonConvert.DeserializeObject>(IncludeCountryIDs); + } + + if (!string.IsNullOrEmpty(ExcludeCountryIDs)) + { + rsExcludeCountryIDs = JsonConvert.DeserializeObject>(ExcludeCountryIDs); + } + + return new ExhibitionService().GetCategoryExhibition(Lang, rsIncludeCountryIDs, rsExcludeCountryIDs); }