Esempio n. 1
0
        private void ShowCardTypeProperty()
        {
            EntranceCardTypeProperty property = EntranceCardTypeProperty.Default;

            if (_CardType == CardType.VipCard)
            {
                property = (EntranceCardTypeProperty)_CardTypeProperty[0];
            }
            else if (_CardType == CardType.OwnerCard)
            {
                property = (EntranceCardTypeProperty)_CardTypeProperty[1];
            }
            else if (_CardType == CardType.MonthRentCard)
            {
                property = (EntranceCardTypeProperty)_CardTypeProperty[2];
            }
            else if (_CardType == CardType.PrePayCard)
            {
                property = (EntranceCardTypeProperty)_CardTypeProperty[3];
            }
            else if (_CardType == CardType.TempCard)
            {
                property = (EntranceCardTypeProperty)_CardTypeProperty[4];
            }
            else if (_CardType == CardType.UserDefinedCard1)
            {
                property = (EntranceCardTypeProperty)_CardTypeProperty[5];
            }
            else if (_CardType == CardType.UserDefinedCard2)
            {
                property = (EntranceCardTypeProperty)_CardTypeProperty[6];
            }

            ShowProperty(property);
        }
Esempio n. 2
0
        private EntranceCardTypeProperty GetProperty()
        {
            EntranceCardTypeProperty property = EntranceCardTypeProperty.Default;

            if (!this.chkEnterNotWriteCarPlate.Checked)
            {
                property ^= EntranceCardTypeProperty.EnterNotWriteCarPlate;
            }
            if (!this.chkNotCompareCarPlate.Checked)
            {
                property ^= EntranceCardTypeProperty.NotCompareCarPlate;
            }
            if (!this.chkCompareFailOpenGate.Checked)
            {
                property ^= EntranceCardTypeProperty.CompareFailOpenGate;
            }
            if (!this.chkWriteCardHandle.Checked)
            {
                property ^= EntranceCardTypeProperty.WriteCardHandle;
            }
            if (!this.chkEnabledWiegand.Checked)
            {
                property ^= EntranceCardTypeProperty.EnabledWiegandReader;
            }

            return(property);
        }
Esempio n. 3
0
        private void SaveCardTypeProperty()
        {
            EntranceCardTypeProperty property = GetProperty();

            if (_CardType == CardType.VipCard)
            {
                _CardTypeProperty[0] = (ushort)property;
            }
            else if (_CardType == CardType.OwnerCard)
            {
                _CardTypeProperty[1] = (ushort)property;
            }
            else if (_CardType == CardType.MonthRentCard)
            {
                _CardTypeProperty[2] = (ushort)property;
            }
            else if (_CardType == CardType.PrePayCard)
            {
                _CardTypeProperty[3] = (ushort)property;
            }
            else if (_CardType == CardType.TempCard)
            {
                _CardTypeProperty[4] = (ushort)property;
            }
            else if (_CardType == CardType.UserDefinedCard1)
            {
                _CardTypeProperty[5] = (ushort)property;
            }
            else if (_CardType == CardType.UserDefinedCard2)
            {
                _CardTypeProperty[6] = (ushort)property;
            }
        }
Esempio n. 4
0
 private void ShowProperty(EntranceCardTypeProperty property)
 {
     this.chkEnterNotWriteCarPlate.Checked = (property & EntranceCardTypeProperty.EnterNotWriteCarPlate) == EntranceCardTypeProperty.EnterNotWriteCarPlate;
     this.chkNotCompareCarPlate.Checked    = (property & EntranceCardTypeProperty.NotCompareCarPlate) == EntranceCardTypeProperty.NotCompareCarPlate;
     this.chkCompareFailOpenGate.Checked   = (property & EntranceCardTypeProperty.CompareFailOpenGate) == EntranceCardTypeProperty.CompareFailOpenGate;
     this.chkWriteCardHandle.Checked       = (property & EntranceCardTypeProperty.WriteCardHandle) == EntranceCardTypeProperty.WriteCardHandle;
     this.chkEnabledWiegand.Checked        = (property & EntranceCardTypeProperty.EnabledWiegandReader) == EntranceCardTypeProperty.EnabledWiegandReader;
 }
Esempio n. 5
0
        /// <summary>
        /// 设置某种卡片类型的控制器属性
        /// </summary>
        /// <param name="cardType"></param>
        /// <param name="property"></param>
        public bool SetCardTypeProperty(CardType cardType, EntranceCardTypeProperty property)
        {
            ushort[] propertyBytes = CardTypeProperty;

            ushort p = 0;

            try
            {
                p = (ushort)property;
            }
            catch
            {
                return(false);
            }

            if (CardType.GetBaseCardType(cardType) == CardType.VipCard)
            {
                propertyBytes[0] = p;
            }
            else if (CardType.GetBaseCardType(cardType) == CardType.OwnerCard)
            {
                propertyBytes[1] = p;
            }
            else if (CardType.GetBaseCardType(cardType) == CardType.MonthRentCard)
            {
                propertyBytes[2] = p;
            }
            else if (CardType.GetBaseCardType(cardType) == CardType.PrePayCard)
            {
                propertyBytes[3] = p;
            }
            else if (CardType.GetBaseCardType(cardType) == CardType.TempCard)
            {
                propertyBytes[4] = p;
            }
            else if (CardType.GetBaseCardType(cardType) == CardType.UserDefinedCard1)
            {
                propertyBytes[5] = p;
            }
            else if (CardType.GetBaseCardType(cardType) == CardType.UserDefinedCard2)
            {
                propertyBytes[6] = p;
            }

            CardTypeProperty = propertyBytes;

            return(true);
        }