xm
2020-05-19 136b9e2fc48249a5ff89874f1080ba94130e7a9e
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -83,9 +83,6 @@
        public async void Read()
        {
            CommonPage.Loading.Start();
            if (!BoolExist())
            {
@@ -101,28 +98,32 @@
                        {
                            continue;
                        }
                        bool yes = false;
                        for (int a = 0; a < logic.Accounts.Count; a++)
                        {
                            //Option4是设备mac;Option2是设备端口;
                            if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString())
                            {
                                //查找是否是那个门锁;
                                //如果不是该门锁联动事件不显示出来;
                                yes = false;
                                break;
                            }
                            if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid)
                            {
                                //查找自己账号下的创建联动事件;
                                yes = true;
                                break;
                            }
                        }
                        if (yes)
                        {
                            Common.Logic.LockLogicList.Add(listlogic[j]);
                        }
                        Common.Logic.LockLogicList.Add(logic);
                        //bool yes = false;
                        //for (int a = 0; a < logic.Accounts.Count; a++)
                        //{
                        //    //Option4是设备mac;Option2是设备端口;
                        //    if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr)
                        //    {
                        //        //查找是否是那个门锁;
                        //        //如果不是该门锁联动事件不显示出来;
                        //        yes = false;
                        //    }
                        //    else
                        //    {
                        //        yes = true;
                        //    }
                        //    //if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid)
                        //    //{
                        //    //    //查找自己账号下的创建联动事件;
                        //    //    yes = true;
                        //    //    break;
                        //    //}
                        //}
                        //if (yes)
                        //{
                        //    Common.Logic.LockLogicList.Add(listlogic[j]);
                        //}
                    }
                }
            }
@@ -317,26 +318,17 @@
        /// <returns></returns>
        private bool Exist(Common.Logic logic)
        {
            bool yes = false;
            for (int j = 0; j < logic.Accounts.Count; j++)
            {
                //Option4是设备mac;Option2是设备端口;
                if (logic.Accounts[j]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[j]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString())
                if (logic.Accounts[j]["Option4"].ToString() == Send.CurrentDoorLock.DeviceAddr)
                {
                    //查找是否是那个门锁;
                    //如果不是该门锁联动事件不显示出来;
                    yes = false;
                    break;
                    return true;
                }
                if (logic.Accounts[j]["Account"].ToString() == Config.Instance.Guid)
                {
                    //查找自己账号下的创建联动事件;
                    yes = true;
                    break;
                }
            }
            return yes;
            return false;
        }
    }
}