Exemplo n.º 1
0
 public void TestEnumCustomMembers()
 {
     HfmSession   hfmSession   = HfmHelper.CreateHfmSession();
     HfmDimension hfmDimension = hfmSession.GetDimension();
     var          ret          = hfmDimension.EnumCustomMembers(HfmDimensionType.Custom2);
     var          retv         = ret.FirstOrDefault(c => c.Description == "TOPC2");
 }
Exemplo n.º 2
0
 public void TestEnumEntityMembers()
 {
     HfmSession   hfmSession   = HfmHelper.CreateHfmSession();
     HfmDimension hfmDimension = hfmSession.GetDimension();
     var          ret          = hfmDimension.EnumEntityMembers();
     var          retv         = ret.FirstOrDefault(c => c.Description == "GLP Wuxi Logistics Development Co.Ltd.");
 }
Exemplo n.º 3
0
 public void TestEnumAccountMembers()
 {
     HfmSession   hfmSession   = HfmHelper.CreateHfmSession();
     HfmDimension hfmDimension = hfmSession.GetDimension();
     var          ret          = hfmDimension.EnumAccountMembers();
     var          retv         = ret.FirstOrDefault(c => c.Description == "HisRate_Acquisition");
 }
Exemplo n.º 4
0
        public void TestEnumMembers2()
        {
            HfmSession   hfmSession   = HfmHelper.CreateHfmSession();
            HfmDimension hfmDimension = hfmSession.GetDimension();
            var          ret          = hfmDimension.EnumMembers2(HfmDimensionType.Account);

            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Scenario);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Custom1);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Custom2);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Custom3);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Custom4);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Entity);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Icp);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Period);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.View);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Year);
            Assert.Less(0, ret.Count());
            ret = hfmDimension.EnumMembers2(HfmDimensionType.Value);
            Assert.Less(0, ret.Count());
        }
Exemplo n.º 5
0
        public void TestConnect()
        {
            bool connected = HfmSession.TestConnect("", "admin", "weilai#00", "192.168.192.188", "Financial Management",
                                                    "GLPCON");

            Assert.AreEqual(connected, true);

            connected = HfmSession.TestConnect("", "admin", "error password", "192.168.192.188", "Financial Management",
                                               "GLPCON");
            Assert.AreEqual(connected, false);
        }
Exemplo n.º 6
0
        public void TestGetMember()
        {
            HfmSession   hfmSession   = HfmHelper.CreateHfmSession();
            HfmDimension hfmDimension = hfmSession.GetDimension();
            var          ret          = hfmDimension.EnumMembers2(HfmDimensionType.Account);

            for (int index = 0; index < ret.Count && index < 20; index++)
            {
                DimensionMember member = ret[index];
                int             id     = hfmDimension.GetMemberID(HfmDimensionType.Account, member.MemberLabel);
                Assert.AreEqual(id, member.MemberID);
                string label = hfmDimension.GetMemberLabel(HfmDimensionType.Account, member.MemberID);
                Assert.AreEqual(label, member.MemberLabel);
            }
        }
Exemplo n.º 7
0
        public void Test()
        {
            DataTable tesTable = CreateDataTable();
            var       row      = tesTable.NewRow();

            row["HFM_SCENARIO"] = "Actual";
            row["HFM_YEAR"]     = "2015";
            row["HFM_PERIOD"]   = "FM03";
            row["HFM_VIEW"]     = "YTD";
            row["HFM_PARENT"]   = "WOFE_ONSHORE&Partial_Offshore";
            row["HFM_ENTITY"]   = "Songjiang_Onshore";
            row["HFM_VALUE"]    = "[Elimination]";
            row["HFM_ACCOUNT"]  = "Plug110004_01";
            row["HFM_ICP"]      = "[ICP Top]";
            row["HFM_CUSTOM1"]  = "TopC1";
            row["HFM_CUSTOM2"]  = "Closing";
            row["HFM_CUSTOM3"]  = "TopC3";
            row["HFM_CUSTOM4"]  = "TopC4";
            tesTable.Rows.Add(row);
            HfmSession hfmSession = HfmHelper.CreateHfmSession();
            HfmData    data       = hfmSession.GetData();

            data.GetCells(tesTable);

            tesTable            = CreateDataTable();
            row                 = tesTable.NewRow();
            row["HFM_SCENARIO"] = "Actual";
            row["HFM_YEAR"]     = "2015";
            row["HFM_PERIOD"]   = "FM03";
            row["HFM_VIEW"]     = "YTD";
            //row["HFM_PARENT"] = "WOFE_ONSHORE&Partial_Offshore";
            row["HFM_ENTITY"]  = "52502";
            row["HFM_VALUE"]   = "[Proportion]";
            row["HFM_ACCOUNT"] = "20202080134";
            //row["HFM_ICP"] = "[ICP Top]";
            //row["HFM_CUSTOM1"] = "TopC1";
            //row["HFM_CUSTOM2"] = "Closing";
            //row["HFM_CUSTOM3"] = "TopC3";
            //row["HFM_CUSTOM4"] = "TopC4";
            tesTable.Rows.Add(row);
            tesTable.ImportRow(row);
            tesTable.Rows[tesTable.Rows.Count - 1]["HFM_ENTITY"] = "51502";

            var retTable = data.ExpandData(tesTable);
        }
Exemplo n.º 8
0
        public void TestExtract()
        {
            XmlSerializer ser = new XmlSerializer(typeof(HSMETADATA), new XmlRootAttribute("HSMETADATA"));

            HfmSession   hfmSession   = HfmHelper.CreateHfmSession();
            HfmDimension hfmDimension = hfmSession.GetDimension();
            string       filePath     = Path.GetTempFileName();
            string       logPath      = Path.GetTempFileName();

            hfmDimension.Extract(filePath, logPath);



            HSMETADATA data;

            using (FileStream stream = new FileStream(filePath, FileMode.Open))
            {
                data = (HSMETADATA)ser.Deserialize(stream);
                stream.Close();
            }
            Assert.AreEqual(data.DIMENSION.Length, 7);
        }
Exemplo n.º 9
0
        public static HfmSession CreateHfmSession()
        {
            HfmSession hfmSession = HfmSession.CreateSession("", "admin", "weilai#00", "192.168.192.188", "Financial Management", "GLPCON");

            return(hfmSession);
        }