Esempio n. 1
0
        public ActionResult Default(string groupName)
        {
            var model = new CustomContentViewModel
                            {
                                Items = _menuItemProvider.GetItems(groupName) ?? new string[] { },
                                GroupName = groupName,
                            };

            return View(model);
        }
Esempio n. 2
0
        public ActionResult Edit(string groupName, string key)
        {
            var contentKey = string.Format("{0}_{1}", groupName, key);
            var content = _customContentService.Get(contentKey);

            var model = new CustomContentViewModel
            {
                GroupName = groupName,
                Key = key,
                Content = content
            };
            return View(model);
        }
Esempio n. 3
0
 public ActionResult Edit(CustomContentViewModel model)
 {
     model.Content = HttpUtility.UrlDecode(model.Content);
     var result = new AjaxResult();
     try
     {
         var contentKey = string.Format("{0}_{1}", model.GroupName, model.Key);
         _customContentService.Set(contentKey, model.Content);
         result.IsSuccess = true;
     }
     catch (Exception exception)
     {
         result.ErrorMessage = exception.Message;
     }
     return Json(result);
 }