예제 #1
0
        /// <summary>
        ///     获取该终端信息
        /// </summary>
        /// <returns></returns>
        private bool TryGetClient()
        {
            List <T_Client_Computer> reslult = new List <T_Client_Computer>();

            try
            {
                reslult = ExamHandle.TryGetData <T_Client_Computer>(Sql.GETCLIENT, _localmac);
            }
            catch (Exception)
            {
                throw;
            }

            //不存在该终端信息,终端未注册
            if (reslult == null || reslult.Count == 0)
            {
                ApplyRegister();
                return(false);
            }

            T_Client_Computer client = reslult[0];

            if (client.IP != _localip)
            {
                UpdateClientInfo(ref client);
            }

            switch (client.Is_White)
            {
            //已提交注册申请,等待管理端通过
            case "请求状态":
                break;

            //该终端已注册
            case "白名单":
            {
                ClientInfo = client;
                App.Client = client;
                return(true);
            }

            //该终端禁止登录
            case "黑名单":
                break;
            }
            return(false);
        }
예제 #2
0
        /// <summary>
        ///     修正终端信息
        /// </summary>
        /// <param name="client"></param>
        private void UpdateClientInfo(ref T_Client_Computer client)
        {
            ExamHandle.TryExecute(Sql.UPDATE_CLIENT, _localip, _localmac);

            client.IP = _localip;
        }