Beispiel #1
0
        public void RegisterDeviceSession(PosStoreSessionInfo newInfo)
        {
            var cache = new SessionCache();
            var key   = KeyFactory.StoreKeyFactory(newInfo.CompanyId, newInfo.StoreId);

            cache.Set(key, newInfo.SessionId);
        }
Beispiel #2
0
        public PosStoreSession GetRegistered(PosStoreSessionInfo sInfo)
        {
            var cache     = new SessionCache();
            var key       = KeyFactory.StoreKeyFactory(sInfo.CompanyId, sInfo.StoreId);
            var sessionId = cache.Get(key);
            var session   = posStoreServer.GetSessionByID(sessionId);

            return(session);
        }
Beispiel #3
0
        public void ReleaseSession(PosStoreSessionInfo sInfo)
        {
            var cache     = new SessionCache();
            var key       = KeyFactory.StoreKeyFactory(sInfo.CompanyId, sInfo.StoreId);
            var sessionId = cache.Get(key);
            var session   = posStoreServer.GetSessionByID(sessionId);

            if (session != null && session.Status != SessionStatus.Closed)
            {
                session.Close();
            }
            cache.Remove(key);
        }
Beispiel #4
0
 public void NotifyAlive(PosStoreSessionInfo sInfo)
 {
     RegisterDeviceSession(sInfo);
 }