Пример #1
0
        protected void Build(ExecutableXml executableXml)
        {
            if (executableXml is QueryXml)
            {
                Build(executableXml as QueryXml);
            }
            else
            {
                var connectionString = new ConnectionStringHelper().Execute(executableXml, Scope);

                var queryableXml      = executableXml as QueryableXml;
                var parameters        = BuildParameters(queryableXml.GetParameters());
                var templateVariables = queryableXml.GetTemplateVariables();
                var timeout           = queryableXml.Timeout;

                switch (executableXml)
                {
                case AssemblyXml xml: args = Build(xml, connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout)); break;

                case ReportXml xml: args = Build(xml, connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout)); break;

                case SharedDatasetXml xml: args = Build(xml, connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout)); break;
                }
            }
        }
Пример #2
0
        public void Build()
        {
            if (!isSetup)
            {
                throw new InvalidOperationException();
            }

            var connectionString  = queryXml.GetConnectionString();
            var parameters        = BuildParameters(queryXml.GetParameters());
            var templateVariables = queryXml.GetTemplateVariables();
            var timeout           = queryXml.Timeout;

            if (!string.IsNullOrEmpty(queryXml.InlineQuery))
            {
                args = new EmbeddedQueryResolverArgs(queryXml.InlineQuery
                                                     , connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }

            else if (!string.IsNullOrEmpty(queryXml.File))
            {
                var file = GetFullPath(settingsXml?.BasePath, queryXml.File);

                args = new ExternalFileQueryResolverArgs(file
                                                         , connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }

            else if (queryXml.Assembly != null)
            {
                var file = GetFullPath(settingsXml?.BasePath, queryXml.Assembly.Path);

                args = new AssemblyQueryResolverArgs(
                    file, queryXml.Assembly.Klass, queryXml.Assembly.Method,
                    queryXml.Assembly.Static, queryXml.Assembly.GetMethodParameters()
                    , connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }

            else if (queryXml.Report != null)
            {
                var path = string.IsNullOrEmpty(queryXml.Report.Source) ? settingsXml.BasePath + queryXml.Report.Path : queryXml.Report.Path;

                args = new ReportDataSetQueryResolverArgs(
                    queryXml.Report.Source, path, queryXml.Report.Name, queryXml.Report.Dataset
                    , connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }

            else if (queryXml.SharedDataset != null)
            {
                var path = string.IsNullOrEmpty(queryXml.SharedDataset.Source) ? settingsXml.BasePath + queryXml.SharedDataset.Path : queryXml.SharedDataset.Path;

                args = new SharedDataSetQueryResolverArgs(
                    queryXml.SharedDataset.Source, queryXml.SharedDataset.Path, queryXml.SharedDataset.Name
                    , connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }

            if (args == null)
            {
                throw new ArgumentException();
            }
        }
Пример #3
0
        protected void Build(QueryXml queryXml)
        {
            queryXml.Settings = Settings;
            var connectionString  = new ConnectionStringHelper().Execute(queryXml, Scope);
            var parameters        = BuildParameters(queryXml.GetParameters());
            var templateVariables = queryXml.GetTemplateVariables();
            var timeout           = Convert.ToInt32(Math.Ceiling(queryXml.Timeout / 1000m)); //Timeout is expressed in milliseconds

            if (!string.IsNullOrEmpty(queryXml.InlineQuery))
            {
                args = new EmbeddedQueryResolverArgs(queryXml.InlineQuery
                                                     , connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }

            else if (!string.IsNullOrEmpty(queryXml.File))
            {
                var file = GetFullPath(Settings?.BasePath, queryXml.File);

                args = new ExternalFileQueryResolverArgs(file
                                                         , connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }

            else if (queryXml.Assembly != null)
            {
                args = Build(queryXml.Assembly, connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }


            else if (queryXml.Report != null)
            {
                args = Build(queryXml.Report, connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }


            else if (queryXml.SharedDataset != null)
            {
                args = Build(queryXml.SharedDataset, connectionString, parameters, templateVariables, new TimeSpan(0, 0, timeout));
            }

            if (args == null)
            {
                throw new ArgumentException();
            }
        }
Пример #4
0
 public QueryScalarResolverArgs(BaseQueryResolverArgs args)
 {
     this.QueryArgs = args;
 }
Пример #5
0
 public QueryResultSetResolverArgs(BaseQueryResolverArgs args)
 {
     QueryResolverArgs = args;
 }
Пример #6
0
 public QuerySequenceResolverArgs(BaseQueryResolverArgs args)
 {
     this.QueryArgs = args;
 }