コード例 #1
0
        public FileSystemTask(
            Packages.VulcanPackage vulcanPackage,
            string name,
            string taskDescription,
            DTS.IDTSSequence parentContainer,
            string sourceConnection,
            string destConnection,
            Microsoft.SqlServer.Dts.Tasks.FileSystemTask.DTSFileSystemOperation operation
            )
            :
            base(
                vulcanPackage,
                name,
                taskDescription,
                parentContainer
                )
        {
            Connection source = new Connection(vulcanPackage, sourceConnection, sourceConnection, "FILE", String.Format("\"{0}\"", ExpressionPathBuilder.EscapeBackslashes(sourceConnection)));
            Connection dest   = new Connection(vulcanPackage, destConnection, destConnection, "FILE", String.Format("\"{0}\"", ExpressionPathBuilder.EscapeBackslashes(destConnection)));

            source.SetProperty("FileUsageType", 2);
            dest.SetProperty("FileUsageType", 2);
            fileSystemTask        = (DTS.TaskHost)parentContainer.Executables.Add("STOCK:FileSystemTask");
            fileSystemTask.Name   = name;
            this.Task.Operation   = operation;
            this.Task.Source      = source.ConnectionManager.ID;
            this.Task.Destination = dest.ConnectionManager.ID;
        }
コード例 #2
0
ファイル: FileSystemTask.cs プロジェクト: japj/vulcan
        public FileSystemTask(
            Packages.VulcanPackage vulcanPackage, 
            string name, 
            string taskDescription, 
            DTS.IDTSSequence parentContainer,
            string sourceConnection, 
            string destConnection,  
            Microsoft.SqlServer.Dts.Tasks.FileSystemTask.DTSFileSystemOperation operation
            )
            : base(vulcanPackage,
            name,
            taskDescription,
            parentContainer)
        {
            Connection source = new Connection(vulcanPackage, sourceConnection, sourceConnection, "FILE",String.Format("\"{0}\"",ExpressionPathBuilder.EscapeBackslashes(sourceConnection)));
            Connection dest = new Connection(vulcanPackage, destConnection, destConnection, "FILE",String.Format("\"{0}\"",ExpressionPathBuilder.EscapeBackslashes(destConnection)));

            source.SetProperty("FileUsageType", 2);
            dest.SetProperty("FileUsageType", 2);
            fileSystemTask = (DTS.TaskHost)parentContainer.Executables.Add("STOCK:FileSystemTask");
            fileSystemTask.Name = name;
            this.Task.Operation = operation;
            this.Task.Source = source.ConnectionManager.ID;
            this.Task.Destination = dest.ConnectionManager.ID;
        }
コード例 #3
0
ファイル: FTPTask.cs プロジェクト: mosamy/vulcan
        public FTPTask(
            Packages.VulcanPackage vulcanPackage,
            string name,
            string taskDescription,
            DTS.IDTSSequence parentContainer,
            string serverName,
            string port,
            string userName,
            string password,
            string remotePath,
            bool isRemotePathVariable,
            string localPath,
            bool isLocalPathVariable,
            Microsoft.SqlServer.Dts.Tasks.FtpTask.DTSFTPOp operation
            )
            :
            base(
                vulcanPackage,
                name,
                taskDescription,
                parentContainer
                )
        {
            fTPTask             = (DTS.TaskHost)parentContainer.Executables.Add("STOCK:FTPTask");
            fTPTask.Name        = name;
            fTPTask.Description = taskDescription;
            this.Task.Operation = operation;

            this.Task.IsRemotePathVariable = isRemotePathVariable;
            this.Task.IsLocalPathVariable  = isLocalPathVariable;

            Connection fTPServerConnection = new Connection(vulcanPackage, serverName, serverName, "FTP", String.Format("\"{0}:{1}\"", serverName, port));

            fTPServerConnection.SetProperty("ServerUserName", userName);
            fTPServerConnection.SetProperty("ServerPassword", password);
            this.Task.Connection = fTPServerConnection.ConnectionManager.ID;

            if (this.Task.IsRemotePathVariable == true)
            {
                this.Task.RemotePath = remotePath;
            }
            else
            {
                this.Task.RemotePath = remotePath;
            }

            if (this.Task.IsLocalPathVariable == true)
            {
                this.Task.LocalPath = localPath;
            }
            else
            {
                Connection localConnection  = new Connection(vulcanPackage, localPath, localPath, "File", String.Format("\"{0}\"", ExpressionPathBuilder.EscapeBackslashes(localPath)));
                int        intFileUsageType = 2;
                switch (operation)
                {
                case Microsoft.SqlServer.Dts.Tasks.FtpTask.DTSFTPOp.Send:
                    intFileUsageType = 0;
                    break;

                case Microsoft.SqlServer.Dts.Tasks.FtpTask.DTSFTPOp.Receive:
                    intFileUsageType = 2;
                    break;

                default:
                    intFileUsageType = 2;
                    break;
                }
                localConnection.SetProperty("FileUsageType", intFileUsageType);

                this.Task.LocalPath = localPath;
            }
        }
コード例 #4
0
ファイル: FTPTask.cs プロジェクト: japj/vulcan
        public FTPTask(
            Packages.VulcanPackage vulcanPackage,
            string name,
            string taskDescription,
            DTS.IDTSSequence parentContainer,
            string serverName,
            string port,
            string userName,
            string password,
            string remotePath,
            bool isRemotePathVariable,
            string localPath,
            bool isLocalPathVariable,
            Microsoft.SqlServer.Dts.Tasks.FtpTask.DTSFTPOp operation
            )
            : base(vulcanPackage,
            name,
            taskDescription,
            parentContainer)
        {
            fTPTask = (DTS.TaskHost)parentContainer.Executables.Add("STOCK:FTPTask");
            fTPTask.Name = name;
            fTPTask.Description = taskDescription;
            this.Task.Operation = operation;

            this.Task.IsRemotePathVariable = isRemotePathVariable;
            this.Task.IsLocalPathVariable = isLocalPathVariable;

            Connection fTPServerConnection = new Connection(vulcanPackage, serverName, serverName, "FTP", String.Format("\"{0}:{1}\"", serverName, port));
            fTPServerConnection.SetProperty("ServerUserName", userName);
            fTPServerConnection.SetProperty("ServerPassword", password);
            this.Task.Connection = fTPServerConnection.ConnectionManager.ID;

            if (this.Task.IsRemotePathVariable == true)
            {
                this.Task.RemotePath = remotePath;
            }
            else
            {
                this.Task.RemotePath = remotePath;
            }

            if (this.Task.IsLocalPathVariable == true)
            {
                this.Task.LocalPath = localPath;
            }
            else
            {
                Connection localConnection = new Connection(vulcanPackage, localPath, localPath, "File", String.Format("\"{0}\"", ExpressionPathBuilder.EscapeBackslashes(localPath)));
                int intFileUsageType = 2;
                switch (operation)
                {
                    case Microsoft.SqlServer.Dts.Tasks.FtpTask.DTSFTPOp.Send:
                        intFileUsageType = 0;
                        break;
                    case Microsoft.SqlServer.Dts.Tasks.FtpTask.DTSFTPOp.Receive:
                        intFileUsageType = 2;
                        break;
                    default:
                        intFileUsageType = 2;
                        break;
                }
                localConnection.SetProperty("FileUsageType", intFileUsageType);

                this.Task.LocalPath = localPath;
            }
        }