public bool RemoveSection(CategoryParametersSection section) { try { _categoryParametersSectionRepository.Delete(section); _categoryParametersSectionRepository.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public JsonResult AddSection(int categoryID, string name) { if (!Request.IsAjaxRequest()) { throw new InvalidCastException("Not an ajax request"); } try { var section = new CategoryParametersSection { CategoryID = categoryID, Name = name }; _shopService.AddSection(section); return(Json(section.ID)); } catch { return(Json(0)); } }