Esempio n. 1
0
 /**************************************************
  *
  *      Public Methods
  *
  **************************************************/
 public bool AuthorizeSip(string barcode)
 {
     try
     {
         if (CurrentApplicationData.SipEnabled)
         {
             SipConnection sip = new SipConnection(CurrentApplicationData.SipIP, CurrentApplicationData.SipPort, CurrentApplicationData.SipUsername, CurrentApplicationData.SipPassword, CurrentApplicationData.SipExtraNumber);
             sip.Open();
             bool authorized = sip.AuthorizeBarcode(barcode);
             sip.Dispose();
             LogStatistics();
             return authorized;
         }
         else return false;
     }
     catch (Exception ex)
     {
         ErrorLog.LogError(DateTime.Now.ToString() + " : Could not connect to SIP server!", ex.Message);
         return false;
     }
 }
Esempio n. 2
0
 /****************************************************************
  *      Barcode Scanner Functions                               *
  ****************************************************************/
 public static bool authorizeBarcode(string barcode)
 {
     SipConnection sip = new SipConnection("", "", "", "");
     sip.Open();
     return sip.AuthorizeBarcode(barcode);
 }
Esempio n. 3
0
 public static Patron getPatronInfo(string barcode)
 {
     Patron patron = new Patron();
     try
     {
         string failureResponse = String.Empty;
         SipConnection sip = new SipConnection("");
         sip.Open();
         sip.AuthorizeBarcode(barcode, ref patron, ref failureResponse);
     }
     catch (Exception)
     {
         return new Patron { Pin = "-1", Name = "Could not access patron information at this time." };
     }
     return patron;
 }