From 081ea8d273048fd03756718ac6fb48a3c09218e9 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 29 十月 2019 13:10:00 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs |  603 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 321 insertions(+), 282 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
index 4cfcdd7..395bc71 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
@@ -20,230 +20,318 @@
 
         public void Show()
         {
-            this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
-            this.AddChidren(new Button
-            {
-                Height = Application.GetRealHeight(80),
-            });
 
-            var topFrameLayout = new FrameLayout
+            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
+            var topRowLayout = new RowLayout
             {
-                Height = Application.GetRealHeight(140),
-                Y = Application.GetRealHeight(80),
+                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
+                Height = Application.GetRealHeight(184),
+                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
             };
-            AddChidren(topFrameLayout);
+            this.AddChidren(topRowLayout);
 
             var titleName = new Button
             {
-                TextID = MyInternationalizationString.securitymode,
-                TextSize = 17,
+                TextSize = 16,
                 TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                 TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(150),
+                X = Application.GetRealWidth(176),
+                Width = Application.GetRealWidth(400),
+                Height = Application.GetRealHeight(69),
+                Y = Application.GetRealHeight(92),
+                TextID = MyInternationalizationString.securitymode,
             };
-            topFrameLayout.AddChidren(titleName);
+            topRowLayout.AddChidren(titleName);
 
-            var back = new Button
+            var clickBtn = new Button
             {
-                Width = Application.GetRealWidth(110),
-                Height = Application.GetRealHeight(110),
-                X = Application.GetRealWidth(20),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/Back.png",
+                Width = Application.GetRealWidth(81 + 51),
+                Height = Application.GetRealHeight(58 + 40),
+                Y = Application.GetRealHeight(98 - 40),
             };
-            topFrameLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
+            topRowLayout.AddChidren(clickBtn);
+            clickBtn.MouseDownEventHandler += (sender, e) =>
             {
                 RemoveFromParent();
             };
 
+            var back = new Button
+            {
+                Width = Application.GetRealWidth(30),
+                Height = Application.GetRealHeight(51),
+                X = Application.GetRealWidth(81),
+                Y = Application.GetRealHeight(98),
+                //Gravity = Gravity.CenterVertical;
+                UnSelectedImagePath = "ZigeeLogic/back.png",
+            };
+            topRowLayout.AddChidren(back);
+            back.MouseDownEventHandler += (sender, e) => {
+                RemoveFromParent();
+            };
+            #endregion
 
-            var middle = new VerticalScrolViewLayout();
-            middle.Y = topFrameLayout.Bottom;
-            middle.Height = Application.GetRealHeight(1920 - 220);
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+            var middle = new FrameLayout();
+            middle.Y = topRowLayout.Bottom;
+            middle.Height = Application.GetRealHeight(1920 - 184);
+            middle.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
             this.AddChidren(middle);
 
-            if (actionsInfo.ContainsKey("LinkType"))
+            var btnsave = new Button
             {
-                actionsInfo.Remove("LinkType");
-            }
-            if (actionsInfo.ContainsKey("SecurityModeId"))
-            {
-                actionsInfo.Remove("SecurityModeId");
-            }
-            if (actionsInfo.ContainsKey("CheckIASStatus"))
-            {
-                actionsInfo.Remove("CheckIASStatus");
-            }
-            if (actionsInfo.ContainsKey("IsDelayStart"))
-            {
-                actionsInfo.Remove("IsDelayStart");
-            }
-            
-            actionsInfo.Add("LinkType", 6);
-            actionsInfo.Add("SecurityModeId", 0);
-            actionsInfo.Add("CheckIASStatus", 0);
-            actionsInfo.Add("IsDelayStart", 0);
-           
+                Y= middle.Height-Application.GetRealHeight(260),
+                X = Application.GetRealWidth(85),
+                Height = Application.GetRealHeight(130),
+                Width = Application.GetRealWidth(910),
+                Radius = (uint)Application.GetRealHeight(60),
+                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
+                TextID = MyInternationalizationString.Save,
+                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
 
-            #region ----甯冮槻 鎾ら槻 鑳佽揩鎾ら槻----
-            var defenceRowLayout = new RowLayout
-            {
-                Height = Application.GetRealHeight(180),
             };
-            middle.AddChidren(defenceRowLayout);
+            middle.AddChidren(btnsave);
 
-            var btndefence = new Button
+
+
+
+            #region ----(鍦ㄥ/绂诲)甯冮槻 鎾ら槻 鑳佽揩鎾ら槻----
+            #region  鍦ㄥ甯冮槻
+
+
+            var athomeFrameLayout = new FrameLayout
             {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.defence,
+                Height = Application.GetRealHeight(160),
+                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+            };
+            middle.AddChidren(athomeFrameLayout);
+
+            var athomeiconBtn = new Button
+            {
+                Width = Application.GetRealWidth(81),
+                Height = Application.GetRealHeight(81),
+                X = Application.GetRealWidth(58),
+                Y = Application.GetRealHeight(55),
+                UnSelectedImagePath = "ZigeeLogic/athome.png",
+
+            };
+            athomeFrameLayout.AddChidren(athomeiconBtn);
+
+            var athomedefenceRowLayout = new RowLayout
+            {
+                Y = Application.GetRealHeight(30),
+                Width = Application.GetRealWidth(850),
+                Height = Application.GetRealHeight(130),
+                X = Application.GetRealWidth(176),
+                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+            };
+            athomeFrameLayout.AddChidren(athomedefenceRowLayout);
+
+            var btnathomedefence = new Button
+            {
+                Text = Language.StringByID(MyInternationalizationString.logicathomegarrison),
                 TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(40),
                 TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                //Text="甯冮槻",
             };
-            defenceRowLayout.AddChidren(btndefence);
+            athomedefenceRowLayout.AddChidren(btnathomedefence);
+            var athomedefenceSelected = new SelectedButton(789);
+            athomedefenceRowLayout.AddChidren(athomedefenceSelected);
+            #endregion
 
-            var defenceSelected = new Button
+            #region  绂诲甯冮槻
+
+            var leavehomeFrameLayout = new FrameLayout
             {
-                X = Application.GetRealWidth(1080 - 150),
-                Width = Application.GetMinRealAverage(110),
-                Height = Application.GetMinRealAverage(110),
-                UnSelectedImagePath = "Item/YesSelected.png",
-                Visible = false,
-                Gravity = Gravity.CenterVertical
+                Height = Application.GetRealHeight(160),
+                Y = athomeFrameLayout.Bottom,
+                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
             };
-            defenceRowLayout.AddChidren(defenceSelected);
+            middle.AddChidren(leavehomeFrameLayout);
 
-            var withdrawalRowLayout = new RowLayout
+
+            var leavehomeiconBtn = new Button
             {
-                Height = Application.GetRealHeight(180),
+                Width = Application.GetRealWidth(81),
+                Height = Application.GetRealHeight(81),
+                X = Application.GetRealWidth(58),
+                Y = Application.GetRealHeight(55),
+                UnSelectedImagePath = "ZigeeLogic/leavehome.png",
+
             };
-            middle.AddChidren(withdrawalRowLayout);
+            leavehomeFrameLayout.AddChidren(leavehomeiconBtn);
 
-            var btnwithdrawal = new Button
+
+            var leavehomedefenceRowLayout = new RowLayout
             {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.withdrawal,
+                Y = Application.GetRealHeight(30),
+                Width = Application.GetRealWidth(850),
+                Height = Application.GetRealHeight(130),
+                X = Application.GetRealWidth(176),
+                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+            };
+            leavehomeFrameLayout.AddChidren(leavehomedefenceRowLayout);
+
+            var leavehomebtndefence = new Button
+            {
+                Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison),
                 TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(40),
                 TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                //Text = "鎾ら槻",
-            };
-            withdrawalRowLayout.AddChidren(btnwithdrawal);
 
-            var withdrawalSelected = new Button
-            {
-                X = Application.GetRealWidth(1080 - 150),
-                Width = Application.GetMinRealAverage(110),
-                Height = Application.GetMinRealAverage(110),
-                UnSelectedImagePath = "Item/YesSelected.png",
-                Visible = false,
-                Gravity = Gravity.CenterVertical
             };
-            withdrawalRowLayout.AddChidren(withdrawalSelected);
-         
-            var urgentwithdrawalRowLayout = new RowLayout
-            {
-                Height = Application.GetRealHeight(180),
-            };
-            middle.AddChidren(urgentwithdrawalRowLayout);
-
-            var btnurgentwithdrawal = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.urgentwithdrawal,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                //Text = "鑳佽揩鎾ら槻",
-            };
-            urgentwithdrawalRowLayout.AddChidren(btnurgentwithdrawal);
-
-            var urgentwithdrawalSelected = new Button
-            {
-                X = Application.GetRealWidth(1080 - 150),
-                Width = Application.GetMinRealAverage(110),
-                Height = Application.GetMinRealAverage(110),
-                UnSelectedImagePath = "Item/YesSelected.png",
-                Visible = false,
-                Gravity = Gravity.CenterVertical
-            };
-            urgentwithdrawalRowLayout.AddChidren(urgentwithdrawalSelected);
+            leavehomedefenceRowLayout.AddChidren(leavehomebtndefence);
+            var leavehomedefenceSelected = new SelectedButton(789);
+            leavehomedefenceRowLayout.AddChidren(leavehomedefenceSelected);
 
             #endregion
 
-            string strvalue = "";
-            ///甯冮槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> copenclick = (seder, e) =>
+            #region  鎾ら槻
+
+
+            var withdrawalFrameLayout = new FrameLayout
             {
-                defenceSelected.Visible = true;
-                withdrawalSelected.Visible = false;
-                urgentwithdrawalSelected.Visible = false;
-                SecurityView(strvalue);
+                Height = Application.GetRealHeight(160),
+                Y = leavehomeFrameLayout.Bottom,
+                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+            };
+            middle.AddChidren(withdrawalFrameLayout);
+
+
+            var withdrawaliconBtn = new Button
+            {
+                Width = Application.GetRealWidth(81),
+                Height = Application.GetRealHeight(81),
+                X = Application.GetRealWidth(58),
+                Y = Application.GetRealHeight(55),
+                UnSelectedImagePath = "ZigeeLogic/withdrawal.png",
 
             };
-            btndefence.MouseUpEventHandler += copenclick;
-            defenceRowLayout.MouseUpEventHandler += copenclick;
+            withdrawalFrameLayout.AddChidren(withdrawaliconBtn);
 
+
+
+            var withdrawalRowLayout = new RowLayout
+            {
+                Y = Application.GetRealHeight(30),
+                Width = Application.GetRealWidth(850),
+                Height = Application.GetRealHeight(130),
+                X = Application.GetRealWidth(176),
+                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+            };
+            withdrawalFrameLayout.AddChidren(withdrawalRowLayout);
+
+            var btnwithdrawal = new Button
+            {
+
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+                TextID = MyInternationalizationString.withdrawal,
+
+            };
+            withdrawalRowLayout.AddChidren(btnwithdrawal);
+            var withdrawalSelected = new SelectedButton(789);
+            withdrawalRowLayout.AddChidren(withdrawalSelected);
+
+            #endregion
+
+            #region  鑳佽揩鎾ら槻
+            var urgentwithdFrameLayout = new FrameLayout
+            {
+                Height = Application.GetRealHeight(160),
+                Y = withdrawalFrameLayout.Bottom,
+                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+            };
+            middle.AddChidren(urgentwithdFrameLayout);
+
+
+            var urgentwithdiconBtn = new Button
+            {
+                Width = Application.GetRealWidth(81),
+                Height = Application.GetRealHeight(81),
+                X = Application.GetRealWidth(58),
+                Y = Application.GetRealHeight(55),
+                UnSelectedImagePath = "ZigeeLogic/withdrawal.png",
+
+            };
+            urgentwithdFrameLayout.AddChidren(urgentwithdiconBtn);
+
+            var urgentwithdrawalRowLayout = new RowLayout
+            {
+                Y = Application.GetRealHeight(30),
+                Width = Application.GetRealWidth(850),
+                Height = Application.GetRealHeight(130),
+                X = Application.GetRealWidth(176),
+                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+            };
+            urgentwithdFrameLayout.AddChidren(urgentwithdrawalRowLayout);
+
+            var btnurgentwithdrawal = new Button
+            {
+                TextID = MyInternationalizationString.urgentwithdrawal,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            };
+            urgentwithdrawalRowLayout.AddChidren(btnurgentwithdrawal);
+
+            var urgentwithdrawalSelected = new SelectedButton(789);
+            urgentwithdrawalRowLayout.AddChidren(urgentwithdrawalSelected);
+            #endregion
+
+            #endregion
+
+            ///鍦ㄥ甯冮槻鐐瑰嚮浜嬩欢
+            EventHandler<MouseEventArgs> athomeclick = (sedner14, e14) =>
+            {
+                athomedefenceSelected.Visible = true;
+                leavehomedefenceSelected.Visible = false;
+                withdrawalSelected.Visible = false;
+                urgentwithdrawalSelected.Visible = false;
+            };
+            athomedefenceRowLayout.MouseUpEventHandler += athomeclick;
+            btnathomedefence.MouseUpEventHandler += athomeclick;
+            athomedefenceSelected.MouseUpEventHandler += athomeclick;
+            athomeFrameLayout.MouseUpEventHandler += athomeclick;
+            athomeiconBtn.MouseUpEventHandler += athomeclick;
+
+            ///绂诲甯冮槻鐐瑰嚮浜嬩欢
+            EventHandler<MouseEventArgs> leavehomeclick = (sedner14, e14) =>
+            {
+                athomedefenceSelected.Visible = false;
+                leavehomedefenceSelected.Visible = true;
+                withdrawalSelected.Visible = false;
+                urgentwithdrawalSelected.Visible = false;
+            };
+            leavehomedefenceRowLayout.MouseUpEventHandler += leavehomeclick;
+            leavehomebtndefence.MouseUpEventHandler += leavehomeclick;
+            leavehomedefenceSelected.MouseUpEventHandler += leavehomeclick;
+            leavehomeFrameLayout.MouseUpEventHandler += leavehomeclick;
+            leavehomeiconBtn.MouseUpEventHandler += leavehomeclick;
 
             ///鎾ら槻鐐瑰嚮浜嬩欢
             EventHandler<MouseEventArgs> disableclick = (seder, e) =>
             {
-                defenceSelected.Visible = false;
+                athomedefenceSelected.Visible = false;
+                leavehomedefenceSelected.Visible = false;
                 withdrawalSelected.Visible = true;
                 urgentwithdrawalSelected.Visible = false;
-                if (actionsInfo.ContainsKey("Password"))
-                {
-                    actionsInfo.Remove("Password");
-                }
-                actionsInfo.Add("Password", "999999");
-                if (actionsInfo.ContainsKey("SecurityModeId"))
-                {
-                    actionsInfo.Remove("SecurityModeId");
-                }
-                if (actionsInfo.ContainsKey("SecuritySetting"))
-                {
-                    actionsInfo.Remove("SecuritySetting");
-                }
-                actionsInfo.Add("SecurityModeId", "0");
-                actionsInfo.Add("SecuritySetting", "0");
-                LogicIfon.AddSecurityactions(actionsInfo);
-                this.RemoveFromParent();
-                var logicCommunalPage = new LogicCommunalPage();
-                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show(() => { });
+
             };
             withdrawalRowLayout.MouseUpEventHandler += disableclick;
             btnwithdrawal.MouseUpEventHandler += disableclick;
+            withdrawalSelected.MouseUpEventHandler += disableclick;
+            withdrawalFrameLayout.MouseUpEventHandler += disableclick;
+            withdrawaliconBtn.MouseUpEventHandler += disableclick;
 
             ///鑳佽揩鎾ら槻鐐瑰嚮浜嬩欢
             EventHandler<MouseEventArgs> urgentwithdrawalclick = (seder, e) =>
             {
-                defenceSelected.Visible = false;
+                athomedefenceSelected.Visible = false;
+                leavehomedefenceSelected.Visible = false;
                 withdrawalSelected.Visible = false;
                 urgentwithdrawalSelected.Visible = true;
-                if (actionsInfo.ContainsKey("Password"))
-                {
-                    actionsInfo.Remove("Password");
-                }
-                if (actionsInfo.ContainsKey("SecuritySetting"))
-                {
-                    actionsInfo.Remove("SecuritySetting");
-                }
-                actionsInfo.Add("Password", "888888");
-                actionsInfo.Add("SecuritySetting", "0");
-                LogicIfon.AddSecurityactions(actionsInfo);
-                this.RemoveFromParent();
-                var logicCommunalPage = new LogicCommunalPage();
-                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show(() => { });
             };
             urgentwithdrawalRowLayout.MouseUpEventHandler += urgentwithdrawalclick;
             btnurgentwithdrawal.MouseUpEventHandler += urgentwithdrawalclick;
+            urgentwithdrawalSelected.MouseUpEventHandler+= urgentwithdrawalclick;
+            urgentwithdFrameLayout.MouseUpEventHandler += urgentwithdrawalclick;
+            urgentwithdiconBtn.MouseUpEventHandler += urgentwithdrawalclick;
 
             if (IsDeviceEditor)
             {
@@ -251,18 +339,20 @@
                 {
                     if (actions["LinkType"].ToString() == "6")
                     {
-                        
+
                         if (actions["SecuritySetting"].ToString() == "0")
                         {
                             if (actions["Password"].ToString() == "888888")
                             {
-                                defenceSelected.Visible = false;
+                                athomedefenceSelected.Visible = false;
+                                leavehomedefenceSelected.Visible = false;
                                 withdrawalSelected.Visible = false;
                                 urgentwithdrawalSelected.Visible = true;
                             }
                             else
                             {
-                                defenceSelected.Visible = false;
+                                athomedefenceSelected.Visible = false;
+                                leavehomedefenceSelected.Visible = false;
                                 withdrawalSelected.Visible = true;
                                 urgentwithdrawalSelected.Visible = false;
                             }
@@ -270,10 +360,18 @@
                         }
                         else if (actions["SecuritySetting"].ToString() == "1")
                         {
-                            strvalue = actions["SecurityModeId"].ToString();
-                            defenceSelected.Visible = true;
+                            athomedefenceSelected.Visible = true;
+                            leavehomedefenceSelected.Visible = false;
                             withdrawalSelected.Visible = false;
                             urgentwithdrawalSelected.Visible = false;
+                        }
+                        else if (actions["SecuritySetting"].ToString() == "2")
+                        {
+                            athomedefenceSelected.Visible = false;
+                            leavehomedefenceSelected.Visible = true;
+                            withdrawalSelected.Visible = false;
+                            urgentwithdrawalSelected.Visible = false;
+
                         }
                         break;
 
@@ -282,146 +380,87 @@
                 }
 
             }
+                        
 
-
-        }
-
-        void SecurityView(string strvalue)
-        {
-            FrameLayout flMain = new FrameLayout { BackgroundColor = 0x00000000 };
-            this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender, e) =>
+            btnsave.MouseUpEventHandler += (sender, e) =>
             {
-                flMain.RemoveFromParent();
-            };
-
-            var frameLayout = new FrameLayout
-            {
-                Y = Application.GetRealHeight(1920 - 360),
-                Height = Application.GetRealHeight(360),
-                BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor,
-            };
-            flMain.AddChidren(frameLayout);
-
-          var athomeRow = new RowLayout
-            {
-                Height = Application.GetRealHeight(180),
-            };
-            frameLayout.AddChidren(athomeRow);
-
-            var athomeBtn = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.athome,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            athomeRow.AddChidren(athomeBtn);
-
-            var athomeSelected = new Button
-            {
-                X = Application.GetRealWidth(1080 - 150),
-                Width = Application.GetMinRealAverage(110),
-                Height = Application.GetMinRealAverage(110),
-                UnSelectedImagePath = "Item/YesSelected.png",
-                Visible = false,
-                Gravity = Gravity.CenterVertical
-            };
-            athomeRow.AddChidren(athomeSelected);
-
-            var leavehomeRow = new RowLayout
-            {
-                Height = Application.GetRealHeight(180),
-                Y = athomeRow.Bottom,
-            };
-            frameLayout.AddChidren(leavehomeRow);
-            var leavehomeBtn = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.leavehome,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            leavehomeRow.AddChidren(leavehomeBtn);
-
-            var leavehomeSelected = new Button
-            {
-                X = Application.GetRealWidth(1080 - 150),
-                Width = Application.GetMinRealAverage(110),
-                Height = Application.GetMinRealAverage(110),
-                UnSelectedImagePath = "Item/YesSelected.png",
-                Visible = false,
-                Gravity = Gravity.CenterVertical
-            };
-            leavehomeRow.AddChidren(leavehomeSelected);
-
-            EventHandler<MouseEventArgs> athomeclick = (sender6, e6) =>
-            {
-                flMain.RemoveFromParent();
-                if (actionsInfo.ContainsKey("SecurityModeId"))
+                if (!athomedefenceSelected.Visible && !leavehomedefenceSelected.Visible && !withdrawalSelected.Visible && !urgentwithdrawalSelected.Visible)
                 {
-                    actionsInfo.Remove("SecurityModeId");
+                    return;
                 }
-                if (actionsInfo.ContainsKey("SecuritySetting"))
+
+                if (actionsInfo.ContainsKey("LinkType"))
                 {
-                    actionsInfo.Remove("SecuritySetting");
+                    actionsInfo.Remove("LinkType");
                 }
+                if (actionsInfo.ContainsKey("CheckIASStatus"))
+                {
+                    actionsInfo.Remove("CheckIASStatus");
+                }
+                if (actionsInfo.ContainsKey("IsDelayStart"))
+                {
+                    actionsInfo.Remove("IsDelayStart");
+                }
+
+                actionsInfo.Add("LinkType", 6);
+                actionsInfo.Add("CheckIASStatus", 0);
+                actionsInfo.Add("IsDelayStart", 0);
+                
                 if (actionsInfo.ContainsKey("Password"))
                 {
                     actionsInfo.Remove("Password");
                 }
-                actionsInfo.Add("Password", "666666");
-                actionsInfo.Add("SecurityModeId", "1");
-                actionsInfo.Add("SecuritySetting", "1");
-                LogicIfon.AddSecurityactions(actionsInfo);
-                var logicCommunalPage = new LogicCommunalPage();
-                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show(() => { });
-
-            };
-            athomeRow.MouseUpEventHandler += athomeclick;
-            athomeBtn.MouseUpEventHandler += athomeclick;
-            athomeSelected.MouseUpEventHandler += athomeclick;
-
-            EventHandler<MouseEventArgs> leavehomeclick = (sender6, e6) =>
-            {
-                flMain.RemoveFromParent();
-                if (actionsInfo.ContainsKey("SecurityModeId"))
-                {
-                    actionsInfo.Remove("SecurityModeId");
-                }
                 if (actionsInfo.ContainsKey("SecuritySetting"))
                 {
                     actionsInfo.Remove("SecuritySetting");
                 }
-                if(actionsInfo.ContainsKey("Password"))
+                if (actionsInfo.ContainsKey("SecurityModeId"))
                 {
-                    actionsInfo.Remove("Password");
+                    actionsInfo.Remove("SecurityModeId");
                 }
-                actionsInfo.Add("Password", "666666");
-                actionsInfo.Add("SecurityModeId", "2");
-                actionsInfo.Add("SecuritySetting", "1");
+                ///鍦ㄥ甯冮槻
+                if (athomedefenceSelected.Visible)
+                {
+                    actionsInfo.Add("SecuritySetting", "1");
+                    actionsInfo.Add("SecurityModeId", "1");
+                    actionsInfo.Add("Password", "666666");
+
+                }
+                ///绂诲甯冮槻
+                if (leavehomedefenceSelected.Visible)
+                {
+                    actionsInfo.Add("SecuritySetting", "1");
+                    actionsInfo.Add("SecurityModeId", "2");
+                    actionsInfo.Add("Password", "666666");
+
+                }
+                ///鎾ら槻
+                if (withdrawalSelected.Visible)
+                {
+                    actionsInfo.Add("SecuritySetting", "0");
+                    actionsInfo.Add("SecurityModeId", "0");
+                    actionsInfo.Add("Password", "999999");
+
+                }
+                ///绱ц揩鎾ら槻
+                if (urgentwithdrawalSelected.Visible)
+                {
+                    actionsInfo.Add("SecuritySetting", "0");
+                    actionsInfo.Add("SecurityModeId", "0");
+                    actionsInfo.Add("Password", "888888");
+
+                }
                 LogicIfon.AddSecurityactions(actionsInfo);
+                this.RemoveFromParent();
                 var logicCommunalPage = new LogicCommunalPage();
                 UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                 UserView.HomePage.Instance.PageIndex += 1;
                 logicCommunalPage.Show(() => { });
 
+
             };
-            leavehomeRow.MouseUpEventHandler += leavehomeclick;
-            leavehomeBtn.MouseUpEventHandler += leavehomeclick;
-            leavehomeSelected.MouseUpEventHandler += leavehomeclick;
-
-            if (strvalue == "1")
-            {
-                athomeSelected.Visible = true;
-                leavehomeSelected.Visible = false;
-            }
-            else if (strvalue == "2")
-            {
-                leavehomeSelected.Visible = true;
-                athomeSelected.Visible = false;
-
-            }
         }
+
+       
     }
 }

--
Gitblit v1.8.0