|
|
@ -1660,8 +1660,7 @@ namespace EasyBL.WEBAPP.SYS |
|
|
|
|
|
|
|
List<CategoryDTO> MainCategoryList = Exhibition.MainCategories; |
|
|
|
|
|
|
|
ExhibitionDTO ExhibDTO = new ExhibitionDTO(); |
|
|
|
|
|
|
|
// Create categories
|
|
|
|
foreach (var MainCategory in MainCategoryList) |
|
|
|
{ |
|
|
|
|
|
|
@ -1670,20 +1669,33 @@ namespace EasyBL.WEBAPP.SYS |
|
|
|
rsCategoryExhibition.CategoryID = MainCategory.CategoryID; |
|
|
|
rsCategoryExhibition.CategoryName = MainCategory.CategoryName; |
|
|
|
|
|
|
|
rsCategoryExhibition.ExhibitionDic[Exhibition.ExhibitionID] = Exhibition; |
|
|
|
|
|
|
|
rsResult[MainCategory.CategoryID] = rsCategoryExhibition; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// add Exhibition into categories
|
|
|
|
foreach (var Exhibition in rsExhibitionList) |
|
|
|
{ |
|
|
|
List<CategoryDTO> MainCategoryList = Exhibition.MainCategories; |
|
|
|
|
|
|
|
foreach (var MainCategory in MainCategoryList) { |
|
|
|
|
|
|
|
rsResult[MainCategory.CategoryID].ExhibitionDic[Exhibition.ExhibitionID] = Exhibition; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Convert Dic to List
|
|
|
|
foreach (KeyValuePair<string, CategoryExhibitionDTO> CM in rsResult) |
|
|
|
{ |
|
|
|
|
|
|
|
var sCategoryID = CM.Key; |
|
|
|
|
|
|
|
rsResult[sCategoryID].ExhibitionList = rsResult[sCategoryID].ExhibitionDic.Values.ToList(); |
|
|
|
rsResult[sCategoryID].ExhibitionList = rsResult[sCategoryID].ExhibitionDic.Values |
|
|
|
.OrderByDescending(o => o.StartDate).ToList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
xxxxxxxxxx