From 761fc6621ed9d54b520dcf0f0ce6158e050e2214 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 03 三月 2021 20:16:03 +0800
Subject: [PATCH] 2021-3-3-3

---
 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