Ejemplo n.º 1
0
 private void ParseSwipedCard(string data)
 {
     Clear();
     try {
         parser = new MagstripCardParser(data);
     }
     catch (MagstripCardParseException) {
         MessageBox.Show(this, "Could not read card, please try again.", "Card Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     if (parser != null)
     {
         textCardNumber.Text = parser.AccountNumber;
         textExpDate.Text    = parser.ExpirationMonth.ToString().PadLeft(2, '0') + (parser.ExpirationYear % 100).ToString().PadLeft(2, '0');
         textNameOnCard.Text = parser.FirstName + " " + parser.LastName;
         GetNextControl(textNameOnCard, true).Focus();               //Move forward to the next control in the tab order.
     }
 }
Ejemplo n.º 2
0
 private void ParseSwipedCard(string data)
 {
     Clear();
     try {
         parser=new MagstripCardParser(data);
     }
     catch(MagstripCardParseException) {
         MessageBox.Show(this,"Could not read card, please try again.","Card Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
     }
     if(parser!=null) {
         textCardNumber.Text=parser.AccountNumber;
         textExpDate.Text=parser.ExpirationMonth.ToString().PadLeft(2,'0')+(parser.ExpirationYear%100).ToString().PadLeft(2,'0');
         textNameOnCard.Text=parser.FirstName+" "+parser.LastName;
         GetNextControl(textNameOnCard,true).Focus();//Move forward to the next control in the tab order.
     }
 }