Beispiel #1
0
        public virtual CubeData GetData()
        {
            ConstrainedViewId();
            if (string.IsNullOrWhiteSpace(ModuleName))
            {
                throw new ArgumentException("No view id is provided");
            }

            int viewId;

            if (!Int32.TryParse(ModuleName, out viewId))
            {
                throw new ArgumentException(string.Format("View Id must be an integer but provide '{0}'", ModuleName));
            }

            SetProxy();
            CubeData data = null;

            try
            {
                data = _proxy.GetCubeData(new CubeCommandInfo
                {
                    CommandText          = ModuleName,
                    CommandType          = CommandType.ViewId,
                    CubeConnectionString = ConnectionString,
                    DbConnectionString   = DbConnectionString,
                    Parameters           = GetCopyOfParameters(),
                    DataFormat           = GetDataFormat()
                });
            }
            catch (Exception ex)
            {
                _proxy = null;
                Logger.Error(ex.Message);
            }
            return(data);
        }