/// <summary>
        /// 禁用
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnDisable_Click(object sender, EventArgs e)
        {
            if (!CStaticClass.CheckPushService())
            {// 检查服务
                return;
            }

            QueryServiceClient proxy = new QueryServiceClient();
            PushServiceClient  push  = new PushServiceClient(new System.ServiceModel.InstanceContext(CStaticClass.myCallback));

            try
            {
                if (string.IsNullOrEmpty(this.CboEquipWareHouse.Text) || string.IsNullOrEmpty(this.CboEquipID.Text))
                {
                    MessageBox.Show("库区,设备都不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                int nEquipID   = CStaticClass.ConvertETVDescp(this.CboEquipID.Text);
                int nWareHouse = CStaticClass.ConvertWareHouse(this.CboEquipWareHouse.Text);
                CarLocationPanelLib.PushService.EnmFaultType type = push.SetDeviceMode(nWareHouse, nEquipID, 0);

                switch (type)
                {
                case CarLocationPanelLib.PushService.EnmFaultType.Success:
                {
                    CSystemLogDto log = new CSystemLogDto();
                    log.curtime  = CStaticClass.CurruntDateTime();
                    log.logdescp = "禁用设备成功:设备号-" + nEquipID + " 库号-" + nWareHouse;
                    log.optcode  = CStaticClass.myOperator.optcode;
                    log.optname  = CStaticClass.myOperator.optname;
                    proxy.InsertSysLog(log);
                    MessageBox.Show("禁用设备成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.NotFoundEquip:
                {
                    MessageBox.Show("没有找到指定设备!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.NotAllowed:
                {
                    MessageBox.Show("设备当前状态与要修改的状态相同!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.FailToUpdate:
                {
                    MessageBox.Show("更新数据库失败!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.Exception:
                {
                    MessageBox.Show(CStaticClass.GetExceptionInfo(null), "连接异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                }

                default:
                {
                    MessageBox.Show("禁用设备失败!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }
                }
            }
            catch (TimeoutException)
            {
                MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (FaultException exception)
            {
                MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (CommunicationException exception)
            {
                MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception exception)
            {
                MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            proxy.Close();
            push.Close();
        }
        /// <summary>
        /// 启用
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnEnable_Click(object sender, EventArgs e)
        {
            if (!CStaticClass.CheckPushService())
            {// 检查服务
                return;
            }

            QueryServiceClient proxy = new QueryServiceClient();
            PushServiceClient  push  = new PushServiceClient(new System.ServiceModel.InstanceContext(CStaticClass.myCallback));

            try
            {
                if (string.IsNullOrEmpty(this.CboEquipWareHouse.Text) || string.IsNullOrEmpty(this.CboEquipID.Text))
                {
                    MessageBox.Show("库区,设备都不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                DialogResult dr = MessageBox.Show("确认启用?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);

                if (dr == DialogResult.Cancel)
                {
                    return;
                }

                int nEquipID   = CStaticClass.ConvertETVDescp(this.CboEquipID.Text);
                int nWareHouse = CStaticClass.ConvertWareHouse(this.CboEquipWareHouse.Text);
                CarLocationPanelLib.PushService.EnmFaultType type = push.SetDeviceMode(nWareHouse, nEquipID, 1);

                switch (type)
                {
                case CarLocationPanelLib.PushService.EnmFaultType.Success:
                {
                    CSystemLogDto log = new CSystemLogDto();
                    log.curtime  = CStaticClass.CurruntDateTime();
                    log.logdescp = "启用设备成功:设备号-" + nEquipID + " 库号-" + nWareHouse;
                    log.optcode  = CStaticClass.myOperator.optcode;
                    log.optname  = CStaticClass.myOperator.optname;
                    proxy.InsertSysLog(log);
                    MessageBox.Show("启用设备成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.NotFoundEquip:
                {
                    MessageBox.Show("没有找到指定设备!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.NotAutomatic:
                {
                    MessageBox.Show("设备非全自动模式不能启用!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.NotAllowed:
                {
                    MessageBox.Show("设备当前状态与要修改的状态相同!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.FailToUpdate:
                {
                    MessageBox.Show("更新数据库失败!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.InvalidWareHouseID:
                {
                    MessageBox.Show("无效库区号!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.Null:
                {        //下一取车队列的传入的参数卡号为空
                    MessageBox.Show("无取车排队队列!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.NoICCardInfo:
                {
                    MessageBox.Show("下一取车队列的IC卡没有制卡!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.LossORCancel:
                {
                    MessageBox.Show("下一取车队列的IC卡注销或挂失!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.NotMatch:
                {
                    MessageBox.Show("下一取车队列的IC卡类型不正确!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.NoCarInGarage:
                {
                    MessageBox.Show("下一取车队列的用户没有车存在库内!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.FailToSendTelegram:
                {
                    MessageBox.Show("下一取车队列发送报文失败, 请重新刷卡取车!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.WorkQueueNotEmpty:
                {
                    CSystemLogDto log = new CSystemLogDto();
                    log.curtime  = CStaticClass.CurruntDateTime();
                    log.logdescp = "启用成功,正在为取车排队的车主取车,请稍后片刻:设备号-" + nEquipID + " 库号-" + nWareHouse;
                    log.optcode  = CStaticClass.myOperator.optcode;
                    log.optname  = CStaticClass.myOperator.optname;
                    proxy.InsertSysLog(log);
                    MessageBox.Show("启用成功,正在为取车排队的车主取车,请稍后片刻!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }

                case CarLocationPanelLib.PushService.EnmFaultType.Exception:
                {
                    MessageBox.Show(CStaticClass.GetExceptionInfo(null), "连接异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                }

                default:
                {
                    MessageBox.Show("启用设备失败!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;
                }
                }
            }
            catch (TimeoutException)
            {
                MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (FaultException exception)
            {
                MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (CommunicationException exception)
            {
                MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception exception)
            {
                MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            proxy.Close();
            push.Close();
        }