wei
2020-12-23 271faaf6664166dc368639b9f2e577f63f901be5
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -503,7 +503,7 @@
                                UserInfo.Current.SaveUserInfo();
                                Action action = () =>
                                {
                                    MainPage.GoUserPage();
                                    MainPage.GoUserPage(true);
                                };
                                new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action);
                            });
@@ -553,11 +553,11 @@
        /// <summary>
        /// 获取刷新当前住宅的网关列表
        /// </summary>
        public void GetHomeGatewayList()
        public string GetHomeGatewayList()
        {
            try
            {
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return;
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return "";
                var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.RegionID;
                var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId });
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson);
@@ -571,7 +571,7 @@
                            if (mHomeGatewayRes.Count > 0)
                            {
                                DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
                                if(mHomeGatewayRes[0].gatewayStatus)
                                if (mHomeGatewayRes[0].gatewayStatus)
                                {
                                    //DriverLayer.Control.Ins.IsRemote = true;
                                    DriverLayer.Control.Ins.GatewayOnline = true;
@@ -581,7 +581,7 @@
                                    DriverLayer.Control.Ins.GatewayOnline = false;
                                }
                                DB_ResidenceData.Instance.SaveResidenceData();
                                return;
                                return revertObj.Code;
                            }
                        }
                        //其余情况清空网关信息
@@ -593,10 +593,11 @@
                {
                    //提示错误
                }
                return revertObj.Code;
            }
            catch
            {
                return "";
            }
        }
        /// <summary>
@@ -1823,7 +1824,7 @@
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", function.deviceId);//DriverLayer.Control.Ins.GatewayId);
            d.Add("deviceId", function.deviceId);
            d.Add("name", function.name);
            d.Add("collect", function.collect);
            d.Add("roomIds", function.roomIds);
@@ -1832,6 +1833,22 @@
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
        }
        /// <summary>
        /// 更新设备绑定房间信息
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew UpdataDevcieBindRoomInfo(Function function)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", function.deviceId);
            d.Add("roomIds", function.roomIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
        }
        /// <summary>
        /// 设备绑定房间
        /// </summary>
        public ResponsePackNew BindDeviceToRoom(List<string> deviceIds,List<string> roomIds)