From b079d370b3c23751a5d200dc2d25f6c80977b4d4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 11 三月 2022 15:03:50 +0800
Subject: [PATCH] 代码同步

---
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 8b19f2a..0bbd7a4 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -468,6 +468,16 @@
         {
             btnSwitch.MouseUpEventHandler = (sender, e) =>
             {
+                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 btnSwitch.IsSelected = !btnSwitch.IsSelected;
                 new System.Threading.Thread(() =>
                 {
@@ -521,6 +531,16 @@
         {
             btnSwitch.MouseUpEventHandler = (sender, e) =>
             {
+                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 if (DB_ResidenceData.Instance.GatewayType == 1)
                 {
                     btnSwitch.IsSelected = !btnSwitch.IsSelected;
@@ -555,6 +575,16 @@
         {
             btnClose.MouseUpEventHandler = (sender, e) =>
             {
+                if (!curtain.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 btnClose.IsSelected = true;
                 curtain.trait_on_off.curValue = "off";
                 curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
@@ -565,6 +595,16 @@
 
             btnOpen.MouseUpEventHandler = (sender, e) =>
             {
+                if (!curtain.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 btnOpen.IsSelected = true;
                 curtain.trait_on_off.curValue = "on";
                 curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
@@ -585,6 +625,16 @@
             };
             btnUp.MouseUpEventHandler = (sender, e) =>
             {
+                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 new System.Threading.Thread(() =>
                 {
                     System.Threading.Thread.Sleep(2000);
@@ -606,6 +656,16 @@
             };
             btnDown.MouseUpEventHandler = (sender, e) =>
             {
+                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 new System.Threading.Thread(() =>
                 {
                     System.Threading.Thread.Sleep(2000);

--
Gitblit v1.8.0