private Dictionary <int, List <int> > GetPackageContentsDictionary()
        {
            Dictionary <int, List <int> > toReturn = new Dictionary <int, List <int> >();

            using (var con = _repository.GetConnection())
            {
                var r = _repository.DiscoveredServer.GetCommand("SELECT * FROM ExtractableDataSetPackage_ExtractableDataSet ORDER BY ExtractableDataSetPackage_ID", con).ExecuteReader();

                var lastPackageId = -1;
                while (r.Read())
                {
                    var packageID = Convert.ToInt32(r["ExtractableDataSetPackage_ID"]);
                    var dataSetID = Convert.ToInt32(r["ExtractableDataSet_ID"]);

                    if (lastPackageId != packageID)
                    {
                        toReturn.Add(packageID, new List <int>());
                        lastPackageId = packageID;
                    }

                    toReturn[packageID].Add(dataSetID);
                }

                return(toReturn);
            }
        }
Ejemplo n.º 2
0
        public void IntroduceOrphan()
        {
            var cols = _configuration.GetAllExtractableColumnsFor(_extractableDataSet).Cast <ExtractableColumn>().ToArray();

            var name = cols.Single(c => c.GetRuntimeName().Equals("Name"));

            using (var con = DataExportRepository.GetConnection())
            {
                DataExportRepository.DiscoveredServer.GetCommand(
                    "UPDATE ExtractableColumn set CatalogueExtractionInformation_ID = " + int.MaxValue + " where ID = " +
                    name.ID, con).ExecuteNonQuery();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Fetches all containers and filters out of the <paramref name="repository"/> and sets the class up to provide
        /// fast access to them.
        /// </summary>
        /// <param name="repository"></param>
        /// <param name="childProvider"></param>
        public DataExportFilterManagerFromChildProvider(DataExportRepository repository, DataExportChildProvider childProvider) : base(repository)
        {
            _containersToFilters = childProvider.AllDeployedExtractionFilters.Where(f => f.FilterContainer_ID.HasValue).GroupBy(f => f.FilterContainer_ID.Value).ToDictionary(gdc => gdc.Key, gdc => gdc.ToList());

            var server = repository.DiscoveredServer;

            using (var con = repository.GetConnection())
            {
                var r = server.GetCommand("SELECT *  FROM FilterContainerSubcontainers", con).ExecuteReader();
                while (r.Read())
                {
                    var parentId       = Convert.ToInt32(r["FilterContainer_ParentID"]);
                    var subcontainerId = Convert.ToInt32(r["FilterContainerChildID"]);

                    if (!_subcontainers.ContainsKey(parentId))
                    {
                        _subcontainers.Add(parentId, new List <FilterContainer>());
                    }

                    _subcontainers[parentId].Add(childProvider.AllContainers[subcontainerId]);
                }
                r.Close();
            }
        }