Ejemplo n.º 1
0
        private void ProcessIndicators()
        {
            try
            {
                if (string.IsNullOrEmpty(this.IndicatorNIDs) == false)
                {
                    //- Get IUSNId for given Indicators.
                    string NewIUSNIds = Common.GetCommaSeperatedString(this.SourceDBConnection.ExecuteDataTable(this.SourceDBQueries.IUS.GetIUSByI_U_S(this.IndicatorNIDs, this.UnitNIDs, this.SubgroupValNIDs)), Indicator_Unit_Subgroup.IUSNId);

                    //-- Merge NewIUS with given IUS.
                    this.IUSNIDs = Common.MergeNIds(this.IUSNIDs, NewIUSNIds);
                }

                if (string.IsNullOrEmpty(this.IUSNIDs) == false)
                {
                    IUSBuilder SourceIUSBuilder = new IUSBuilder(this.SourceDBConnection, this.SourceDBQueries);
                    IUSBuilder DestinationIUSBuilder = new IUSBuilder(this.DestDBConnection, this.DestDBQueries);
                    IUSInfo SourceIUSInfo = null;

                    // import each ius
                    foreach (string SourceIUSNid in DICommon.SplitString(this.IUSNIDs, ","))
                    {
                        // 1. get source ius info
                        SourceIUSInfo = SourceIUSBuilder.GetIUSInfo(FilterFieldType.NId, SourceIUSNid, FieldSelection.Light);

                        if (SourceIUSInfo != null && SourceIUSInfo.Nid > 0)
                        {
                            // 2. import ius into destination db
                            DestinationIUSBuilder.ImportIUS(SourceIUSInfo, this.SourceDBQueries, this.SourceDBConnection);

                        }
                    }

                }
            }
            catch
            {
            }
        }