コード例 #1
0
        public List <DimensionTreeModel> CreateTreeModel(HfmDimensionType argDimensionType)
        {
            List <DimensionTreeModel> treeModelList = new List <DimensionTreeModel>();
            var          dimensionList = EnumMembers2(argDimensionType);
            HsvMetadata  hsvMetadata   = _HsvSession.Metadata as HsvMetadata;
            IHsvTreeInfo treeInfo      = (IHsvTreeInfo)hsvMetadata.Dimension[(short)argDimensionType];
            int          order         = 0;

            foreach (var member in dimensionList)
            {
                object parentIds;
                treeInfo.EnumParents(member.MemberID, out parentIds);
                foreach (int parentId in (int[])parentIds)
                {
                    DimensionTreeModel treeModel = new DimensionTreeModel();
                    treeModel.Type = HfmDimensionTypeHelper.GetDimensionTypeName(argDimensionType);
                    if (parentId == -1)
                    {
                        treeModel.ParentCode = "ROOT";
                    }
                    else
                    {
                        string parentLabel;
                        treeInfo.GetLabel(parentId, out parentLabel);
                        treeModel.ParentCode = parentLabel;
                    }
                    treeModel.Code     = member.MemberLabel;
                    treeModel.CodeName = member.Description;
                    treeModel.Order    = ++order;
                    treeModelList.Add(treeModel);
                }
            }
            return(treeModelList);
        }
コード例 #2
0
 public String GetMemberLabel(HfmDimensionType argDimensionType, int argId)
 {
     try
     {
         if (!HfmDimension.memberLabelDictionary[argDimensionType].ContainsKey(argId))
         {
             HsvMetadata  hsvMetadata = _HsvSession.Metadata as HsvMetadata;
             IHsvTreeInfo treeInfo    = (IHsvTreeInfo)hsvMetadata.Dimension[(short)argDimensionType];
             String       sLabel      = String.Empty;
             treeInfo.GetLabel(argId, out sLabel);
             HfmDimension.memberLabelDictionary[argDimensionType].Add(argId, sLabel);
         }
         return(HfmDimension.memberLabelDictionary[argDimensionType][argId]);
     }
     catch (Exception ex)
     {
         throw new Exception(HfmCommon.GetHfmErrorMessage(ex.Message));
     }
 }