public BallyCCloseSessionResponse CloseSession() { BallyCCloseSessionResponse res = new BallyCCloseSessionResponse(); try { LogManager.WriteLog(DispenserType + "CloseSession Start", LogManager.enumLogLevel.Info); HeartbeatStop(); BallyCCloseSessionRequest req = new BallyCCloseSessionRequest(); req.Id = UserInformation.ID; req.SeqNo = UserInformation.SequenceNumber; req.SessionID = UserInformation.SessionID; res = _Client.CloseSession(req); doProcCloseSessionResponse(res); LogManager.WriteLog(DispenserType + "CloseSession End", LogManager.enumLogLevel.Info); } catch (Exception x) { res.Result = _SYS_CODE.SYS_ERROR; HeartbeatStop(); LogManager.WriteLog(DispenserType + "CloseSession :" + x.ToString(), LogManager.enumLogLevel.Error); } return(res); }
private void doProcCloseSessionResponse(BallyCCloseSessionResponse res) { if (res.Result == _SYS_CODE.SYS_SUCCESS) { UserInformation.Occupied = false; //EventInformation.Enabled = false; UserInformation.SessionID = String.Empty; UserInformation.Group = String.Empty; _DeviceInfo = null; _Client = null; } }
_SYS_CODE doCloseSession() { BallyCCloseSessionResponse res = GloryDeviceHelper.Instance.CloseSession(); if (res != null) { LogManager.WriteLog(DispenserType + "CloseSession result:" + res.Result, LogManager.enumLogLevel.Info); UserInformation.FlagConnected = false; UserInformation.SessionID = String.Empty; UserInformation.Heartbeat = 60; UserInformation.HeartbeatCountdown = UserInformation.Heartbeat; return(res.Result); } return(_SYS_CODE.SYS_ERROR_COMMUNICATION); }
public BallyCCloseSessionResponse CloseSession() { BallyCCloseSessionResponse res = new BallyCCloseSessionResponse(); try { LogManager.WriteLog(DispenserType + "CloseSession Start", LogManager.enumLogLevel.Info); HeartbeatStop(); BallyCCloseSessionRequest req = new BallyCCloseSessionRequest(); req.Id = UserInformation.ID; req.SeqNo = UserInformation.SequenceNumber; req.SessionID = UserInformation.SessionID; res = _Client.CloseSession(req); doProcCloseSessionResponse(res); LogManager.WriteLog(DispenserType + "CloseSession End", LogManager.enumLogLevel.Info); } catch (Exception x) { res.Result = _SYS_CODE.SYS_ERROR; HeartbeatStop(); LogManager.WriteLog(DispenserType + "CloseSession :" + x.ToString(), LogManager.enumLogLevel.Error); } return res; }