public CategoryInfo CreateCategoryInfo(CategoryInfo categoryInfoToCreate) { _categoryInfoRepository.Add(categoryInfoToCreate); _categoryInfoRepository.Persist(); return categoryInfoToCreate; }
public CategoryInfo UpdateCategoryInfo(CategoryInfo updatedCategoryInfo) { var categoryInfoToUpdate = _categoryInfoRepository.FindOne(x => x.Id == updatedCategoryInfo.Id); categoryInfoToUpdate.CategoryName = updatedCategoryInfo.CategoryName; categoryInfoToUpdate.InfoText = updatedCategoryInfo.InfoText; _categoryInfoRepository.Persist(); return updatedCategoryInfo; }
public ActionResult EditCategoryInfo(CategoryInfo updatedCategoryInfo) { try { _categoryInfoDomainService.UpdateCategoryInfo(updatedCategoryInfo); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult CreateCategoryInfo(CategoryInfo newCategoryInfo) { try { _categoryInfoDomainService.CreateCategoryInfo(newCategoryInfo); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult DeleteCategoryInfo(CategoryInfo categoryInfoToDelete) { try { _categoryInfoDomainService.DeleteCategoryInfo(categoryInfoToDelete.Id); return RedirectToAction("Index"); } catch { return View(); } }