Ejemplo n.º 1
0
        internal string Execute(DateTime changeDate, string targetXmlPath, ISerializationHelper serializationHelper,
                                ICompressionHelper compressionHelper, HEREBaseService hereBaseService)
        {
            hereBaseService.AppendAuditLogEvent("Getting data.");

            CAFO ds = _dbService.GetCAFOAddData(changeDate);

            hereBaseService.AppendAuditLogEvent("Data retrieved. (Record Count = {0}).", ds.CAFO_FAC.Rows.Count);

            hereBaseService.AppendAuditLogEvent("Transforming results.");

            CAFOFacilityList facs = CAFOTransform.Transform(ds);

            if (facs == null || facs.CAFOFacilities == null || facs.CAFOFacilities.Count == 0)
            {
                return(null);
            }
            else
            {
                hereBaseService.AppendAuditLogEvent("Results transformed: (Record Count: {0})", facs.CAFOFacilities.Count);

                hereBaseService.AppendAuditLogEvent(
                    "Serializing transformed results to file (File = {0}).",
                    targetXmlPath);

                serializationHelper.Serialize(facs, targetXmlPath);

                return(compressionHelper.CompressFile(targetXmlPath));
            }
        }
Ejemplo n.º 2
0
        internal string Execute(DateTime changeDate, string targetXmlPath, ISerializationHelper serializationHelper,
                                ICompressionHelper compressionHelper, HEREBaseService hereBaseService)
        {
            hereBaseService.AppendAuditLogEvent("Getting data.");

            HERE10.DomainDataSet ds = _dbService.GetDomainData(changeDate);

            hereBaseService.AppendAuditLogEvent("Data retrieved. (List Count = {0}).", ds.List.Rows.Count);

            hereBaseService.AppendAuditLogEvent("Transforming results.");

            List <HERE10.DomainList> lists = new List <HERE10.DomainList>();

            foreach (HERE10.DomainDataSet.ListRow listRow in ds.List.Rows)
            {
                HERE10.DomainList item = new HERE10.DomainList();

                item.DomainListNameText     = listRow.ListName;
                item.OriginatingPartnerName = listRow.ListOwnerName;

                List <DomainValueItemDataType> listItems = new List <DomainValueItemDataType>();

                foreach (HERE10.DomainDataSet.ListItemRow listItemRow in listRow.GetListItemRows())
                {
                    DomainValueItemDataType listItem = new DomainValueItemDataType();

                    listItem.ItemCode            = listItemRow.ItemCode;
                    listItem.ItemText            = listItemRow.ItemValue;
                    listItem.ItemDescriptionText = listItemRow.ItemDesc;

                    listItems.Add(listItem);
                }

                item.DomainListItem = listItems.ToArray();

                lists.Add(item);
            }

            if (lists.Count == 0)
            {
                return(null);
            }
            else
            {
                HERE10.DomainValueListDataType domain = new HERE10.DomainValueListDataType();
                domain.DomainList = lists.ToArray();

                hereBaseService.AppendAuditLogEvent("Results transformed.");

                hereBaseService.AppendAuditLogEvent(
                    "Serializing transformed results to file (File = {0}).",
                    targetXmlPath);

                serializationHelper.Serialize(domain, targetXmlPath);

                return(compressionHelper.CompressFile(targetXmlPath));
            }
        }
        internal byte[] Execute(ICollection <string> allFlowList, ICollection <string> protectedFlowList,
                                ICollection <string> userProtectedFlowList, DateTime changeDate,
                                ISerializationHelper serializationHelper, HEREBaseService hereBaseService)
        {
            hereBaseService.AppendAuditLogEvent("Getting data.");

            HERE10.ManifestDataSet ds = _dbService.GetManifestData(changeDate);

            hereBaseService.AppendAuditLogEvent("Data retrieved. (Record Count = {0}).", ds.Manifest.Rows.Count);

            hereBaseService.AppendAuditLogEvent("Transforming results.");

            List <HERE10.HEREManifestItemDataType> manifestItems = new List <HERE10.HEREManifestItemDataType>();

            foreach (HERE10.ManifestDataSet.ManifestRow manifestRow in ds.Manifest.Rows)
            {
                string flowCode = manifestRow.DataExchangeName;

                if (ContainsFlowName(allFlowList, flowCode))
                {
                    if (ContainsFlowName(protectedFlowList, flowCode))
                    {
                        if (!ContainsFlowName(userProtectedFlowList, flowCode))
                        {
                            // User does not have access to this flow
                            continue;
                        }
                    }

                    HERE10.HEREManifestItemDataType item = new HERE10.HEREManifestItemDataType();

                    item.TransactionIdentifier = manifestRow.TransactionId;
                    item.CreatedDate           = manifestRow.CreatedDate;
                    item.DataExchangeNameText  = manifestRow.DataExchangeName;
                    item.EndpointURLIdentifier = manifestRow.EndpointURL;
                    item.FullReplaceIndicator  = manifestRow.FullReplaceIndicator;
                    item.SourceInfo            = new HERE10.SourceInfoDataType();
                    item.SourceInfo.IsFacilitySourceIndicator = manifestRow.IsFacilitySourceIndicator;
                    item.SourceInfo.SourceSystemName          = manifestRow.SourceSystemName;
                    manifestItems.Add(item);
                }
            }

            HERE10.HEREManifestDataType manifest = new HERE10.HEREManifestDataType();
            manifest.HEREManifestDetails = manifestItems.ToArray();

            hereBaseService.AppendAuditLogEvent("Results transformed.");

            return(serializationHelper.Serialize(manifest));
        }
Ejemplo n.º 4
0
        internal string Execute(DateTime changeDate, string targetXmlPath, ISerializationHelper serializationHelper,
                                ICompressionHelper compressionHelper, HEREBaseService hereBaseService)
        {
            hereBaseService.AppendAuditLogEvent("Getting data.");

            Tier2DataSet ds = _dbService.GetTier2DataSet(changeDate);

            hereBaseService.AppendAuditLogEvent("Data retrieved. (Record Count = {0}).",
                                                ds.T2_SUBMISSION.Rows.Count);

            hereBaseService.AppendAuditLogEvent("Transforming results.");

            TierIIDataType facs = Tier2Transform.Transform(ds);

            if (facs == null || facs.Submission == null || facs.Submission.Length == 0)
            {
                return(null);
            }
            else
            {
                hereBaseService.AppendAuditLogEvent("Results transformed. (Record Count = {0}).",
                                                    facs.Submission.Length);

                hereBaseService.AppendAuditLogEvent("Serializing transformed results to file (File = {0}).",
                                                    targetXmlPath);

                serializationHelper.Serialize(facs, targetXmlPath);

                hereBaseService.AppendAuditLogEvent("Transformed results Serialized.");

                if (compressionHelper != null)
                {
                    return(compressionHelper.CompressFile(targetXmlPath));
                }
                else
                {
                    return(targetXmlPath);
                }
            }
        }