예제 #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());
     }
 }