| | |
| | | { |
| | | if (conditionsIndex == -1) |
| | | { |
| | | bool add = false; |
| | | for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++) |
| | | { |
| | | if (Common.Logic.CurrentLogic.Conditions[i]["Type"] == "1") |
| | | { |
| | | if ((Common.Logic.CurrentLogic.Conditions[i]["MacAddr"] == Send.CurrentDoorLock.DeviceAddr) && (Common.Logic.CurrentLogic.Conditions[i]["Epoint"] == Send.CurrentDoorLock.DeviceEpoint.ToString())) |
| | | { |
| | | if (Common.Logic.CurrentLogic.Conditions[i]["AttriButeId"] == lockConditionsInfo["AttriButeId"] && Common.Logic.CurrentLogic.Conditions[i]["AttriButeData2"] == lockConditionsInfo["AttriButeData2"]) |
| | | { |
| | | add = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!add) |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.Add(lockConditionsInfo); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.RemoveAt(conditionsIndex); |