public ActionResult Create(ToolLinkInputModel toolLinkInputModel)
        {
            if (!ModelState.IsValid)
                return View("Modify", modifyViewModelBuilder.BuildViewModel(toolLinkInputModel));

            var newTreeNodeId = treeNodeSummaryContext.Create(toolLinkInputModel.ParentTreeNodeId, typeof(ToolLinkNodeProvider).AssemblyQualifiedName);

            var toolLinkProviderDraft = new ToolLinkProviderDraft()
                        {
                            Id = newTreeNodeId,
                            Hidden = toolLinkInputModel.Hidden,
                            Name = toolLinkInputModel.Name,
                            Inactive = toolLinkInputModel.Inactive,
                            Url = toolLinkInputModel.Url,
                            UrlSegment = toolLinkInputModel.UrlSegment,
                            Sequence = toolLinkInputModel.Sequence,
                            LastModifyDate = DateTime.Now,
                            LastModifyBy = currentUserContext.GetCurrentPrincipal().Identity.Name
                        };
            toolLinkProviderDraftRepository.SaveAndReturnId(toolLinkProviderDraft);

            return new RedirectResult(GetRedirectUrlToModifyMethod(toolLinkProviderDraft));
        }
 private string GetRedirectUrlToModifyMethod(ToolLinkProviderDraft toolLinkProviderDraft)
 {
     if (Url == null) return "/";
     return Url.Action("Modify", "ToolLinkProviderNode", new { treeNodeId = toolLinkProviderDraft.Id });
 }
        public ActionResult Modify(ToolLinkInputModel toolLinkInputModel)
        {
            if (!ModelState.IsValid)
                return View("Modify", modifyViewModelBuilder.BuildViewModel(toolLinkInputModel));

            var toolLinkProviderDraft = new ToolLinkProviderDraft()
                                            {
                                                Hidden = toolLinkInputModel.Hidden,
                                                Inactive = toolLinkInputModel.Inactive,
                                                Name = toolLinkInputModel.Name,
                                                Url = toolLinkInputModel.Url,
                                                UrlSegment = toolLinkInputModel.UrlSegment,
                                                Id = toolLinkInputModel.TreeNodeId,
                                                Sequence = toolLinkInputModel.Sequence,
                                                LastModifyDate = DateTime.Now,
                                                LastModifyBy = currentUserContext.GetCurrentPrincipal().Identity.Name
                                            };

            toolLinkProviderDraftRepository.SaveAndReturnId(toolLinkProviderDraft);

            return new RedirectResult(GetRedirectUrlToModifyMethod(toolLinkProviderDraft));
        }