public Response CheckInsertedTokenStatus(string token) { Response response = new Response(); try { if (SmartCardPL.CheckInsertedTokenStatus(token)) { response.ErrMessage = string.Empty; response.Successful = true; } else { response.ErrMessage = "No inserted token found"; response.Successful = false; } return response; } catch (Exception ex) { response.ErrMessage = ex.Message; response.Successful = false; ErrorHandler.WriteError(ex); return response; } }
public Response InsertEncryptedToken(CHECK_WEBTOKEN webToken) { Response response = new Response(); try { if (SmartCardPL.InsertEncrptedToken(webToken)) { response.ErrMessage = string.Empty; response.Successful = true; } else { response.ErrMessage = "InsertEncryptedToken operation was not successful."; response.Successful = false; } return response; } catch (Exception ex) { response.ErrMessage = ex.Message; response.Successful = false; ErrorHandler.WriteError(ex); return response; } }
public Response SendLatestPrinterFeeds(string printerUID, string printerSerialNumber, int ribbonCount, int noOfCardsPrinted, bool printerOnline, string printerType) { Response response = new Response(); try { if (string.IsNullOrEmpty(printerSerialNumber)) { response.ErrMessage = "Operation failed: Printer Serial Number Cannot be Empty or Null"; response.Successful = false; } else { PrinterFeed printerFeed = new PrinterFeed(); printerFeed.PrinterUID = printerUID; printerFeed.PrinterSerialNumber = printerSerialNumber; printerFeed.RibbonCount = ribbonCount; printerFeed.CardPrinted = noOfCardsPrinted; printerFeed.Status = printerOnline; printerFeed.PrinterType = printerType; printerFeed.DateofReport = System.DateTime.Now; if (PrinterFeedsPL.Save(printerFeed)) { response.ErrMessage = string.Empty; response.Successful = true; } else { response.ErrMessage = "Operation failed: " + printerSerialNumber; response.Successful = false; } } return response; } catch (Exception ex) { response.ErrMessage = ex.Message; response.Successful = false; ErrorHandler.WriteError(ex); return response; } }
public Response InsertSmartCardID(string smartCardID) { Response response = new Response(); try { string errMsg = string.Empty; if (SmartCardPL.InsertSmartCardID(smartCardID, out errMsg)) { response.ErrMessage = string.Empty; response.Successful = true; } else { response.ErrMessage = errMsg; response.Successful = false; } return response; } catch (Exception ex) { response.ErrMessage = ex.Message; response.Successful = false; ErrorHandler.WriteError(ex); return response; } }