public ActionResult CreateCategory() { var model = new CreateCategoryModel(); return View(model); }
public ActionResult EditCategory(int id = 0) { var model = new CreateCategoryModel(); model = _productCategoryService.GetById(id).ToModel(); return View(model); }
public ActionResult EditCategory(CreateCategoryModel model) { var entity = _productCategoryService.GetById(model.Id); entity.CategoryName = model.CategoryName; entity.CategoryImage = model.CategoryImage; entity.CreatedDate = model.CreatedDate; entity.IsFeaturedCategory = model.IsFeatured; _productCategoryService.Update(entity); return View(model); }
public ActionResult CreateCategory(CreateCategoryModel model) { var entity = model.ToEntity(); _productCategoryService.Add(entity); return RedirectToAction("Index"); }