public ActionResult Detail(Guid id, ProductCategoryViewModels model) { var productCategory = _productCategoryService.GetById(id); model = new ProductCategoryViewModels(productCategory); return(View(model)); }
public ActionResult Edit(ProductCategoryViewModels model) { var productCategory = new ProductCategory() { Id = model.Id, Name = model.Name, Image = model.Image, ModifiedDate = DateTime.Now, ModifiedBy = User.Identity.GetUserName() }; var result = _productCategoryService.Update(productCategory); if (result == true) { return(RedirectToAction("Index")); } return(View()); }
public ActionResult Create(ProductCategoryViewModels model) { var productCategory = new ProductCategory() { Id = Guid.NewGuid(), Name = model.Name, Image = model.Image, CreateDate = DateTime.Now, CreateBy = User.Identity.GetUserName(), ModifiedDate = DateTime.Now, Status = true, }; var result = _productCategoryService.Create(productCategory); if (result == true) { return(RedirectToAction("Index")); } return(View()); }