public IActionResult Update(int id)
        {
            var dataService = new BrandService();
            var brand       = dataService.GetBrand(id);

            ViewBag.Brands = new SelectList(dataService.GetList(), "BrandID", "Name");
            return(View(brand));
        }
Exemplo n.º 2
0
        public static ActiveBrand Create(string brandCode)
        {
            var brand = BrandService.GetBrand(brandCode);

            // Create active user
            var activeBrand = new ActiveBrand()
            {
                BrandCode      = brand.BrandCode,
                BrandName      = brand.BrandName,
                HeadOfficeCode = brand.HoCode,
                Berthing       = brand.Berth
            };

            return(activeBrand);
        }
Exemplo n.º 3
0
        public ActionResult Models(int brandId)
        {
            TempData["BrandId"] = brandId;

            var models = Mapper.Map <IEnumerable <ModelDTO>, List <ModelViewModel> >(modelService.GetAllModels(brandId));

            if (models.Count() == 0)
            {
                IBrandService brandService = new BrandService();
                var           brand        = brandService.GetBrand(brandId);
                ViewBag.BrandName  = brand.Name;
                ViewBag.BrandPhoto = brand.Photo;
            }

            return(View(models));
        }