public ActionResult Detail(Guid id, BrandVIewModels model) { var brand = _brandService.GetById(id); model = new BrandVIewModels(brand); return(View(model)); }
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()); }
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()); }