public static HFMwDimension GetHFMwDimension(HFMwSession argHFMwSession, HfmDimensionType argDimensionType) { HFMwDimension hfmwDimension = null; switch (argDimensionType) { case HfmDimensionType.Scenario: hfmwDimension = argHFMwSession.metadata.scenarios; break; case HfmDimensionType.Year: hfmwDimension = argHFMwSession.metadata.years; break; case HfmDimensionType.Period: hfmwDimension = argHFMwSession.metadata.periods; break; case HfmDimensionType.View: hfmwDimension = argHFMwSession.metadata.views; break; case HfmDimensionType.Entity: hfmwDimension = argHFMwSession.metadata.entities; break; case HfmDimensionType.Value: hfmwDimension = argHFMwSession.metadata.values; break; case HfmDimensionType.Account: hfmwDimension = argHFMwSession.metadata.accounts; break; case HfmDimensionType.Icp: hfmwDimension = argHFMwSession.metadata.ICPs; break; case HfmDimensionType.Custom1: hfmwDimension = argHFMwSession.metadata.custom1; break; case HfmDimensionType.Custom2: hfmwDimension = argHFMwSession.metadata.custom2; break; case HfmDimensionType.Custom3: hfmwDimension = argHFMwSession.metadata.custom3; break; case HfmDimensionType.Custom4: hfmwDimension = argHFMwSession.metadata.custom4; break; } return(hfmwDimension); }
public int GetDefaultParentID(String argEntity) { try { if (!HfmDimension.memberIdDictionary[HfmDimensionType.Parent].ContainsKey(argEntity)) { int entityId = GetMemberID(HfmDimensionType.Entity, argEntity); HFMwMetadata hfmwMetadata = _HFMwSession.metadata as HFMwMetadata; HFMwEntities hfmwEntities = hfmwMetadata.entities as HFMwEntities; HFMwDimension hfmwDimension = hfmwEntities.dimension as HFMwDimension; int parentEntityId = hfmwDimension.GetDefaultParent(entityId); memberIdDictionary[HfmDimensionType.Parent].Add(argEntity, parentEntityId); } return(memberIdDictionary[HfmDimensionType.Parent][argEntity]); } catch (Exception ex) { throw new Exception(HfmCommon.GetHfmErrorMessage(ex.Message)); } }
public List <DimensionMember> EnumMembers2(HfmDimensionType argDimensionType, string argMemberListName) { object count = null, varMemberIDs = null, varParentIDs = null, valMemberLabels = null, varDescriptions = null, varNumChildren = null, varTotalMembersInEnum = null; HFMwDimension hfmwDimension = HfmDimensionTypeHelper.GetHFMwDimension(_HFMwSession, argDimensionType); count = hfmwDimension.EnumMembers2(tagPOVDEFAULTS.MEMBERNOTUSED, tagPOVDEFAULTS.MEMBERNOTUSED, tagPOVDEFAULTS.MEMBERNOTUSED, tagPOVDEFAULTS.MEMBERNOTUSED, argMemberListName, "", 0, 0, (int)tagWEBOM_METADATA_INFO_FLAGS.WEBOM_METADATA_INFO_ALL, ref varMemberIDs, ref varParentIDs, ref valMemberLabels, ref varDescriptions, ref varNumChildren, ref varTotalMembersInEnum); int total = (int)varTotalMembersInEnum; List <DimensionMember> retList = new List <DimensionMember>(); for (int i = 0; i < total; i++) { DimensionMember dimensionMember = new DimensionMember(); dimensionMember.MemberID = (int)((object[])varMemberIDs)[i]; if (varParentIDs != null) { dimensionMember.ParentID = (int)((object[])varParentIDs)[i]; } dimensionMember.NumChildren = (int)((object[])varNumChildren)[i]; dimensionMember.MemberLabel = ((object[])valMemberLabels)[i] as string; dimensionMember.Description = ((object[])varDescriptions)[i] as string; retList.Add(dimensionMember); } return(retList); }