Пример #1
0
        internal void SendMultipleAccessControlEvents(KulvaSvc.Entry[] stamps)
        {
            string url = Properties.Settings.Default.Url;

            using (var client = new KulvaSvc.KulvaClient(_bind, _endpoint))
            {
                if (_creds != null)
                {
                    client.ClientCredentials.Windows.ClientCredential = _creds;
                }

                var results = client.Stamps(stamps);

                for (int i = 0; i < results.Length; i++)
                {
                    KulvaSvc.Entry s = stamps[i];
                    PrintColors("CardID: ", s.CardId, Yellow, false);
                    PrintColors("\tReason: ", s.ReasonCode, Yellow, false);
                    PrintColors(" Event time: ", DateString(s.OccurredTime, "HH:mm:ss"), ConsoleColor.Magenta, false);
                    PrintColors(" End time: ", DateString(s.EndTime), ConsoleColor.Magenta);
                    PrintColors("Access Control Stamp: ", results[i].Message, //+ "\r\n",
                                (results[i].Code == 0 ? Green : Red));
                }
            }
        }
Пример #2
0
        internal void SendHeartBeat()
        {
            string url = Properties.Settings.Default.Url;
            var    i   = Identity;

            PrintColors("ClientID: ", i.ClientId, Yellow, false);
            PrintColors("\tDeviceID: ", i.DeviceId, Yellow);

            using (var client = new KulvaSvc.KulvaClient(_bind, _endpoint))
            {
                if (_creds != null)
                {
                    client.ClientCredentials.Windows.ClientCredential = _creds;
                }
                var heartBeatResult = client.HeartBeat(i);
                PrintColors("Heartbeat: ", heartBeatResult.Message + "\r\n", (heartBeatResult.Code == 0 ? Green : Red));
            }
        }