Ejemplo n.º 1
0
        public ActionResult EditSitemap()
        {
            var sitemap = GetCommand<GetSitemapCommand>().ExecuteCommand(string.Empty);
            var pageLinks = GetCommand<GetPageLinksCommand>().ExecuteCommand(string.Empty);
            var success = sitemap != null & pageLinks != null;
            var view = RenderView("Edit", null);

            var data = new SitemapAndPageLinksViewModel();
            if (success)
            {
                data.RootNodes = sitemap.RootNodes;
                data.PageLinks = pageLinks;
            }

            return ComboWireJson(success, view, data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 2
0
        public ActionResult EditSitemap(string sitemapId)
        {
            var model = GetCommand<GetSitemapCommand>().ExecuteCommand(sitemapId.ToGuidOrDefault());
            var pageLinks = GetCommand<GetPageLinksCommand>().ExecuteCommand(string.Empty);
            var success = model != null & pageLinks != null;
            var view = RenderView("Edit", model);

            var data = new SitemapAndPageLinksViewModel();
            if (success)
            {
                data.Sitemap = model;
                data.PageLinks = pageLinks;
            }

            return ComboWireJson(success, view, data, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the page links.
        /// </summary>
        /// <param name="searchQuery">The search query.</param>
        /// <returns>JSON result.</returns>
        public ActionResult GetPageLinks(string searchQuery)
        {
            var response = GetCommand<GetPageLinksCommand>().ExecuteCommand(searchQuery);
            if (response != null)
            {
                var data = new SitemapAndPageLinksViewModel { PageLinks = response };
                return Json(new WireJson { Success = true, Data = data });
            }

            return Json(new WireJson { Success = false });
        }