From 1ebda09d954de4409c5a7f3ba3c3ee75626ec7c0 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 01 四月 2021 16:08:16 +0800 Subject: [PATCH] 2021-4-1-6 --- HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs index 31e6055..a7ced2e 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs @@ -290,21 +290,28 @@ { //娓呯┖涔嬪墠鏁版嵁 DeviceTypeList.Clear(); - var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); - for (int a = 0; a < jArray.Count; a++) + try { - var jay = jArray[a]; - var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); - var objDeviceType = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceType>(str); - if (objDeviceType != null) + var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); + for (int a = 0; a < jArray.Count; a++) { - if (null == DeviceTypeList.Find((c) => c.id == objDeviceType.id)) + var jay = jArray[a]; + var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); + var objDeviceType = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceType>(str); + if (objDeviceType != null) { - DeviceTypeList.Add(objDeviceType); + if (null == DeviceTypeList.Find((c) => c.id == objDeviceType.id)) + { + DeviceTypeList.Add(objDeviceType); + } } } + action(); } - action(); + catch + { + + } } else { -- Gitblit v1.8.0