Пример #1
0
        public UserStatusObj Post(UserStatusObj next)
        {
            DraftUser user = DraftAuthentication.AuthenticateRequest(Request);

            UserStatusObj toRet = this.dataSource.UpdateStatus(next);

            return toRet;
        }
Пример #2
0
        public UserStatusObj UpdateStatus(UserStatusObj updated)
        {
            UserStatusObj toRet = null;

            lock (_UsageLock)
            {
                // Get user
                UserStatus status = GetOrCreateUserStatus(updated.UserID);
                status.Queue = updated.QueueToString();
                status.Date = DateTime.Now;
                db.SubmitChanges();

                toRet = new UserStatusObj(status);

                // Get Active Users
                toRet.ActiveUsers = GetActiveUsers();
            }

            return toRet;
        }
Пример #3
0
        public UserStatusObj GetStatus(int userId)
        {
            UserStatusObj toRet = new UserStatusObj() { UserID = userId };

            lock (_UsageLock)
            {
                UserStatus status = GetOrCreateUserStatus(userId);
                status.Date = DateTime.Now;
                db.SubmitChanges();

                toRet = new UserStatusObj(status);

                // Get Active Users
                toRet.ActiveUsers = GetActiveUsers();
            }

            return toRet;
        }