예제 #1
0
 public SortedDictionary<string, ADOTabularColumn> Visit(ADOTabularColumnCollection columns)
 {
     var ret = new SortedDictionary<string, ADOTabularColumn>();
     var resColl = new AdomdRestrictionCollection
                       {
                           {"HIERARCHY_ORIGIN", 2},
                           {"CUBE_NAME", string.Format("{0}", columns.Table.Model.Name)},
                           {"DIMENSION_UNIQUE_NAME", string.Format("[{0}]", columns.Table.Caption)},
                           {"HIERARCHY_VISIBILITY", _conn.ShowHiddenObjects ? (int)(MdschemaVisibility.Visible | MdschemaVisibility.NonVisible) : (int)(MdschemaVisibility.Visible)}
                       };
     DataTable dtHier = _conn.GetSchemaDataSet("MDSCHEMA_HIERARCHIES", resColl).Tables[0];
     foreach (DataRow dr in dtHier.Rows)
     {
         ret.Add(dr[""].ToString()
             , new ADOTabularColumn(columns.Table
                 ,dr["HIERARCHY_NAME"].ToString()
                 ,dr["HIERARCHY_NAME"].ToString()
                 , dr["HIERARCHY_CAPTION"].ToString()
                 ,dr["DESCRIPTION"].ToString()
                 ,bool.Parse(dr["HIERARCHY_IS_VISIBLE"].ToString())
                 ,ADOTabularColumnType.Column
                 ,"")
                 );
     }
     var resCollMeasures = new AdomdRestrictionCollection
         {
             {"CUBE_NAME", string.Format("{0}", columns.Table.Model.Name)},
             {"MEASUREGROUP_NAME", string.Format("{0}", columns.Table.Caption)},
             {
                 "MEASURE_VISIBILITY",
                 _conn.ShowHiddenObjects
                     ? (int) (MdschemaVisibility.Visible | MdschemaVisibility.NonVisible)
                     : (int) (MdschemaVisibility.Visible)
             }
         };
     DataTable dtMeasures = _conn.GetSchemaDataSet("MDSCHEMA_MEASURES", resCollMeasures).Tables[0];
     foreach (DataRow dr in dtMeasures.Rows)
     {
         ret.Add(dr["MEASURE_NAME"].ToString()
             , new ADOTabularColumn(columns.Table
                 ,dr["MEASURE_NAME"].ToString()
                 ,dr["MEASURE_NAME"].ToString()
                 , dr["MEASURE_CAPTION"].ToString()
                 ,dr["DESCRIPTION"].ToString()
                 ,bool.Parse(dr["MEASURE_IS_VISIBLE"].ToString())
                 ,ADOTabularColumnType.Measure
                 ,"")
                 );
     }
     return ret;
 }
예제 #2
0
 SortedDictionary<string, ADOTabularColumn> IMetaDataVisitor.Visit(ADOTabularColumnCollection columns)
 {
     return new SortedDictionary<string, ADOTabularColumn>();
 }