Ejemplo n.º 1
0
        public ActionResult Detail(Guid id, BrandVIewModels model)
        {
            var brand = _brandService.GetById(id);

            model = new BrandVIewModels(brand);
            return(View(model));
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 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());
        }