public JsonResult UpdateSearch(SearchForm form)
 {
     if (ModelState.IsValid)
     {
         contentManager.Template.Update(form);
         return JsonNet(new {success = true,});
     }
     return JsonNet(new {success = false,});
 }
 public static SearchForm ToSearchViewModel(this Template template)
 {
     var form = new SearchForm();
     form.Id = template.Id;
     form.Description = template.Description ?? string.Empty;
     form.Keywords = template.Keywords ?? string.Empty;
     form.Language = template.Language ?? 1033;
     form.Charset = template.Charset ?? "UTF-8";
     form.Author = template.Author ?? string.Empty;
     form.Copyright = template.Copyright ?? string.Empty;
     form.Robots = template.Robots ?? string.Empty;
     return form;
 }
Exemple #3
0
        public void Update(SearchForm form)
        {
            var page = Load(form.Id);

            PageItem pageItem;
            folderService.FindParentFolderOfPage(page.Id, out pageItem);

            page.Description = pageItem.Description = form.Description;
            page.Keywords = form.Keywords;
            page.Language = form.Language;
            page.Charset = form.Charset;
            page.Author = form.Author;
            page.Copyright = form.Copyright;
            page.Robots = form.Robots;
            page.LastModified = DateTime.UtcNow;

            session.SaveChanges();
            ClearOutputCacheDependency(HttpContext.Current);
        }
Exemple #4
0
        public void Update(SearchForm form)
        {
            var template = Load(form.Id);

            template.Description = form.Description;
            template.Keywords = form.Keywords;
            template.Language = form.Language;
            template.Charset = form.Charset;
            template.Author = form.Author;
            template.Copyright = form.Copyright;
            template.Robots = form.Robots;

            session.SaveChanges();
        }