コード例 #1
0
        public void ParseLine(Prism814Context context, string line)
        {
            if (string.IsNullOrWhiteSpace(line))
            {
                return;
            }

            if (line.Length < 2)
            {
                return;
            }

            var indicator    = line.Substring(0, 2);
            var marketFields = line.Split('|');

            switch (indicator)
            {
            case "SH":
                context.ResolveToHeader();
                context.Initialize();
                context.TransactionActualCount++;
                marketFields.TryAtIndex(3, x => context.Alias = x);
                break;

            case "01":
                ParseHeader(context, marketFields);
                break;

            case "05":
                ParseName(context, marketFields);
                break;

            case "10":
                context.RevertToHeader();
                ParseService(context, marketFields);
                break;

            case "11":
                ParseServiceDate(context, marketFields);
                break;

            case "12":
                ParseServiceRate(context, marketFields);
                break;

            case "15":
                ParseServiceReject(context, marketFields);
                break;

            case "16":
                ParseServiceStatus(context, marketFields);
                break;

            case "30":
                context.RevertToService();
                context.InitializeMeter();
                ParseServiceMeter(context, marketFields);
                break;

            case "35":
                ParseServiceMeterType(context, marketFields);
                break;

            case "38":
                ParseServiceMeterChange(context, marketFields);
                break;

            case "40":
                context.RevertToService();
                ParseServiceStatus(context, marketFields);
                break;

            case "TL":
                context.ResolveToHeader();
                marketFields.TryAtIndexInt(1, x => context.TransactionAuditCount = x);
                break;
            }
        }