示例#1
0
        private void ParseData()
        {
            if (this.cbkANSI.Checked)
            {
                return;
            }
            Iso8583Data iso8583Data = (Iso8583Data)null;

            try
            {
                if (this.cbkSmartlinkTemplate.Checked)
                {
                    iso8583Data             = new Iso8583Data(BitTemplate.GetSmartlinkTemplate());
                    iso8583Data.HasHeader   = false;
                    iso8583Data.LengthInAsc = true;
                }
                else
                {
                    iso8583Data = new Iso8583Data(this.SpecificTemplate);
                }
                iso8583Data.EMVShowOptions = E_EMVShowOption.Len | E_EMVShowOption.VALUE | E_EMVShowOption.NAME | E_EMVShowOption.DESCRIPTION | E_EMVShowOption.BITS;
                iso8583Data.Unpack(this.DataConverted(this.txtRawMessage, this.cbkANSI.Checked));
                this.txtParsedText.Text = iso8583Data.LogFormat();
            }
            catch (Exception ex)
            {
                this.txtParsedText.Text = ex.ToString() + "\r\n" + iso8583Data.LogFormat(iso8583Data.LastBitError);
            }
        }
示例#2
0
 private void PackData()
 {
     if (this.cbkSmarlinkTemplate.Checked)
     {
         this.iso8583             = new Iso8583Data(BitTemplate.GetSmartlinkTemplate());
         this.iso8583.HasHeader   = false;
         this.iso8583.LengthInAsc = true;
     }
     else
     {
         this.iso8583 = new Iso8583Data(this.template);
         this.iso8583.TPDUHeader.UnPack(IsoUltil.StringToBCD(this.txtTPDU.Text, 10));
     }
     this.iso8583.MessageType = int.Parse(this.txtMTI.Text);
     foreach (DataGridViewRow row in (IEnumerable)this.grvIso8583.Rows)
     {
         if (row.IsNewRow)
         {
             break;
         }
         this.iso8583.PackBit(int.Parse(row.Cells[0].Value.ToString()), row.Cells[1].Value.ToString());
     }
 }
示例#3
0
 public Iso8583Data(BitTemplate.Bit_Specific[] template)
 {
     this.m_TPDU          = new TPDU();
     this.m_BitAttributes = BitTemplate.GetBitAttributeArray(template);
 }
示例#4
0
 public Iso8583Data()
 {
     this.m_TPDU          = new TPDU();
     this.m_BitAttributes = BitTemplate.GetGeneralTemplate();
 }
示例#5
0
        //public static BitAttribute[] GetBitAttributeArray(string filename)
        //{
        //  //return BitTemplate.GetBitAttributeArray(BitTemplate.GetBINARYpecificArray(filename));
        //}

        public static BitAttribute[] GetGeneralTemplate()
        {
            return(BitTemplate.GetBitAttributeArray(new BitTemplate.Bit_Specific[67]
            {
                new BitTemplate.Bit_Specific((byte)1, BitLength.FIXED, BitType.BINARY, 8),
                new BitTemplate.Bit_Specific((byte)2, BitLength.LLVAR, BitType.BCD, 20),
                new BitTemplate.Bit_Specific((byte)3, BitLength.FIXED, BitType.BCD, 6),
                new BitTemplate.Bit_Specific((byte)4, BitLength.FIXED, BitType.BCD, 12),
                new BitTemplate.Bit_Specific((byte)5, BitLength.FIXED, BitType.BCD, 12),
                new BitTemplate.Bit_Specific((byte)6, BitLength.FIXED, BitType.BCD, 12),
                new BitTemplate.Bit_Specific((byte)7, BitLength.FIXED, BitType.BCD, 10),
                new BitTemplate.Bit_Specific((byte)8, BitLength.FIXED, BitType.BCD, 8),
                new BitTemplate.Bit_Specific((byte)9, BitLength.FIXED, BitType.BCD, 8),
                new BitTemplate.Bit_Specific((byte)10, BitLength.FIXED, BitType.BCD, 8),
                new BitTemplate.Bit_Specific((byte)11, BitLength.FIXED, BitType.BCD, 6),
                new BitTemplate.Bit_Specific((byte)12, BitLength.FIXED, BitType.BCD, 6),
                new BitTemplate.Bit_Specific((byte)13, BitLength.FIXED, BitType.BCD, 4),
                new BitTemplate.Bit_Specific((byte)14, BitLength.FIXED, BitType.BCD, 4),
                new BitTemplate.Bit_Specific((byte)15, BitLength.FIXED, BitType.BCD, 4),
                new BitTemplate.Bit_Specific((byte)16, BitLength.FIXED, BitType.BCD, 4),
                new BitTemplate.Bit_Specific((byte)17, BitLength.FIXED, BitType.BCD, 4),
                new BitTemplate.Bit_Specific((byte)18, BitLength.FIXED, BitType.BCD, 4),
                new BitTemplate.Bit_Specific((byte)19, BitLength.FIXED, BitType.BCD, 3),
                new BitTemplate.Bit_Specific((byte)20, BitLength.FIXED, BitType.BCD, 3),
                new BitTemplate.Bit_Specific((byte)21, BitLength.FIXED, BitType.BCD, 3),
                new BitTemplate.Bit_Specific((byte)22, BitLength.FIXED, BitType.BCD, 3),
                new BitTemplate.Bit_Specific((byte)23, BitLength.FIXED, BitType.BCD, 3),
                new BitTemplate.Bit_Specific((byte)24, BitLength.FIXED, BitType.BCD, 3),
                new BitTemplate.Bit_Specific((byte)25, BitLength.FIXED, BitType.BCD, 2),
                new BitTemplate.Bit_Specific((byte)26, BitLength.FIXED, BitType.BCD, 2),
                new BitTemplate.Bit_Specific((byte)27, BitLength.FIXED, BitType.BCD, 1),
                new BitTemplate.Bit_Specific((byte)28, BitLength.FIXED, BitType.BCD, 8),
                new BitTemplate.Bit_Specific((byte)29, BitLength.FIXED, BitType.BCD, 8),
                new BitTemplate.Bit_Specific((byte)30, BitLength.FIXED, BitType.BCD, 8),
                new BitTemplate.Bit_Specific((byte)31, BitLength.FIXED, BitType.BCD, 8),
                new BitTemplate.Bit_Specific((byte)32, BitLength.LLVAR, BitType.BCD, 11),
                new BitTemplate.Bit_Specific((byte)33, BitLength.LLVAR, BitType.BCD, 11),
                new BitTemplate.Bit_Specific((byte)34, BitLength.LLVAR, BitType.BCD, 28),
                new BitTemplate.Bit_Specific((byte)35, BitLength.LLVAR, BitType.BCD, 37),
                new BitTemplate.Bit_Specific((byte)36, BitLength.LLLVAR, BitType.BCD, 104),
                new BitTemplate.Bit_Specific((byte)37, BitLength.FIXED, BitType.AN, 12),
                new BitTemplate.Bit_Specific((byte)38, BitLength.FIXED, BitType.AN, 6),
                new BitTemplate.Bit_Specific((byte)39, BitLength.FIXED, BitType.AN, 2),
                new BitTemplate.Bit_Specific((byte)40, BitLength.LLLVAR, BitType.BINARY, 0),
                new BitTemplate.Bit_Specific((byte)41, BitLength.FIXED, BitType.AN, 8),
                new BitTemplate.Bit_Specific((byte)42, BitLength.FIXED, BitType.AN, 15),
                new BitTemplate.Bit_Specific((byte)43, BitLength.FIXED, BitType.AN, 40),
                new BitTemplate.Bit_Specific((byte)44, BitLength.LLVAR, BitType.AN, 0),
                new BitTemplate.Bit_Specific((byte)45, BitLength.LLVAR, BitType.AN, 76),
                new BitTemplate.Bit_Specific((byte)46, BitLength.LLLVAR, BitType.AN, (int)byte.MaxValue),
                new BitTemplate.Bit_Specific((byte)47, BitLength.LLLVAR, BitType.AN, 0),
                new BitTemplate.Bit_Specific((byte)48, BitLength.LLLVAR, BitType.AN, 0),
                new BitTemplate.Bit_Specific((byte)49, BitLength.FIXED, BitType.ANS, 3),
                new BitTemplate.Bit_Specific((byte)52, BitLength.FIXED, BitType.BINARY, 8),
                new BitTemplate.Bit_Specific((byte)53, BitLength.FIXED, BitType.BCD, 16),
                new BitTemplate.Bit_Specific((byte)54, BitLength.LLLVAR, BitType.AN, 0),
                new BitTemplate.Bit_Specific((byte)55, BitLength.LLLVAR, BitType.ANS, (int)byte.MaxValue),
                new BitTemplate.Bit_Specific((byte)56, BitLength.LLLVAR, BitType.ANS, (int)byte.MaxValue),
                new BitTemplate.Bit_Specific((byte)57, BitLength.LLLVAR, BitType.ANS, 0),
                new BitTemplate.Bit_Specific((byte)60, BitLength.LLLVAR, BitType.ANS, 0),
                new BitTemplate.Bit_Specific((byte)61, BitLength.LLLVAR, BitType.ANS, 0),
                new BitTemplate.Bit_Specific((byte)62, BitLength.LLLVAR, BitType.ANS, 0),
                new BitTemplate.Bit_Specific((byte)63, BitLength.LLLVAR, BitType.ANS, 0),
                new BitTemplate.Bit_Specific((byte)64, BitLength.FIXED, BitType.BINARY, 8),
                new BitTemplate.Bit_Specific((byte)70, BitLength.FIXED, BitType.BCD, 3),
                new BitTemplate.Bit_Specific((byte)90, BitLength.FIXED, BitType.BCD, 42),
                new BitTemplate.Bit_Specific((byte)102, BitLength.LLVAR, BitType.ANS, 28),
                new BitTemplate.Bit_Specific((byte)103, BitLength.LLVAR, BitType.ANS, 28),
                new BitTemplate.Bit_Specific((byte)105, BitLength.LLLVAR, BitType.ANS, 999),
                new BitTemplate.Bit_Specific((byte)120, BitLength.LLLVAR, BitType.ANS, 999),
                new BitTemplate.Bit_Specific((byte)128, BitLength.FIXED, BitType.BINARY, 8)
            }));
        }
示例#6
0
 private void FormUnpackIso8583_Load(object sender, EventArgs e)
 {
     this.cboLengthType.SelectedIndex = 0;
     this.SpecificTemplate            = BitTemplate.GetTemplate_Standard();
 }