Exemplo n.º 1
0
        protected override ActionResult RedirectToActionAfterSuccessCreate(AfterSuccessSaveParam afterSuccessSaveParam)
        {
            Guid?parentId = GetService().GetParentId(afterSuccessSaveParam.Id);

            if (parentId.HasValue)
            {
                return(Json(JsonTreeResult.CreateTreeSuccess(parentId.Value, afterSuccessSaveParam.TargetHtmlId, null, afterSuccessSaveParam.Action)));
                //return base.RedirectToActionAfterSuccessCreate(id, actionName, controllerName, routeValues, parentId.Value.ToString(), JsonRefreshMode.REFRESH_TREE_AFTER_DIALOG_CLOSE);
            }
            return(base.RedirectToActionAfterSuccessCreate(afterSuccessSaveParam));
        }
Exemplo n.º 2
0
        protected override ActionResult RedirectToActionAfterSuccessDelete(AfterDeleteParam afterDeleteParam)
        {
            MenuDeletionDto menuDeletionDto = (MenuDeletionDto)afterDeleteParam.DeletionDto;

            if (menuDeletionDto.ParentMenuItemId.HasValue)
            {
                return(Json(JsonTreeResult.CreateTreeSuccess(menuDeletionDto.ParentMenuItemId.Value, afterDeleteParam.TargetHtml, null, afterDeleteParam.Action)));
            }

            //if(afterDeleteParam.DeletionDto == null)
            return(Json(JsonTreeResult.CreateTreeSuccess(null, afterDeleteParam.TargetHtml, null, afterDeleteParam.Action)));
            //if (affectedId.HasValue)
            //{
            //    return base.RedirectToActionAfterSuccessDelete(affectedId, affectedId.ToString(), action, routeValues, JsonRefreshMode.TREE);
            //}
            //return base.RedirectToActionAfterSuccessDelete(affectedId, targetId, action, routeValues, JsonRefreshMode.FULL);
            //if(!Guid.Empty.Equals(id))
            //{
            //    return RedirectToActionAfterSuccessDelete(id, actionName, controllerName, targetId, routeValues);
            //}
            //return RedirectToActionAfterSuccessDelete(id, actionName, controllerName, targetId, routeValues);
        }