Exemplo n.º 1
0
        public ActionResult BrandType(long id)
        {
            BrandTypeViewModel viewModel = new BrandTypeViewModel();

            // 次分類列表
            viewModel.brandSubTypeList = _brandSubTypeRepository.GetList(id, false);

            // 品牌列表
            viewModel.brandList = _brandRepository.GetList(id, 0, false);

            return PartialView(viewModel);
        }
Exemplo n.º 2
0
        public ActionResult BrandType(long id)
        {
            BrandTypeViewModel viewModel = new BrandTypeViewModel();

            // 次分類列表
            viewModel.brandSubTypeList = _brandSubTypeRepository.GetList(id, false);

            // 品牌列表
            viewModel.brandList = _brandRepository.GetList(id, 0, false);

            return(PartialView(viewModel));
        }
Exemplo n.º 3
0
        public BrandTypeViewModel GetBrandType(int id)
        {
            var brandType = this.DbContext
                            .BrandTypes
                            .Include(x => x.Brands)
                            .FirstOrDefault(x => x.Id == id);

            if (brandType == null)
            {
                return(null);
            }

            var brandTypeModel = new BrandTypeViewModel()
            {
                BrandTypeName = brandType.TypeName,
                Brands        = this.Mapper.Map <ICollection <BrandConciseViewModel> >(brandType.Brands)
            };

            return(brandTypeModel);
        }