Пример #1
0
        public void WriteServicePole(Prism650Context context, Type650Service service)
        {
            if (service == null)
            {
                return;
            }

            var serviceKey = service.ServiceKey ?? 0;

            if (serviceKey == 0)
            {
                return;
            }

            var poles = marketDataAccess.ListServicePoles(serviceKey);

            if (poles == null || poles.Length == 0)
            {
                return;
            }

            foreach (var pole in poles)
            {
                if (!pole.ServicePoleKey.HasValue)
                {
                    continue;
                }

                var line = string.Format("11|{0}|{1}|", context.TradingPartnerId, pole.PoleNbr);
                context.AppendLine(line);
                logger.TraceFormat("Wrote 650 \"11\" PRISM line for Header {0}", service.HeaderKey);
            }
        }
Пример #2
0
        public void WriteService(XContainer container, Type650Service[] services)
        {
            var loopElement = new XElement("ServiceLoop");

            container.Add(loopElement);

            if (services == null || services.Length == 0)
            {
                return;
            }

            foreach (var service in services)
            {
                if (!service.ServiceKey.HasValue)
                {
                    continue;
                }

                var serviceKey = service.ServiceKey.Value;
                var element    = new XElement("Service",
                                              new XElement("ServiceKey", serviceKey),
                                              new XElement("HeaderKey", service.HeaderKey));

                element.TryAddElement("PurposeCode", service.PurposeCode);
                element.TryAddElement("PriorityCode", service.PriorityCode);
                element.TryAddElement("ESIID", service.EsiId);
                element.TryAddElement("SpecialProcessCode", service.SpecialProcessCode);
                element.TryAddElement("ServiceReqDate", service.ServiceReqDate);
                element.TryAddElement("NotBeforeDate", service.NotBeforeDate);
                element.TryAddElement("CallAhead", service.CallAhead);
                element.TryAddElement("PremLocation", service.PremLocation);
                element.TryAddElement("AccStatusCode", service.AccStatusCode);
                element.TryAddElement("AccStatusDesc", service.AccStatusDesc);
                element.TryAddElement("EquipLocation", service.EquipLocation);
                element.TryAddElement("ServiceOrderNbr", service.ServiceOrderNbr);
                element.TryAddElement("CompletionDate", service.CompletionDate);
                element.TryAddElement("CompletionTime", service.CompletionTime);
                element.TryAddElement("ReportRemarks", service.ReportRemarks);
                element.TryAddElement("Directions", service.Directions);
                element.TryAddElement("MeterNbr", service.MeterNbr);
                element.TryAddElement("MeterReadDate", service.MeterReadDate);
                element.TryAddElement("MeterTestDate", service.MeterTestDate);
                element.TryAddElement("MeterTestResults", service.MeterTestResults);
                element.TryAddElement("IncidentCode", service.IncidentCode);
                element.TryAddElement("EstRestoreDate", service.EstRestoreDate);
                element.TryAddElement("EstRestoreTime", service.EstRestoreTime);
                element.TryAddElement("IntStartDate", service.IntStartDate);
                element.TryAddElement("IntStartTime", service.IntStartTime);
                element.TryAddElement("RepairRecommended", service.RepairRecommended);
                element.TryAddElement("Rescheduled", service.Rescheduled);
                element.TryAddElement("InterDuractionPeriod", service.InterDurationPeriod);
                element.TryAddElement("AreaOutage", service.AreaOutage);
                element.TryAddElement("CustRepairRemarks", service.CustRepairRemarks);
                element.TryAddElement("MeterReadUOM", service.MeterReadUom);
                element.TryAddElement("MeterRead", service.MeterRead);
                element.TryAddElement("Membership", service.Membership);
                element.TryAddElement("RemarksPermanentSuspend", service.RemarksPermanentSuspend);
                element.TryAddElement("DisconnectAuthorization", service.DisconnectAuthorization);
                loopElement.Add(element);
                logger.TraceFormat("Added 650 \"Service\" XML element for Header {0}", service.HeaderKey);

                var changes = exportDataAccess.ListServiceChanges(serviceKey);
                WriteServiceChange(element, changes);

                var meters = exportDataAccess.ListServiceMeters(serviceKey);
                WriteServiceMeter(element, meters);

                var poles = exportDataAccess.ListServicePoles(serviceKey);
                WriteServicePole(element, poles);

                var rejects = exportDataAccess.ListServiceRejects(serviceKey);
                WriteServiceReject(element, rejects);
            }
        }