From 18b93d511dc764b469d7c4a7e755f7274f89cdb4 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 27 四月 2020 17:55:14 +0800
Subject: [PATCH] 2020-4-27-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs |  144 ++++++++++++++++++++++++++---------------------
 1 files changed, 79 insertions(+), 65 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
index 833f0dd..c9fe20b 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
@@ -18,21 +18,31 @@
             /// 0.姝e父鑷姩鍖�;1.闂ㄩ攣鑷姩鍖�;2.闂ㄩ攣甯稿紑.鍏�;
             switch (intvalue)
             {
-                case 0:
+                case 0:
                     {
                         //new涓�涓柊閫昏緫瀵硅薄锛�
                         //鏂板姝e父鑷姩鍖栧叆鍙�
-                        Common.Logic.CurrentLogic = new Common.Logic();
-                        Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
-                        Common.Logic.CurrentLogic.LogicType = 0;//鏍囪閫昏緫绫诲瀷
-                        Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
-                        var addLogicPage = new AddLogicPage();
+                        //Common.Logic.CurrentLogic = new Common.Logic();
+                        //Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
+                        //Common.Logic.CurrentLogic.LogicType = 0;//鏍囪閫昏緫绫诲瀷
+                        //Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
+                        //var addLogicPage = new AddLogicPage();
+                        //UserView.HomePage.Instance.AddChidren(addLogicPage);
+                        //UserView.HomePage.Instance.PageIndex += 1;
+                        //addLogicPage.Show();
+
+
+                        var addLogicPage = new SoneLogicList();
                         UserView.HomePage.Instance.AddChidren(addLogicPage);
                         UserView.HomePage.Instance.PageIndex += 1;
                         addLogicPage.Show();
-                    }
+
+
+
+
+                    }
                     break;
-                case 1:
+                case 1:
                     {
                         //杩涘叆闂ㄩ攣鑱斿姩浜嬩欢鍏ュ彛
                         Send.UserMemberInfoRes = accountObj;
@@ -40,7 +50,7 @@
                         if (accountObj == null)
                         {
                             ///闃叉鎶涘紓甯�
-                            Send.UserMemberInfoRes = new UserCenter.MemberInfoRes();
+                            Send.UserMemberInfoRes = new UserCenter.MemberInfoRes();
                         }
                         if (doorLock == null)
                         {
@@ -57,10 +67,17 @@
                         UserView.HomePage.Instance.AddChidren(doorLockLogicList);
                         UserView.HomePage.Instance.PageIndex += 1;
                         doorLockLogicList.Show();
-                    }
+                    }
                     break;
-                case 2:
-                    {
+                case 2:
+                    {
+                     
+                        if (doorLock == null)
+                        {
+                            ///闃叉鎶涘紓甯�
+                            doorLock = new DoorLock();
+                        }
+                        Send.CurrentDoorLock = doorLock;
                         Common.Logic.LogicDviceList.Clear();
                         if (Common.Logic.LogicDviceList.Count == 0)
                         {
@@ -83,7 +100,7 @@
                         Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
                         actionsInfo.Add("LinkType", 8);
                         actionsInfo.Add("DeviceAddr", doorLock.DeviceAddr);
-                        actionsInfo.Add("Epoint", doorLock.DeviceEpoint);
+                        actionsInfo.Add("Epoint", "200");
                         actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧
 
                         //new涓�涓柊閫昏緫瀵硅薄锛�
@@ -98,7 +115,7 @@
                         UserView.HomePage.Instance.AddChidren(oneLogic);
                         UserView.HomePage.Instance.PageIndex += 1;
                         oneLogic.Show(false);
-                    }
+                    }
                     break;
             }
 
@@ -180,8 +197,8 @@
                 X = Application.GetRealWidth(58),
                 Y = scenehorizontalScrol.Bottom,
             };
-            functionSceneAutoBodyView.AddChidren(logicScrolView);
-
+            functionSceneAutoBodyView.AddChidren(logicScrolView);
+
             logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
             bool no = false;
             //鏄剧ず榛樿妯℃澘鐨勭晫闈簨浠�
@@ -286,9 +303,9 @@
                 Read(logicScrolView, no);
                 //鍏抽棴鍒锋柊View锛�
                 logicScrolView.EndHeaderRefreshing();
-            };
-
-            //鑷姩鍖�
+            };
+
+            //鑷姩鍖�
             Read(logicScrolView, no);
 
         }
@@ -341,13 +358,11 @@
             Automationview(logicScrolView, no);
             CommonPage.Loading.Hide();
         }
+        static RowLayout selectedRow = new RowLayout() { Tag = "0" };//璁板綍宸︽粦鐘舵��
         /// <summary>
         /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈�
         /// </summary>
         /// <param name="refresview">Refresview.</param>
-        
-        static  RowLayout selectedRow = new RowLayout() { Tag="0"};//璁板綍宸︽粦鐘舵��
-        
         private static async void Automationview(VerticalRefreshLayout refresview, bool no)
         {
             refresview.RemoveAll();
@@ -439,8 +454,8 @@
                     fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
                     logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
                    
-                }
-                i++;
+                }
+                i++;
                 var logicnameBtn = new Button
                 {
                     Height = Application.GetRealHeight(58),
@@ -555,9 +570,9 @@
                     Width = Application.GetRealWidth(1080 - 58),
                     BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
                 };
-                fLayout.AddChidren(line);
-
-
+                fLayout.AddChidren(line);
+
+
             }
 
         }
@@ -595,8 +610,8 @@
                 {
                     indexlist.Add(linkType);
                 }
-            }
-            //鎺掑垪鍥炬爣椤哄簭;
+            }
+            //鎺掑垪鍥炬爣椤哄簭;
             if (indexlist.Contains("0") || indexlist.Contains("8"))
             {
                 iconIndexlist.Add("0");
@@ -744,7 +759,7 @@
             actionsInfo.Add("LinkType", 8);
             actionsInfo.Add("DeviceAddr", common.DeviceAddr);
             actionsInfo.Add("Epoint", common.DeviceEpoint);
-            actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧
+            actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧e
 
             Common.Logic currentLogic = new Common.Logic();
             currentLogic.IsEnable = 1;//榛樿涓哄紑
@@ -753,52 +768,51 @@
             currentLogic.LogicName = Language.StringByID(R.MyInternationalizationString.openmode);
             currentLogic.Conditions.Add(timeConditionsInfo);
             currentLogic.Actions.Add(actionsInfo);
-            Exist(3);//鏌ユ壘鏄惁瀛樺湪璁剧疆杩囧け鏁堟椂闂�(鏈夌殑璇濆垹闄わ紝鍐嶆坊鍔�)
             var logicIfon = await Send.AddModifyLogic(currentLogic);
-            if (logicIfon != null && logicIfon.LogicId != 0)
-            {
-                return true;
+            if (logicIfon != null && logicIfon.LogicId != 0)
+            {
+                //娣诲姞闂ㄩ攣澶辨晥鏃堕棿鐨勫巻鍙茶褰�
+                UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog((DoorLock)common, 9003, timeVlaue.ToString());
+                return true;//琛ㄧず娣诲姞鎴愬姛;
             }
-            return false;
+            return false;//琛ㄧず娣诲姞澶辫触;
+
         }
 
-		///<summary>
-		/// s-one闂ㄩ攣鏄惁瀛樺湪鑷姩鍖栫殑鏂规硶;
-		/// 娉ㄦ剰锛堝弬鏁�2锛�3锛夛細valueInt=3鏄垹闄よ缃け鏁堟椂闂磋嚜鍔ㄥ寲锛泇alueInt=2鍒ゆ柇鏄惁瀛樺湪鑷姩鍖栵紱
-		/// 杩斿洖鍊硷細0涓嶅瓨鍦�;1瀛樺湪;2鍒犻櫎鎴愬姛;3鍒犻櫎澶辫触;
-		/// </summary>
-		public static async System.Threading.Tasks.Task<int> Exist(int valueInt = 2)
-        {
+        ///<summary>
+        /// s-one闂ㄩ攣鏄惁瀛樺湪鑷姩鍖栫殑鏂规硶;
+        /// 娉ㄦ剰(鍙傛暟:2-鑷姩鍖�;3-澶辨晥鏃堕棿鑷姩鍖�);
+        /// 杩斿洖鍊硷細0涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪;
+        /// </summary>
+        public static async System.Threading.Tasks.Task<int> Exist(int valueInt=2)
+        {
             int exist = 0;
-            var Idlist = await Send.GetLogicId(valueInt);
-            if (Idlist.Count != 0)
+            var Idlist = await Send.GetLogicId(valueInt);
+            if (Idlist.Count != 0)
             {
-                if (valueInt == 3)
-                {
-                    for (int i = 0; i < Idlist.Count; i++)
-                    {
-                        //valueInt=3涓�鏉$壒娈婄殑鑷姩鍖�(鐢ㄦ潵璁剧疆澶辨晥鏃堕棿)
-                        var d=await Send.DelLogic(Idlist[i]);
-						if (d != 0)
-						{
-							//鍒犻櫎鎴愬姛
-							exist = 2;
-						}
-						else
-						{
-							//鍒犻櫎澶辫触
-							exist = 3;
-						}
-						return exist;
+                //榛樿鍙栫涓�涓�昏緫ID
+                exist = Idlist[0];
 
-					}
-				}
-                exist = 1;
             }
             return exist;
         }
 
-     
+        ///<summary>
+        ///鑾峰彇閫昏緫淇℃伅
+        /// 杩斿洖鍊硷細null涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪;
+        /// </summary>
+        public static async System.Threading.Tasks.Task<Common.Logic> GetLogicIfon()
+        {
+            Common.Logic logic = null;
+            var Idlist = await Send.GetLogicId(3);
+            if (Idlist.Count != 0)
+            {
+                //榛樿鍙栫涓�涓�昏緫ID(鏃舵晥鎬у彧鏈変竴鏉¢�昏緫)
+                int exist = Idlist[0];
+                logic = await Send.GetLogic(exist, 3);
+            }
+            return logic;
+        }
     }
 }
 

--
Gitblit v1.8.0