xm
2020-04-29 07466c19110693e3e439a7d7c8ad0bc21d9b3287
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -728,7 +728,6 @@
            //刷新个人中心的内存及线程
            await UserCenterLogic.InitUserCenterMenmoryAndThread(false);
            HdlRoomLogic.Current.InitAllRoom();
            //删除住宅
            Common.House.DeleteHouseByHouseId(deleteId);
@@ -753,45 +752,49 @@
        /// <param name="addresName">位置名称</param>
        private async void SaveResidenceAdrress(NormalViewControl btnLocation, double latitude, double longitude, string addresName)
        {
            //开启进度条
            this.ShowProgressBar();
            var Pra = new EditorResidencePra();
            Pra.HomeId = Common.Config.Instance.Home.Id;
            Pra.Name = Common.Config.Instance.Home.Name;
            Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
            Pra.Latitude = latitude;
            Pra.Longitude = longitude;
            //编辑住宅
            bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", true, Pra);
            if (flage == false)
            //如果不是虚拟住宅,才更新云端
            if (Common.Config.Instance.Home.IsVirtually == false)
            {
                //关闭进度条
                this.CloseProgressBar();
                return;
            }
            //设置全部网关的住宅地址
            var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway();
            foreach (var gateway in listGateway)
            {
                ZigBee.Device.ZbGateway realWay = null;
                if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, gateway) == false)
                {
                    //错误:网关对象丢失
                    continue;
                }
                var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude, ShowErrorMode.YES);
                if (result == false)
                //开启进度条
                this.ShowProgressBar();
                var Pra = new EditorResidencePra();
                Pra.HomeId = Common.Config.Instance.Home.Id;
                Pra.Name = Common.Config.Instance.Home.Name;
                Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                Pra.Latitude = latitude;
                Pra.Longitude = longitude;
                //编辑住宅
                bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", true, Pra);
                if (flage == false)
                {
                    //关闭进度条
                    this.CloseProgressBar();
                    return;
                }
                //设置全部网关的住宅地址
                var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway();
                foreach (var gateway in listGateway)
                {
                    ZigBee.Device.ZbGateway realWay = null;
                    if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, gateway) == false)
                    {
                        //错误:网关对象丢失
                        continue;
                    }
                    var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude, ShowErrorMode.YES);
                    if (result == false)
                    {
                        //关闭进度条
                        this.CloseProgressBar();
                        return;
                    }
                }
                //关闭进度条
                this.CloseProgressBar();
            }
            //关闭进度条
            this.CloseProgressBar();
            //保存缓存
            Common.Config.Instance.Home.Longitude = longitude;
            Common.Config.Instance.Home.Latitude = latitude;