public static bool CheckScConnection() { bool retVal = false; string ip = Properties.Settings.Default.ip; var remoteAddress = new System.ServiceModel.EndpointAddress(ip); KioskFramework.NStationService.ServiceSoapClient service = new KioskFramework.NStationService.ServiceSoapClient(new System.ServiceModel.BasicHttpBinding(), remoteAddress); try { var requestHeader = new KioskFramework.NStationService.WSRequestHeader { Username = "******", Password = "******" }; DataSet ds = service.ExecuteNonQuery(requestHeader, "SELECT GETDATE()"); log.Debug(ds.Tables.ToString()); if (ds.Tables != null) { return(retVal = true); } else { return(retVal); } } catch (Exception ex) { log.Error(ex.ToString()); return(retVal); } }
public static bool InsNStationAlarm(int stationId, int deviceId, int alarmType, string message) { bool retVal = false; try { string ip = Properties.Settings.Default.ip; var remoteAddress = new System.ServiceModel.EndpointAddress(ip); KioskFramework.NStationService.ServiceSoapClient service = new KioskFramework.NStationService.ServiceSoapClient(new System.ServiceModel.BasicHttpBinding(), remoteAddress); KioskFramework.NStationService.TvmAlarm model = new KioskFramework.NStationService.TvmAlarm(); var requestHeader = new KioskFramework.NStationService.WSRequestHeader { Username = "******", Password = "******" }; model.alarmMessage = message; model.alarmTypeId = alarmType; model.deviceNo = deviceId; model.stationId = stationId; retVal = service.InsTvmAlarm(requestHeader, model); } catch (Exception ex) { log.Error(ex.ToString()); return(retVal); } return(retVal); }
public static string InsertLog() { var resp = ""; try { string ip = Properties.Settings.Default.ip; var remoteAddress = new System.ServiceModel.EndpointAddress(ip); KioskFramework.NStationService.ServiceSoapClient service = new KioskFramework.NStationService.ServiceSoapClient(new System.ServiceModel.BasicHttpBinding(), remoteAddress); var requestHeader = new KioskFramework.NStationService.WSRequestHeader { Username = "******", Password = "******" }; string val = TVMInfoXml(); if (val != null && val != "") { resp = service.InsertMonitoring(requestHeader, val); return(resp); } } catch (Exception ex) { log.Error(ex.ToString()); return(resp); } return(resp); }
public static string insTVMMonitoring() { string retVal = ""; try { string ip = Properties.Settings.Default.ip; var remoteAddress = new System.ServiceModel.EndpointAddress(ip); KioskFramework.NStationService.ServiceSoapClient service = new KioskFramework.NStationService.ServiceSoapClient(new System.ServiceModel.BasicHttpBinding(), remoteAddress); KioskFramework.NStationService.TvmMonitoring model = new KioskFramework.NStationService.TvmMonitoring(); var requestHeader = new KioskFramework.NStationService.WSRequestHeader { Username = "******", Password = "******" }; model.appVersion = TvmMonitoringData.appVersion; model.banknote10 = TvmMonitoringData.banknote10; model.banknote20 = TvmMonitoringData.banknote20; model.bnrStatus = TvmMonitoringData.bnrStatus; model.doorSensorStatus = TvmMonitoringData.doorSensorStatus; model.hopperCoins1 = TvmMonitoringData.hopperCoins1; model.hopperCoins2 = TvmMonitoringData.hopperCoins2; model.hopperCoins5 = TvmMonitoringData.hopperCoins5; model.hopperStatus1 = TvmMonitoringData.hopperStatus1; model.hopperStatus2 = TvmMonitoringData.hopperStatus2; model.hopperStatus5 = TvmMonitoringData.hopperStatus5; model.lastTransactionDate = TvmMonitoringData.lastTransactionDate; model.ledPanelStatus = TvmMonitoringData.ledPanelStatus; model.numberOfQr = TvmMonitoringData.numberOfQr; model.qrPrinterStatus = TvmMonitoringData.qrPrinterStatus; model.QRRJT_Amount = TvmMonitoringData.QRRJT_Amount; model.QRRJT_Count = TvmMonitoringData.QRSJT_Count; model.receiptPrinterStatus = TvmMonitoringData.receiptPrinterStatus; model.speakerStatus = TvmMonitoringData.speakerStatus; model.stationId = TvmMonitoringData.stationId; model.Total_Amount = TvmMonitoringData.Total_Amount; model.Total_Count = TvmMonitoringData.Total_Count; model.tvmId = TvmMonitoringData.tvmId; string val = TVMInfoXml(); if (val != null && val != "") { retVal = service.InsertMonitoring(requestHeader, val); } log.Debug(retVal); } catch (Exception ex) { log.Error(ex.ToString()); return(retVal); } return(retVal); }