예제 #1
0
        public IQuery Execute()
        {
            var parser = factory.Instantiate(args.Source);

            var request = new SharedDatasetRequest(args.Source, args.Path, args.Name);

            var parsingResult = parser.ExtractCommand(request);

            var query = new Query(parsingResult.Text, args.ConnectionString, args.Timeout, args.Parameters, args.Variables, parsingResult.CommandType);

            return(query);
        }
예제 #2
0
        public IDbCommand Execute()
        {
            var parser = factory.Instantiate(args.Source);

            var request = new SharedDatasetRequest(args.Source, args.Path, args.Name);

            var parsingResult = parser.ExtractCommand(request);

            var commandBuilder = new CommandBuilder();
            var cmd            = commandBuilder.Build(args.ConnectionString, parsingResult.Text, parsingResult.CommandType, args.Parameters, args.Variables, args.Timeout);

            return(cmd);
        }
예제 #3
0
        public void ExtractQuery_SharedDataSet_CorrectQuery()
        {
            var request = new SharedDatasetRequest(
                ConnectionStringReader.GetReportServerDatabase()
                , "/AdventureWorks Sample Reports/"
                , "EmpSalesMonth"
                );

            var parser = new DatabaseReportingParser();
            var query  = parser.ExtractCommand(request);

            Assert.That(query.Text,
                        Does.Contain("SELECT"));
            Assert.That(query.CommandType, Is.EqualTo(CommandType.Text));
        }
예제 #4
0
        public override string GetQuery()
        {
            var parser = ParserFactory.GetParser(Source);

            var request = new SharedDatasetRequest
                          (
                Source,
                string.IsNullOrEmpty(Source) ? Settings.BasePath + Path : Path,
                Name
                          );

            command = parser.ExtractQuery(request);

            return(command.Text);
        }
예제 #5
0
        public override string GetQuery()
        {
            var factory = new ReportingParserFactory();
            var parser  = factory.Instantiate(Source);

            var request = new SharedDatasetRequest
                          (
                Source,
                string.IsNullOrEmpty(Source) ? Settings.BasePath + Path : Path,
                Name
                          );

            command = parser.ExtractCommand(request);

            return(command.Text);
        }
예제 #6
0
        public void ExtractQuery_ExistingSharedDataSet_CorrectQueryReturned()
        {
            var request = new SharedDatasetRequest(
                string.Empty
                , ReportFileDirectory
                , "SalesEmployees"
                );

            var parser = new FileReportingParser();
            var query  = parser.ExtractCommand(request);

            Assert.That(query.Text,
                        Does.Contain("SELECT").And
                        .Contain("[Sales].[SalesPerson]").And
                        .Contain("[HumanResources].[Employee]"));
            Assert.That(query.CommandType, Is.EqualTo(CommandType.Text));
        }