public ActionResult Create(CategoryCreateEditModel model) { if (ModelState.IsValid) { Guid? parent = null; if (model.ParentCategoryId != null) { Guid p; if (Guid.TryParse(model.ParentCategoryId, out p)) { parent = p; } } BllCategory cat = new BllCategory() { Id = model.Id, Name = model.CategoryName.Trim(), Description = model.Description, DateCreated = DateTime.UtcNow, ParentCategoryId = parent }; _categoryService.Add(cat); return RedirectToAction("Index"); } return View(model); }
public void Update(BllCategory category) { _categoryRepository.Update(category.ToDalCategory()); _uow.Save(); }
public void Add(BllCategory category) { _categoryRepository.Insert(category.ToDalCategory()); _uow.Save(); }