Example #1
0
        public int GetRegisteredUsersIDs(TerminalDevice device)
        {
            int userCount = 0;

            oTerminal myTerminal = new oTerminal(device.IPAddress, device.ID, device.Port, device.AccKey);

            if (myTerminal.isAlive())
            {
                myTerminal.INT_ReceiveTimeOut = 10000;
                try
                {
                    UserAdapter userAdapter = new UserAdapter();
                    userAdapter.ComputeUserID(myTerminal.GetUserIDList());
                    device.UsersIDs = userAdapter.GetIDlist();
                    if (device.UsersIDs != null)
                    {
                        userCount = device.UsersIDs.Count();
                    }
                }
                catch (Exception ex)
                {
                    DataAccess.InsertError(new ExceptionDB()
                    {
                        Date = DateTime.Now, Message = "DeviceControl-GetRegisteredUsersIDs: " + ex.Message
                    });
                }
            }

            return(userCount);
        }