Пример #1
0
        public static CategoryDto ConvertToCategoryDto(Categories categories)
        {
            var categoryDto = new CategoryDto();
            categoryDto.CategoryId = categories.CategoryId;
            categoryDto.name = categories.Name;
            categoryDto.StatusId = categories.Status.Id;

            return categoryDto;
        }
Пример #2
0
 public static HotCategoryDto ConvertToHotCategoryDto(Categories category)
 {
     var hotCategoryDto = new HotCategoryDto();
     hotCategoryDto.CategoryId = category.CategoryId;
     hotCategoryDto.Name = category.Name;
     List<Products> listProducts = null;
     if (ProductDAO.getAllProductByCategory(category.CategoryId) != null)
         listProducts = ProductDAO.getAllProductByCategory(category.CategoryId).ToList();
     hotCategoryDto.Products = ConvertToListProductDto(listProducts);
     return hotCategoryDto;
 }