Example #1
0
        public void ParseDetail(Prism810Context context, string[] marketFields)
        {
            var current = context.Current;

            if (current == null || current.ModelType != Type810Types.Header)
            {
                throw new InvalidOperationException();
            }

            var header = current as Type810Header;

            if (header == null)
            {
                throw new InvalidOperationException();
            }

            var model = new Type810Detail
            {
                AssignedId             = marketFields.AtIndex(2),
                ServiceTypeCode        = "SV",
                ServiceType            = marketFields.AtIndex(3),
                ServiceClassCode       = "C3",
                ServiceClass           = marketFields.AtIndex(4),
                RateClass              = marketFields.AtIndex(11),
                RateSubClass           = marketFields.AtIndex(13),
                ServicePeriodStartDate = marketFields.AtIndex(6),
                ServicePeriodEndDate   = marketFields.AtIndex(7),
            };

            header.AddDetail(model);
            context.PushModel(model);
        }
Example #2
0
        public void ParseDetailItem(Prism810Context context, string[] marketFields)
        {
            var current = context.Current;

            if (current == null || current.ModelType != Type810Types.Detail)
            {
                throw new InvalidOperationException();
            }

            var detail = current as Type810Detail;

            if (detail == null)
            {
                throw new InvalidOperationException();
            }

            var model = new Type810DetailItem
            {
                AssignedId = marketFields.AtIndex(2),
                ServiceOrderCompleteDate  = marketFields.AtIndex(13),
                UnmeteredServiceDateRange = marketFields.AtIndex(16),
                InvoiceNbr      = marketFields.AtIndex(15),
                ServiceOrderNbr = marketFields.AtIndex(14),
                Consumption     = marketFields.AtIndex(17),
                EffectiveDate   = marketFields.AtIndex(18),
            };

            detail.AddItem(model);
            context.PushModel(model);
        }
Example #3
0
        public void ParseHeader(Prism810Context context, string[] marketFields)
        {
            var model = new Type810Header
            {
                TransactionSetId          = "810",
                TransactionSetPurposeCode = marketFields.AtIndex(7),
                InvoiceNbr          = marketFields.AtIndex(4),
                TransactionDate     = marketFields.AtIndex(3),
                ReleaseNbr          = marketFields.AtIndex(5),
                TransactionTypeCode = marketFields.AtIndex(6),
                OriginalInvoiceNbr  = marketFields.AtIndex(12),
                EsiId          = marketFields.AtIndex(53),
                PaymentDueDate = marketFields.AtIndex(25),
                TdspDuns       = marketFields.AtIndex(20),
                TdspName       = marketFields.AtIndex(19),
                CrDuns         = marketFields.AtIndex(22),
                CrName         = marketFields.AtIndex(21),
                Direction      = true,
            };

            var identifiedMarket = clientDataAccess.IdentifyMarket(model.TdspDuns);

            if (identifiedMarket.HasValue)
            {
                context.SetMarket(identifiedMarket.Value);
            }

            model.MarketId   = context.MarketId;
            model.ProviderId = 1;

            context.PushModel(model);
        }