Ejemplo n.º 1
0
 public bool RemoveSection(CategoryParametersSection section)
 {
     try
     {
         _categoryParametersSectionRepository.Delete(section);
         _categoryParametersSectionRepository.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        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));
            }
        }