Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API Micros Simphony 2 C# Mag reader

Status
Not open for further replies.

Fillthevoid

Systems Engineer
Feb 10, 2020
2
GB
Good afternoon,

I am trying to develop an API for Micros Simphony which would catch error of unexpected input in the mag card reader. As some of you might have noticed the database can't handle leading 0 employee code (or swipe card). My skills in C# are very limited alas so I would appreciate if someone could review what I wrote and tell me if it will do the job! Would be very much appreciated as well as good practice maybe if my code look a bit messy.
Code:
using System;
using Windows;
class MagReader 
{
   //Create a method catching data On swipe of a card in the mag reader
  public string ClaimedMagneticStripeReaderEvents(ClaimedMagneticStripeReader This)
 {
     this.This = This;
     string txt = This.TextBox();
 }
   
  static void Main() 
  {
      
      string [] array = new array.ClaimedMagneticStripeReaderEvents();//Not sure if it should be array.ClaimedMagneticStripeReaderEvents(txt)
      if(txt[0] = '0') //if first character of txt is a 0
      {
        txt.Remove(0,1); //remove the 0 and return value
        return txt;
      }
      else
      {
          return txt; //if no leading 0 return value
      }
  }
  
  
}

Let me know your thoughts!

Best,

Benoit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top