コード例 #1
0
ファイル: Program.cs プロジェクト: chenguoshun/Autossis
        /// <summary>
        /// 生成main包
        /// </summary>
        /// <param name="ParentInfo"></param>
        private static void JobControl(Project Pj, PackageControl ParentInfo)
        {
            List <PackageControl> childs;

            using (AutossisEntities db = new AutossisEntities())
            {
                if (ParentInfo == null)
                {
                    ParentInfo = db.PackageControl.Where(p => p.ProjectId == Pj.ProjectId && p.ParentId == null).First();
                }
                childs = db.PackageControl.Where(p => p.ParentId == ParentInfo.id).ToList();
            }

            if (childs.Count() > 0)
            {
                EzPackage Package = new EzPackage {
                    Name = ParentInfo.name
                };
                ez.AddPackage(Package);
                foreach (PackageControl child in childs)
                {
                    EzExecPackage exPack = new EzExecPackage(Package)
                    {
                        PackageName         = child.name + ".dtsx",
                        UseProjectReference = true,
                        Name = child.name
                    };
                    JobControl(Pj, child);
                }
            }
        }
コード例 #2
0
 public EzConnectionManager(EzPackage parent) 
 {
     if (parent == null)
         throw new ArgumentNullException("parent");
     m_parent = parent; 
     m_conn = parent.Connections.Add(GetConnMgrID());
     Name = GetType().Name + ID;
 }
コード例 #3
0
ファイル: UnionAll.cs プロジェクト: japj/sqlsrvintegrationsrv
        static void Main(string[] args)
        {
            // Creating the package and data flow task:
            EzPackage package = new EzPackage();
            EzDataFlow dataFlow = new EzDataFlow(package);

            // Creating the first source:
            EzSqlOleDbCM srcConn1 = Activator.CreateInstance(typeof(EzSqlOleDbCM), new object[] { package }) as EzSqlOleDbCM;
            EzOleDbSource source1 = Activator.CreateInstance(typeof(EzOleDbSource), new object[] { dataFlow }) as EzOleDbSource;
            source1.Connection = srcConn1;
            srcConn1.SetConnectionString("localhost", "Northwind");
            source1.Table = "Customers";

            // Creating the second source, which has the same columns as the first source:
            EzSqlOleDbCM srcConn2 = Activator.CreateInstance(typeof(EzSqlOleDbCM), new object[] { package }) as EzSqlOleDbCM;
            EzOleDbSource source2 = Activator.CreateInstance(typeof(EzOleDbSource), new object[] { dataFlow }) as EzOleDbSource;
            source2.Connection = srcConn2;
            srcConn2.SetConnectionString("localhost", "Northwind");
            source2.Table = "Customers3";

            // Creating the third source, which contains different columns to demonstrate how EzUnionAll handles this scenario:
            EzSqlOleDbCM srcConn3 = Activator.CreateInstance(typeof(EzSqlOleDbCM), new object[] { package }) as EzSqlOleDbCM;
            EzOleDbSource source3 = Activator.CreateInstance(typeof(EzOleDbSource), new object[] { dataFlow }) as EzOleDbSource;
            source3.Connection = srcConn3;
            srcConn3.SetConnectionString("localhost", "Northwind");
            source3.Table = "FuzzyOrders";

            /* Creating EzUnionAll and attaching it to the sources.
             * 
             * The input columns of the first input attached define the output columns.
             * 
             * The second input has the same output columns as the first input, so the input columns
             * of the second input are mapped to the corresponding output columns.
             * 
             * The third input shares two of the first input's columns, so these columns are automatically mapped together.
             * The rest of the third input's columns do not match any of the existing output columns, so they are not mapped.
             * No value is inserted into the unmapped output columns for rows that originate from the third input.
             */
            EzUnionAll union = new EzUnionAll(dataFlow);
            union.AttachTo(source1, 0, 0);
            union.AttachTo(source2, 0, 1);
            union.AttachTo(source3, 0, 2);

            // Creating a Flat File Destination:
            EzFlatFileCM output_conn = Activator.CreateInstance(typeof(EzFlatFileCM), new object[] { package }) as EzFlatFileCM;
            EzFlatFileDestination output = Activator.CreateInstance(typeof(EzFlatFileDestination), new object[] { dataFlow }) as EzFlatFileDestination;
            output.Connection = output_conn;
            output_conn.ConnectionString = @"C:\Union All\UnionAllSample.txt";
            output.Overwrite = true;

            // Attaching the Union All component to the destination:
            output.AttachTo(union, 0, 0);
            output.DefineColumnsInCM();

            // Executing the package:
            package.Execute();
        }
コード例 #4
0
 public EzConnectionManager(EzPackage parent)
 {
     if (parent == null)
     {
         throw new ArgumentNullException("parent");
     }
     m_parent = parent;
     m_conn   = parent.Connections.Add(GetConnMgrID());
     Name     = GetType().Name + ID;
 }
コード例 #5
0
 static void Main(string[] args)
 {
     // DEMO 1
     EzPackage p = new EzPackage();
     p.SaveToFile("testpkg.dtsx");
     EzExecPkgPackage p1 = new EzExecPkgPackage("testpkg.dtsx");
     p1.SaveToFile("demo1.dtsx");
     p1.Execute();
     Console.Write(string.Format("Package1 executed with result {0}\n", p1.ExecutionResult));
 }
コード例 #6
0
        static void Main(string[] args)
        {
            // DEMO 1
            EzPackage p = new EzPackage();

            p.SaveToFile("testpkg.dtsx");
            EzExecPkgPackage p1 = new EzExecPkgPackage("testpkg.dtsx");

            p1.SaveToFile("demo1.dtsx");
            p1.Execute();
            Console.Write(string.Format("Package1 executed with result {0}\n", p1.ExecutionResult));
        }
コード例 #7
0
        public void DemotetoPackageCM(EzPackage package)
        {
            if (m_parentProject == null)
            {
                throw new ArgumentNullException("CM not attached to a project");
            }
            if (package == null)
            {
                throw new ArgumentNullException("Project Null");
            }

            m_parentProject.ConnectionManagerItems.Remove(m_streamName);
            package.Connections.Join(this);
        }
コード例 #8
0
 public EzConnectionManager(EzPackage parent, string name) 
 {
     if (parent == null)
         throw new ArgumentNullException("parent");
     m_parent = parent; 
     if (!parent.ConnectionExists(name))
     {
         m_conn = parent.Connections.Add(GetConnMgrID());
         Name = name;
         return;
     }
     m_conn = parent.Connections[name];
     if (m_conn.CreationName != GetConnMgrID())
         throw new IncorrectAssignException(string.Format("Connection manager with name {0} of type {1} already exists and is incompatible with type {2}",
             name, m_conn.CreationName, GetConnMgrID()));
 }
コード例 #9
0
 public EzConnectionManager(EzPackage parent, string name)
 {
     if (parent == null)
     {
         throw new ArgumentNullException("parent");
     }
     m_parent = parent;
     if (!parent.ConnectionExists(name))
     {
         m_conn = parent.Connections.Add(GetConnMgrID());
         Name   = name;
         return;
     }
     m_conn = parent.Connections[name];
     if (m_conn.CreationName != GetConnMgrID())
     {
         throw new IncorrectAssignException(string.Format("Connection manager with name {0} of type {1} already exists and is incompatible with type {2}",
                                                          name, m_conn.CreationName, GetConnMgrID()));
     }
 }
コード例 #10
0
 public EzDb2OleDbCM(EzPackage parent) : base(parent) { }
コード例 #11
0
 public EzExcelCM(EzPackage parent, ConnectionManager c) : base(parent, c) { }
コード例 #12
0
 public EzExcelCM(EzPackage parent) : base(parent) { }
コード例 #13
0
 public EzOleDbConnectionManager(EzPackage parent) : base(parent) { }
コード例 #14
0
 public EzOleDbConnectionManager(EzPackage parent) : base(parent)
 {
 }
コード例 #15
0
 public EzOracleAdoNetCM(EzPackage parent) : base(parent) { }
コード例 #16
0
 public EzFlatFileCM(EzPackage parent) : base(parent) { }
コード例 #17
0
 public EzDb2OleDbCM(EzPackage parent, string name) : base(parent, name)
 {
 }
コード例 #18
0
 public EzDb2OleDbCM(EzPackage parent) : base(parent)
 {
 }
コード例 #19
0
 public EzSqlOleDbCM(EzPackage parent) : base(parent)
 {
 }
コード例 #20
0
 public EzExcelCM(EzPackage parent, ConnectionManager c) : base(parent, c)
 {
 }
コード例 #21
0
 public EzExcelCM(EzPackage parent, string name) : base(parent, name)
 {
 }
コード例 #22
0
 public EzExcelCM(EzPackage parent) : base(parent)
 {
 }
コード例 #23
0
 public EzOleDbConnectionManager(EzPackage parent, string name) : base(parent, name)
 {
 }
コード例 #24
0
 public EzOracleOleDbCM(EzPackage parent) : base(parent) { }
コード例 #25
0
 public EzOracleOleDbCM(EzPackage parent, string name) : base(parent, name) { }
コード例 #26
0
 public EzConnectionManager(EzPackage parent, ConnectionManager c)
 {
     Assign(parent, c);
 }
コード例 #27
0
 public EzFlatFileCM(EzPackage parent, string name) : base(parent, name) { }
コード例 #28
0
 public EzOracleOleDbCM(EzPackage parent) : base(parent)
 {
 }
コード例 #29
0
 public EzOracleAdoNetCM(EzPackage parent, string name) : base(parent, name) { }
コード例 #30
0
 public EzOracleOleDbCM(EzPackage parent, ConnectionManager c) : base(parent, c)
 {
 }
コード例 #31
0
        public void DemotetoPackageCM(EzPackage package)
        {
            if (m_parentProject == null)
                throw new ArgumentNullException("CM not attached to a project");
            if (package == null)
                throw new ArgumentNullException("Project Null");

            m_parentProject.ConnectionManagerItems.Remove(m_streamName);
            package.Connections.Join(this);

        }
コード例 #32
0
 public EzOracleOleDbCM(EzPackage parent, string name) : base(parent, name)
 {
 }
コード例 #33
0
 public EzOleDbConnectionManager(EzPackage parent, string name) : base(parent, name) { }
コード例 #34
0
 public EzFlatFileCM(EzPackage parent) : base(parent)
 {
 }
コード例 #35
0
 public EzExcelCM(EzPackage parent, string name) : base(parent, name) { }
コード例 #36
0
 public EzFlatFileCM(EzPackage parent, ConnectionManager c) : base(parent, c)
 {
 }
コード例 #37
0
 public EzSqlOleDbCM(EzPackage parent) : base(parent) { }
コード例 #38
0
 public EzFlatFileCM(EzPackage parent, string name) : base(parent, name)
 {
 }
コード例 #39
0
 public EzDb2OleDbCM(EzPackage parent, string name) : base(parent, name) { }
コード例 #40
0
 public EzSqlAdoNetCM(EzPackage parent) : base(parent)
 {
 }
コード例 #41
0
 public EzOracleOleDbCM(EzPackage parent, ConnectionManager c) : base(parent, c) { }
コード例 #42
0
 public EzCacheCM(EzPackage parent, string name) : base(parent, name) { m_cmcache = (RunWrap.IDTSConnectionManagerCache100)m_conn.InnerObject; }
コード例 #43
0
        static void Main(string[] args)
        {
            // Creating the package and the Data Flow Task:
            EzPackage package = new EzPackage();
            EzDataFlow dataFlow = new EzDataFlow(package);

            // Creating a connection to the database:
            EzSqlOleDbCM srcConn = Activator.CreateInstance(typeof(EzSqlOleDbCM), new object[] { package }) as EzSqlOleDbCM;
            EzOleDbSource source = Activator.CreateInstance(typeof(EzOleDbSource), new object[] { dataFlow }) as EzOleDbSource;
            source.Connection = srcConn;
            srcConn.SetConnectionString("localhost", "Northwind");
            source.Table = "FuzzyOrders";

            // Creating six Flat File Destinations to write the output from the Conditional Split:
            uint numberCases = 6;
            List<EzFlatFileDestination> destinations = new List<EzFlatFileDestination>();
            for (int i = 1; i <= numberCases; i++)
            {
                EzFlatFileCM conn = Activator.CreateInstance(typeof(EzFlatFileCM), new object[] { package }) as EzFlatFileCM;
                EzFlatFileDestination dest = Activator.CreateInstance(typeof(EzFlatFileDestination), new object[] { dataFlow }) as EzFlatFileDestination;
                dest.Connection = conn;
                conn.ConnectionString = @"C:\CondSplit\output" + i + ".txt";
                dest.Overwrite = true;

                destinations.Add(dest);
            }

            // Attaching the Conditional Split to the source, and mapping input columns to output columns:
            EzConditionalSplit split = new EzConditionalSplit(dataFlow);
            split.AttachTo(source);
            split.LinkAllInputsToOutputs();

            /*
             * Important step - this is where the new EzConditionalSplit functionality comes in.
             * 
             * The Condition property of EzConditionalSplit indexes over outputs using output names.
             * Providing an output name that does not yet exist will create a new output.
             * 
             * The Condition property is set to a string that represents the condition that is evaluated to determine which
             * output a particular row is sent to.
             * 
             * The set method of the Condition property also assigns a string to the Expression property, which contains the actual string
             * that is evaulated during runtime.  In this string, column names are replaced with column IDs.  The Expression property
             * can be set directly, but the Condition property allows the user to provide a string containing column names without
             * worrying about IDs.  In addition, the Condition set method also assigns the new expression to be the next case to be evaluated,
             * automatically setting the Order property, which must be sequential in order to guarantee execution.
             */
            for (int i = 1; i <= numberCases; i++)
            {
                split.Condition["case" + i] = "EmployeeID == " + i;
            }

            // Attaching each destination to an output of Conditional Split:
            for (int i = 1; i <= numberCases; i++)
            {
                destinations[i - 1].AttachTo(split, i + 1, 0);
                destinations[i - 1].DefineColumnsInCM();
            }

            // Creating a destination for the default output:
            EzFlatFileCM conn_default = Activator.CreateInstance(typeof(EzFlatFileCM), new object[] { package }) as EzFlatFileCM;
            EzFlatFileDestination dest_default = Activator.CreateInstance(typeof(EzFlatFileDestination), new object[] { dataFlow }) as EzFlatFileDestination;
            dest_default.Connection = conn_default;
            conn_default.ConnectionString = @"C:\CondSplit\default.txt";
            dest_default.Overwrite = true;

            // Attaching the default destination to the default output.
            dest_default.AttachTo(split, 0, 0);
            dest_default.DefineColumnsInCM();

            // Execute the package.
            package.Execute();
        }
コード例 #44
0
 public EzSMOServerCM(EzPackage parent, string name) : base(parent, name) { }
コード例 #45
0
 public EzFlatFileCM(EzPackage parent, ConnectionManager c) : base(parent, c) { }
コード例 #46
0
 public EzExecForLoop(EzPackage pkg, DtsContainer c) : base(pkg, c)
 {
 }
コード例 #47
0
 public EzSqlAdoNetCM(EzPackage parent) : base(parent) { }
コード例 #48
0
 public EzTransformDF(EzPackage pkg, TaskHost pipe) : base(pkg, pipe)
 {
 }
コード例 #49
0
 public EzOracleAdoNetCM(EzPackage parent, ConnectionManager c) : base(parent, c) { }
コード例 #50
0
 public EzSMOServerCM(EzPackage parent, ConnectionManager c) : base(parent, c)
 {
 }
コード例 #51
0
 public EzOracleAdoNetCM(EzPackage parent) : base(parent)
 {
 }
コード例 #52
0
 public virtual EzConnectionManager Assign(EzPackage parent, ConnectionManager c)
 {
     m_conn   = c;
     m_parent = parent;
     return(this);
 }
コード例 #53
0
 public EzSMOServerCM(EzPackage parent) : base(parent) { }
コード例 #54
0
 public EzOracleAdoNetCM(EzPackage parent, ConnectionManager c) : base(parent, c)
 {
 }
コード例 #55
0
 public EzSMOServerCM(EzPackage parent, ConnectionManager c) : base(parent, c) { }
コード例 #56
0
 public EzOracleAdoNetCM(EzPackage parent, string name) : base(parent, name)
 {
 }
コード例 #57
0
 public EzSrcConnDF(EzPackage pkg, TaskHost pipe) : base(pkg, pipe)
 {
 }
コード例 #58
0
 public EzConnectionManager(EzPackage parent, ConnectionManager c) { Assign(parent, c); }
コード例 #59
0
 public EzTransDestConnDF(EzPackage pkg, TaskHost pipe) : base(pkg, pipe)
 {
 }
コード例 #60
0
 public virtual EzConnectionManager Assign(EzPackage parent, ConnectionManager c)
 {
     m_conn = c;
     m_parent = parent;
     return this;
 }