Ejemplo n.º 1
0
        /// <summary>
        /// Get SSAS measure dataType by name
        /// </summary>
        /// <param name="name">measure dataType string format</param>
        /// <returns></returns>
        public static Microsoft.AnalysisServices.MeasureDataType GET_SSAS_MEASURE_DATA_TYPE_BY_NAME(String name)
        {
            MeasureDataType returnValue = MeasureDataType.Double;
            String          dataType    = name.ToLower();

            switch (dataType)
            {
            case "integer":
                returnValue = MeasureDataType.Integer;
                break;

            case "bigint":
                returnValue = MeasureDataType.BigInt;
                break;

            case "wchar":
                returnValue = MeasureDataType.WChar;
                break;

            case "double":
                returnValue = MeasureDataType.Double;
                break;

            default:
                break;
            }

            //helper.print_message_to_client("The measure data type of ["+dataType+"] didn't be defined yet!",'warning')
            return(returnValue);
        }
 public MeasureDataTypeOption(MeasureDataType dataType, Type type, decimal min, decimal max, bool allowsDecimals, bool allowsMoreThan4Decimals, string limitations)
 {
     SetProperties(dataType, type, (double)min, (double)max, allowsDecimals, allowsMoreThan4Decimals);
     this.displayMin  = min.ToString("n4");
     this.displayMax  = max.ToString("n4");
     this.limitations = limitations;
 }
            private void SetProperties(MeasureDataType dataType, Type type, double min, double max, bool allowsDecimals, bool allowsMoreThan4Decimals)
            {
                this.dataType = dataType;
                this.type     = type;

                if (dataType == MeasureDataType.Currency) //Type=Decimal isn't enough for it to correctly determine Currency
                {
                    this.oleDbType = OleDbType.Currency;
                }
                else
                {
                    this.oleDbType = OleDbTypeConverter.GetRestrictedOleDbType(type);
                }

                this.min                     = min;
                this.max                     = max;
                this.displayMin              = FormatDouble(min);
                this.displayMax              = FormatDouble(max);
                this.allowsDecimals          = allowsDecimals;
                this.allowsMoreThan4Decimals = allowsMoreThan4Decimals;
            }
Ejemplo n.º 4
0
        private static MeasureDataType GetMeasureDataType(string value, string precTxt, 
            string unitCode, string unitCodeId, string unitName,
            string qualCode, string qualCodeId, string qualName)
        {
            if (string.IsNullOrEmpty(value))
            {
                return null;
            }
            else
            {
                MeasureDataType obj = new MeasureDataType();

                obj.MeasureValue = value;
                obj.MeasurePrecisionText = precTxt;

                if (!string.IsNullOrEmpty(unitCode))
                {
                    obj.MeasureUnit = new MeasureUnitDataType();
                    obj.MeasureUnit.MeasureUnitCode = unitCode;
                    obj.MeasureUnit.MeasureUnitCodeListIdentifier = (MeasureUnitCodeListIdentifierDataType)GetCodeList(unitCodeId);
                    obj.MeasureUnit.MeasureUnitName = unitName;
                }

                if (!string.IsNullOrEmpty(qualCode))
                {
                    obj.ResultQualifier = new ResultQualifierDataType();
                    obj.ResultQualifier.ResultQualifierCode = qualCode;
                    obj.ResultQualifier.ResultQualifierCodeListIdentifier = (ResultQualifierCodeListIdentifierDataType)GetCodeList(qualCodeId);
                    obj.ResultQualifier.ResultQualifierName = qualName;
                }

                return obj;
            }


        }
 public MeasureDataTypeOption(MeasureDataType dataType, Type type, double min, double max, bool allowsDecimals, bool allowsMoreThan4Decimals, string limitations)
 {
     SetProperties(dataType, type, min, max, allowsDecimals, allowsMoreThan4Decimals);
     this.limitations = limitations;
 }
 public MeasureDataTypeOption(MeasureDataType dataType, Type type, double min, double max, bool allowsDecimals, bool allowsMoreThan4Decimals)
 {
     SetProperties(dataType, type, min, max, allowsDecimals, allowsMoreThan4Decimals);
 }
            private void SetProperties(MeasureDataType dataType, Type type, double min, double max, bool allowsDecimals, bool allowsMoreThan4Decimals)
            {
                this.dataType = dataType;
                this.type = type;

                if (dataType == MeasureDataType.Currency) //Type=Decimal isn't enough for it to correctly determine Currency
                    this.oleDbType = OleDbType.Currency;
                else
                    this.oleDbType = OleDbTypeConverter.GetRestrictedOleDbType(type);

                this.min = min;
                this.max = max;
                this.displayMin = FormatDouble(min);
                this.displayMax = FormatDouble(max);
                this.allowsDecimals = allowsDecimals;
                this.allowsMoreThan4Decimals = allowsMoreThan4Decimals;
            }
 public MeasureDataTypeOption(MeasureDataType dataType, Type type, decimal min, decimal max, bool allowsDecimals, bool allowsMoreThan4Decimals, string limitations)
 {
     SetProperties(dataType, type, (double)min, (double)max, allowsDecimals, allowsMoreThan4Decimals);
     this.displayMin = min.ToString("n4");
     this.displayMax = max.ToString("n4");
     this.limitations = limitations;
 }
 public MeasureDataTypeOption(MeasureDataType dataType, Type type, double min, double max, bool allowsDecimals, bool allowsMoreThan4Decimals, string limitations)
 {
     SetProperties(dataType, type, min, max, allowsDecimals, allowsMoreThan4Decimals);
     this.limitations = limitations;
 }
 public MeasureDataTypeOption(MeasureDataType dataType, Type type, double min, double max, bool allowsDecimals, bool allowsMoreThan4Decimals)
 {
     SetProperties(dataType, type, min, max, allowsDecimals, allowsMoreThan4Decimals);
 }