| | |
| | | UserInfo.Current.SaveUserInfo(); |
| | | Action action = () => |
| | | { |
| | | MainPage.GoUserPage(); |
| | | MainPage.GoUserPage(true); |
| | | }; |
| | | new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action); |
| | | }); |
| | |
| | | /// <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); |
| | |
| | | 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; |
| | |
| | | DriverLayer.Control.Ins.GatewayOnline = false; |
| | | } |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | return; |
| | | return revertObj.Code; |
| | | } |
| | | } |
| | | //其余情况清空网关信息 |
| | |
| | | { |
| | | //提示错误 |
| | | } |
| | | return revertObj.Code; |
| | | } |
| | | catch |
| | | { |
| | | |
| | | return ""; |
| | | } |
| | | } |
| | | /// <summary> |