Exemple #1
0
        public ActionResult InitEditableOrganizationSelectTree(Guid editableAncestorOrganizationId, Guid ancestorOrganizationId)
        {
            try
            {
                var organizationList = HttpRuntime.Cache.GetOrInsert("Organizations", () => OrganizationDataAccessor.GetAllOrganizations());

                RequestResult result = OrganizationDataAccessor.GetEditableOrganizationRootTreeItem(organizationList, editableAncestorOrganizationId, ancestorOrganizationId, Session["Account"] as Account);

                if (result.IsSuccess)
                {
                    return(PartialView("_EditableOrganizationSelectTree", JsonConvert.SerializeObject((List <TreeItem>)result.Data)));
                }
                else
                {
                    return(PartialView("_Error", result.Error));
                }
            }
            catch (Exception ex)
            {
                var err = new Error(MethodBase.GetCurrentMethod(), ex);

                Logger.Log(err);

                return(PartialView("_Error", err));
            }
        }