Exemplo n.º 1
0
        protected override void Setup(SetupContext context)
        {
            DtsParameter param = context.Package.GetParameter("SourcePath");
            object       val   = param.GetValue();

            param.SetValue(Constants.CustomersFileSource);

            DtsVariable var1 = context.Package.GetVariable("DestinationPath");

            var1.SetValue(Constants.CustomersFileDestination);

            DtsVariable var2 = context.Package.GetVariable("ConvertDestinationPath");

            var2.SetValue(Constants.CustomersFileConverted);

            DtsVariable var3 = context.Package.GetVariable("CopyCustomersPath");

            var3.SetValue(Constants.PathToCopyCustomersPackage);

            DtsVariable var4 = context.Package.GetVariable("LoadCustomersPath");

            var4.SetValue(Constants.PathToLoadCustomersPackage);

            DtsVariable var5 = context.Package.GetVariable("ConnectionString");

            var5.SetValue(Constants.SsisDbConnectionString);
        }
        protected override void Setup(SetupContext context)
        {
            DtsVariable custSrc = context.Package.GetVariableForPath(@"\[CopyCustomers4].[SourcePath]");

            custSrc.SetValue(Constants.CustomersFileSource);

            DtsVariable custDest = context.Package.GetVariableForPath(@"\[CopyCustomers4].[DestinationPath]");

            custDest.SetValue(Constants.CustomersFileDestination);

            DtsVariable custDestNew = context.Package.GetVariableForPath(@"\[CopyCustomers4].[ConvertDestinationPath]");

            custDestNew.SetValue(Constants.CustomersFileConverted);

            DtsVariable variable = context.Package.GetVariableForPath(@"\[CopyCustomers4]\[DFT Convert customer names].[CustomerCount]");

            variable.SetValue(0);

            DtsConnection newCustomersConnection = context.Package.GetConnection("New Customers Src");

            newCustomersConnection.SetConnectionString(Constants.CustomersNewFileSource);

            DtsConnection productConnection = context.Package.GetConnection("Products Src");

            productConnection.SetConnectionString(Constants.ProductsFileSource);
        }
        protected override void Setup(SetupContext context)
        {
            DtsVariable variable = context.Package.GetVariableForPath(@"\[LoadCustomers].[CustomerCount]");

            variable.SetValue(0);
            DtsVariable variable2 = context.Package.GetVariableForPath(@"\[LoadCustomers].[CustomersImported]");

            variable2.SetValue(true);
        }
Exemplo n.º 4
0
        protected override void Setup(SetupContext context)
        {
            DtsVariable custDestNew = context.Package.GetVariableForPath(@"\[CopyCustomers2].[ConvertDestinationPath]");

            custDestNew.SetValue(Constants.CustomersFileConverted);

            DtsVariable variable = context.Package.GetVariableForPath(@"\[CopyCustomers2]\[DFT Convert customer names].[CustomerCount]");

            variable.SetValue(0);
        }
        protected override void Setup(SetupContext context)
        {
            DtsVariable custSrc = context.Package.GetVariableForPath(@"\[CopyCustomers].[SourcePath]");

            custSrc.SetValue(Constants.CustomersFileSource);

            DtsVariable custDest = context.Package.GetVariable(@"DestinationPath");

            custDest.SetValue(Constants.CustomersFileDestination);
        }
Exemplo n.º 6
0
        protected override void Setup(SetupContext context)
        {
            ReplaceConnectionStrings();

            var config = context.Package.GetConfiguration("ConnectionStrings");

            config.SetConfigurationString(Constants.PathToDtsConfig);

            DtsVariable variable = context.Package.GetVariableForPath(@"\[CopyCustomersWithConfig]\[DFT Convert customer names].[CustomerCount]");

            variable.SetValue(0);
        }
        protected override void Setup(SetupContext context)
        {
            DtsVariable variable = context.Package.GetVariableForPath(@"\[LoadCustomers].[CustomerCount]");

            variable.SetValue(0);

            _dummyConstraint = context.Package.GetPrecedingConstraintForPath(@"\[LoadCustomers]\[SCR Dummy].[DummyConstraint]");
            _dummyConstraint.SetExecutionResult(DtsExecutionResult.Success);

            _countConstraint = context.Package.GetPrecedingConstraintForPath(@"\[LoadCustomers]\[SEQC Load]\[SQL Get Count of data in destination].[CountConstraint]");
            _countConstraint.SetExecutionResult(DtsExecutionResult.Success);
        }
        protected override void Setup(SetupContext context)
        {
            File.Copy(Constants.CustomersFileSource, Constants.CustomersFileDestination);

            DtsVariable custDest = context.Package.GetVariableForPath(@"\[CopyCustomers].[DestinationPath]");

            custDest.SetValue(Constants.CustomersFileDestination);

            DtsVariable custDestNew = context.Package.GetVariable(@"ConvertDestinationPath");

            custDestNew.SetValue(Constants.CustomersFileConverted);
        }
Exemplo n.º 9
0
        protected override void Setup(SetupContext context)
        {
            File.Copy(Constants.CustomersFileSource, Constants.CustomersFileDestination);

            context.Package.GetConnection("CustomerDB").SetConnectionString(Constants.SsisDbConnectionString);
            context.Package.GetConnection("Customers Src").SetConnectionString(Constants.CustomersFileSource);
            DtsVariable variable = context.Package.GetVariableForPath(@"\[LoadCustomers].[CustomerCount]");

            variable.SetValue(0);
            DtsVariable variable2 = context.Package.GetVariableForPath(@"\[LoadCustomers].[CustomersImported]");

            variable2.SetValue(false);
        }
Exemplo n.º 10
0
        protected override void Setup(SetupContext context)
        {
            DtsVariable custSrc = context.Package.GetVariableForPath(@"\[LoopWithDataFlow].[SourcePath]");

            custSrc.SetValue(Constants.CustomersFileSource);

            DtsVariable custDest = context.Package.GetVariableForPath(@"\[LoopWithDataFlow].[DestinationPath]");

            custDest.SetValue(Constants.CustomersFileDestination);

            DtsVariable custDestNew = context.Package.GetVariable(@"ConvertDestinationPath");

            custDestNew.SetValue(Constants.CustomersFileConverted);

            DtsVariable variable = context.Package.GetVariableForPath(@"\[LoopWithDataFlow]\[FOR]\[DFT Convert customer names].[CustomerCount]");

            variable.SetValue(0);
        }
Exemplo n.º 11
0
        protected override void Setup(SetupContext context)
        {
            context.Package.GetConnection("CustomerDB").SetConnectionString(Constants.SsisDbConnectionString);
            context.Package.GetConnection("Customers Src").SetConnectionString(Constants.CustomersFileSource);
            DtsVariable variable = context.Package.GetVariableForPath(@"\[LoadCustomers].[CustomerCount]");

            variable.SetValue(0);

            const string query = @"insert into [dbo].[CustomersStaging]
                                    ([Id], [Name])
                                    values
                                    (1, 'ACME')
                                    ,(2, 'ALL')";

            context.DataAccess.OpenConnection(Constants.DbConnectionString);
            context.DataAccess.ExecuteNonQuery(query);
            context.DataAccess.CloseConnection();
        }
Exemplo n.º 12
0
        protected override void Setup(SetupContext context)
        {
            DtsParameter custSrcParam = context.Package.Project.GetParameter(@"SourcePath");

            custSrcParam.SetValue(Constants.CustomersFileSource);

            DtsParameter custDesParam = context.Package.Project.GetParameter(@"DestinationPath");

            custDesParam.SetValue(Constants.CustomersFileDestination);

            DtsParameter custDesConvertedParam = context.Package.Project.GetParameter(@"ConvertDestinationPath");

            custDesConvertedParam.SetValue(Constants.CustomersFileConverted);

            DtsVariable variable = context.Package.GetVariableForPath(@"\[CopyCustomers]\[DFT Convert customer names].[CustomerCount]");

            variable.SetValue(0);
        }