From 652243206427f35a256400a149a1734085824cb9 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 02 九月 2020 17:35:03 +0800
Subject: [PATCH] 2020-09-02-4

---
 ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs |   28 ++++++++--------------------
 1 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs
index 899891a..aaa1c90 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs
@@ -19,9 +19,6 @@
         public void Show(CommonDevice common, bool edit,string str_if,Dictionary<string, object> editdeviceActionInfo = null)
         {
             #region  甯冨眬鐣岄潰
-            actionsInfo = editdeviceActionInfo;
-
-            
             this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
             TopView view = new TopView();
             this.AddChidren(view.TopRowView());
@@ -90,7 +87,7 @@
             //淇濆瓨鐐瑰嚮浜嬩欢
             saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                if (selectedDeviceStatus != "" && actionsInfo != null)
+                if (selectedDeviceStatus != ""&& TaskList.Count!=0)
                 {
                     LogicIfon.AddDeviceActions(common, actionsInfo);
                 }
@@ -194,12 +191,9 @@
                 actionsInfo.Add("DeviceAddr", common.DeviceAddr);
                 actionsInfo.Add("Epoint", common.DeviceEpoint);
                 actionsInfo.Add("Time", 0);
+                actionsInfo.Add("TaskList", TaskList);
             }
-            if (actionsInfo.ContainsKey("TaskList"))
-            {
-                actionsInfo.Remove("TaskList");
-            }
-            actionsInfo.Add("TaskList", TaskList);
+           
         }
         public void CurrentDeviceView(string if_str, CommonDevice common, bool edit, Button button)
         {
@@ -221,13 +215,12 @@
 
             string status = "";
             Dictionary<string, string> dictionaryLight = new Dictionary<string, string>();
+            dictionaryLight.Clear();
             switch (if_str)
             {
                 case "澶滅伅寮�鍏�":
                     {
-
-                        Send.dictionary(dictionaryLight, "TaskType", "1");
-                        Send.dictionary(dictionaryLight, "Data2", "0");
+                       
                         mFunView openView = new mFunView();
                         openView.frameLayout.Y = Application.GetRealHeight(140 + 20);
                         openView.titleBtn.TextID = MyInternationalizationString.open;
@@ -286,8 +279,6 @@
                     break;
                 case "浜害":
                     {
-                        Send.dictionary(dictionaryLight, "TaskType", "3");
-                        Send.dictionary(dictionaryLight, "Data2", "0");
                         var horizontalSeekBarVol = new DiyImageSeekBar
                         {
                             Y = Application.GetRealHeight(140),//杩涘害鏉$埗鎺т欢Y鍧愭爣
@@ -333,8 +324,6 @@
                     break;
                 case "鑹叉俯":
                     {
-                        Send.dictionary(dictionaryLight, "TaskType", "8");
-                        Send.dictionary(dictionaryLight, "Data2", "0");
                         Button seekIconBtn = new Button
                         {
                             Y = Application.GetRealHeight(140 + 160),
@@ -392,9 +381,6 @@
                     break;
                 case "铚傞福鍣�":
                     {
-                        Send.dictionary(dictionaryLight, "TaskType", "7");
-                        Send.dictionary(dictionaryLight, "Data2", "0");
-
 
                         mFunView openView = new mFunView();
                         openView.frameLayout.Y = Application.GetRealHeight(140 + 20);
@@ -457,8 +443,10 @@
             }
             completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
-                if (selectedDeviceStatus != "")
+                if (dictionaryLight.Count!=0)
                 {
+                    Send.dictionary(dictionaryLight, "TaskType", selectedDeviceStatus);
+                    Send.dictionary(dictionaryLight, "Data2", "0");
                     flMain.RemoveFromParent();
                     DicValue(selectedDeviceStatus, dictionaryLight);
                     button.Text = status;

--
Gitblit v1.8.0