From ac3c6b64df51443519d3a27fa8cf0d25dd6ff6d7 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 04 三月 2021 09:37:54 +0800 Subject: [PATCH] Merge branch 'wjc' --- Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs index 6c0c602..e96a79f 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using Newtonsoft.Json.Linq; using Shared.SimpleControl.Phone.Music; namespace Shared.SimpleControl.Phone @@ -666,9 +667,9 @@ timerTemp.whichDay.Add (5); } } - if (string.IsNullOrEmpty (timerTemp.id)) { - timerTemp.id = Guid.NewGuid ().ToString (); - } + //if (string.IsNullOrEmpty (timerTemp.id)) { + // timerTemp.id = Guid.NewGuid ().ToString (); + //} DeviceDate deviceDate = new DeviceDate (); deviceDate.gatewayId = SmartHome.Send.GatewayId; @@ -698,8 +699,17 @@ if (revertObj == null) { new Alert ("", "Unable to save data, please check the network.", "Close").Show (); } else if (revertObj.Code == StateCode.SUCCESS) { + string id = ""; + if (!isEdit) { + var jObject = JObject.Parse (revertObj.Data.ToString ()); + id = jObject ["id"].ToString (); + timerTemp.id = id; + } this.RemoveFromParent (); action (timerTemp); + + + } else { //鎻愮ず閿欒 SmartHome.Method method = new SmartHome.Method (); -- Gitblit v1.8.0