Пример #1
0
        public ActionResult Detail(Guid id, BrandVIewModels model)
        {
            var brand = _brandService.GetById(id);

            model = new BrandVIewModels(brand);
            return(View(model));
        }
Пример #2
0
        public ActionResult Edit(BrandVIewModels model)
        {
            var brand = new Brand()
            {
                Id         = model.Id,
                Name       = model.Name,
                Logo       = model.Logo,
                ModifyDate = DateTime.Now,
                ModifyBy   = User.Identity.GetUserName()
            };
            var result = _brandService.Update(brand);

            if (result == true)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
Пример #3
0
        public ActionResult Create(BrandVIewModels model)
        {
            var brand = new Brand()
            {
                Id         = Guid.NewGuid(),
                Name       = model.Name,
                Logo       = model.Logo,
                CreateDate = DateTime.Now,
                CreateBy   = User.Identity.GetUserName(),
                ModifyDate = DateTime.Now,
                Status     = true,
            };
            var result = _brandService.Create(brand);

            if (result == true)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }