Exemplo n.º 1
0
        public int GetUserData(TerminalDevice device, string cardID)
        {
            int userCount = 0;

            cardID = cardID.PadLeft(10, '0');
            oTerminal myTerminal = new oTerminal(device.IPAddress, device.ID, device.Port, device.AccKey);

            if (myTerminal.isAlive())
            {
                myTerminal.INT_ReceiveTimeOut = 10000;
                try
                {
                    device.AddUserData(myTerminal.GetUserData(cardID), cardID);
                    userCount = device.Users.Count();
                }
                catch (Exception ex)
                {
                    DataAccess.InsertError(new ExceptionDB()
                    {
                        Date = DateTime.Now, Message = "DeviceControl-GetUserData: " + ex.Message
                    });
                }
            }
            return(userCount);
        }