public ADOTabularColumn(ADOTabularTable table, string internalReference, string name, string caption, string description,
                         bool isVisible, ADOTabularObjectType columnType, string contents)
 {
     Table             = table;
     InternalReference = internalReference;
     Name        = name ?? internalReference;
     Caption     = caption ?? internalReference ?? name;
     Description = description;
     IsVisible   = isVisible;
     ObjectType  = columnType;
     Contents    = contents;
 }
Exemple #2
0
        // TODO - can we delete this??
        //public ADOTabularColumn(ADOTabularTable table, DataRow dr, ADOTabularObjectType colType)
        //{
        //    Table = table;
        //    ObjectType = colType;
        //    if (colType == ADOTabularObjectType.Column)
        //    {
        //        Caption = dr["HIERARCHY_CAPTION"].ToString();
        //        Name = dr["HIERARCHY_NAME"].ToString();
        //        IsVisible = bool.Parse(dr["HIERARCHY_IS_VISIBLE"].ToString());
        //        Description = dr["DESCRIPTION"].ToString();
        //    }
        //    else
        //    {
        //        Caption = dr["MEASURE_CAPTION"].ToString();
        //        Name = dr["MEASURE_NAME"].ToString();
        //        IsVisible = bool.Parse(dr["MEASURE_IS_VISIBLE"].ToString());
        //        Description = dr["DESCRIPTION"].ToString();
        //    }
        //}

        public ADOTabularColumn(ADOTabularTable table, string internalReference, string name, string caption, string description,
                                bool isVisible, ADOTabularObjectType columnType, string contents)
        {
            Table             = table;
            InternalReference = internalReference;
            Name        = name ?? internalReference;
            Caption     = caption ?? internalReference ?? name;
            Description = description;
            IsVisible   = isVisible;
            ObjectType  = columnType;
            Contents    = contents;
            Role        = $"{Table.InternalReference}_{InternalReference}";
            Variations  = new List <ADOTabularVariation>();
        }
Exemple #3
0
        public ADOTabularColumn(ADOTabularTable table, string internalReference, string name, string caption, string description,
                                bool isVisible, ADOTabularObjectType columnType, string contents)
        {
            Contract.Requires(table != null, "The table parameter must not be null");

            Table             = table;
            InternalReference = internalReference;
            Name        = name ?? internalReference;
            Caption     = caption ?? internalReference ?? name;
            Description = description;
            IsVisible   = isVisible;
            ObjectType  = columnType;
            Contents    = contents;
            Role        = $"{Table.InternalReference}_{InternalReference}";
            Variations  = new List <ADOTabularVariation>();
        }
 public ADOTabularHierarchy(ADOTabularTable table, string internalName, string name, string caption, string description,
                            bool isVisible, ADOTabularObjectType columnType, string contents, string structure)
     : base(table, internalName, name, caption, description, isVisible, columnType, contents)
 {
     _levels    = new List <ADOTabularLevel>();
     _structure = structure;
     if (structure == "Unnatural")
     {
         if (description.Length > 0)
         {
             Description += '\n';
         }
         Description += "WARNING: Unnatural Hierarchy - may have a negative performance impact";
         ObjectType   = ADOTabularObjectType.UnnaturalHierarchy;
     }
 }
 // TODO - can we delete this??
 public ADOTabularColumn(ADOTabularTable table, DataRow dr, ADOTabularObjectType colType)
 {
     Table      = table;
     ObjectType = colType;
     if (colType == ADOTabularObjectType.Column)
     {
         Caption     = dr["HIERARCHY_CAPTION"].ToString();
         Name        = dr["HIERARCHY_NAME"].ToString();
         IsVisible   = bool.Parse(dr["HIERARCHY_IS_VISIBLE"].ToString());
         Description = dr["DESCRIPTION"].ToString();
     }
     else
     {
         Caption     = dr["MEASURE_CAPTION"].ToString();
         Name        = dr["MEASURE_NAME"].ToString();
         IsVisible   = bool.Parse(dr["MEASURE_IS_VISIBLE"].ToString());
         Description = dr["DESCRIPTION"].ToString();
     }
 }
Exemple #6
0
        public ADOTabularColumn(ADOTabularTable table, string internalReference, string name, string caption, string description,
                                bool isVisible, ADOTabularObjectType columnType, string contents)
        {
            Contract.Requires(table != null, "The table parameter must not be null");

            Table             = table;
            InternalReference = internalReference;
            Name        = name ?? internalReference;
            Caption     = caption ?? internalReference ?? name;
            Description = description;
            IsVisible   = isVisible;
            ObjectType  = columnType;
            Contents    = contents;
            Role        = $"{Table.InternalReference}_{InternalReference}";
            Variations  = new List <ADOTabularVariation>();
            // tag measures that return the formatString for a calculation group
            if (columnType == ADOTabularObjectType.Measure && name == $"_{caption} FormatString")
            {
                ObjectType = ADOTabularObjectType.MeasureFormatString;
                Caption   += " (FormatString)";
            }
        }
Exemple #7
0
        public static QueryBuilderColumn Create(string caption, string daxName, Type dataType, ADOTabularObjectType objectType, bool isModelItem = true)
        {
            var col = new Mock <IADOTabularColumn>();

            col.SetupGet(x => x.Caption).Returns(caption);
            col.SetupGet(x => x.DaxName).Returns(daxName);
            col.SetupGet(x => x.DataType).Returns(dataType);
            col.SetupGet(x => x.ObjectType).Returns(objectType);

            var col2 = new QueryBuilderColumn(col.Object, isModelItem);

            return(col2);
        }
 public ADOTabularKpi(ADOTabularTable table, string internalName, string name, string caption, string description,
                      bool isVisible, ADOTabularObjectType columnType, string contents, KpiDetails kpi)
     : base(table, internalName, name, caption, description, isVisible, columnType, contents)
 {
     _kpi = kpi;
 }
Exemple #9
0
        public static QueryBuilderColumn Create(string caption, string daxName, Type dataType, ADOTabularObjectType objectType, bool isModelItem = true)
        {
            var col = CreateADOTabularColumn(caption, daxName, dataType, objectType, isModelItem);

            var col2 = new QueryBuilderColumn(col, isModelItem);

            return(col2);
        }
Exemple #10
0
        public ADOTabularStandardColumn(ADOTabularTable table, string internalName, string name, string caption, string description,
                                        bool isVisible, ADOTabularObjectType columnType, string contents)
            : base(table, internalName, name, caption, description, isVisible, columnType, contents)

        {
        }
Exemple #11
0
        public static QueryBuilderColumn Create(string caption, string daxName, Type dataType, ADOTabularObjectType objectType, bool isModelItem = true, SortDirection sortDirection = SortDirection.ASC)
        {
            var col = CreateADOTabularColumn(caption, daxName, dataType, objectType, isModelItem, sortDirection);

            var col2 = new QueryBuilderColumn(col, isModelItem, new MockEventAggregator());

            return(col2);
        }
Exemple #12
0
        public static IADOTabularColumn CreateADOTabularColumn(string caption, string daxName, Type dataType, ADOTabularObjectType objectType, bool isModelItem = true, SortDirection sortDirection = SortDirection.ASC)
        {
            var col = new Mock <IADOTabularColumn>();

            col.SetupGet(x => x.Caption).Returns(caption);
            col.SetupGet(x => x.DaxName).Returns(daxName);
            col.SetupGet(x => x.SystemType).Returns(dataType);
            col.SetupGet(x => x.ObjectType).Returns(objectType);
            return(col.Object);
        }