public virtual ActionResult EditNode(string code)
 {
     var node = sitemapService.LoadNode(code);
     if (node==null) node=new SitemapItem();
     var editableNode = new SitemapItemEditModel(node);
     return View("EditNode", editableNode);
 }
 public virtual ActionResult SaveNode(SitemapItemEditModel editedNode)
 {
     var node = sitemapService.LoadNode(editedNode.Code);
     if (node != null)
     {
         editedNode.UpdateSiteItem(ref node);
         sitemapService.SaveNode(node);
     }
     else
     {
         // create new node
         node = new SitemapItem();
         editedNode.UpdateSiteItem(ref node);
         sitemapService.AddNode(node);
     }
     return Redirect("~/closewin.html");
 }