| | |
| | | }
|
| | | }
|
| | | var revertObj = JsonConvert.DeserializeObject<ResponsePack>(Encoding.UTF8.GetString(byteData));
|
| | | if (revertObj == null)
|
| | | {
|
| | | return "Error";
|
| | | }
|
| | | return revertObj.StateCode;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | if (revertObj == null || revertObj.ResponseData == null)
|
| | | {
|
| | | return string.Empty;
|
| | | return null;
|
| | | }
|
| | | return revertObj.ResponseData.ToString();
|
| | | }
|
| | |
| | | int index = UserCenterResourse.listActionFormId.IndexOf(UserCenterResourse.NowActionFormID) - 1;
|
| | | //初始值
|
| | | UserCenterResourse.NowActionFormID = string.Empty;
|
| | | var actionForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
|
| | |
|
| | | if (index >= 0)
|
| | | {
|
| | | var actionForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
|
| | | if (actionForm != null && actionForm is CommonFormBase)
|
| | | {
|
| | | string formId = ((CommonFormBase)actionForm).FormID;
|
| | |
| | | CallFormActionAgainEvent(form, index);
|
| | | }
|
| | | }
|
| | | else if (actionForm != null && actionForm is UserView.UserPage)
|
| | | {
|
| | | //这里它已经退到主页了
|
| | | if (UserCenterResourse.listActionFormId.Contains("UserMainForm") == true//个人中心
|
| | | || UserCenterResourse.listActionFormId.Contains("HomeMainPageForm") == true)//
|
| | | {
|
| | | //调用界面重新激活的函数
|
| | | CallFormActionAgainEvent(form, index);
|
| | | }
|
| | | }
|
| | | }
|
| | | else if (actionForm != null && actionForm is UserView.UserPage)
|
| | | {
|
| | | //这里它已经退到主页了
|
| | | var nowForm = UserView.UserPage.Instance.GetNowActionForm();
|
| | | nowForm?.FormActionAgainEvent();
|
| | | }
|
| | | }
|
| | | //移除ID
|
| | |
| | | double Longitude = Config.Instance.Home.Longitude;
|
| | | double Latitude = Config.Instance.Home.Latitude;
|
| | | //还原住宅对象
|
| | | Config.Instance.Home = House.GetHouseByHouseId(Config.Instance.Home.Id);
|
| | | Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(Config.Instance.Home.Id);
|
| | | Config.Instance.Home.IsOthreShare = isOthreShare;
|
| | | Config.Instance.Home.AccountType = accountType;
|
| | | Config.Instance.Home.MainUserDistributedMark = mainMark;
|
| | |
| | | //清空当前住宅id
|
| | | Config.Instance.HomeId = string.Empty;
|
| | | HdlGatewayLogic.Current.ClearAllRealGateway();
|
| | | try
|
| | |
|
| | | //断开远程Mqtt连接
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //断开远程Mqtt连接
|
| | | ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
|
| | | }
|
| | | catch { }
|
| | | await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
|
| | | }, ShowErrorMode.NO);
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | |
| | | if (Common.Config.Instance.HomeId != UserCenterResourse.AccountOption.OldHomeStringId
|
| | | || Common.Config.Instance.Account != UserCenterResourse.AccountOption.OldAccountId)
|
| | | {
|
| | | try
|
| | | //断开远程Mqtt连接
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //断开远程Mqtt连接
|
| | | await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
|
| | | }
|
| | | catch { }
|
| | | }, ShowErrorMode.NO);
|
| | |
|
| | | //清空所有成员缓存
|
| | | ClearAllMemberMemory();
|
| | |
| | | //初始化本地的网关信息
|
| | | HdlGatewayLogic.Current.ReFreshByLocal();
|
| | | //初始化本地的设备信息
|
| | | Common.LocalDevice.Current.ReFreshByLocal();
|
| | | LocalDevice.Current.ReFreshByLocal();
|
| | |
|
| | | //初始化房间(郭雪城那边不做处理,需要这里特殊执行一步)
|
| | | HdlRoomLogic.Current.RefreshAllRoomByLocation();
|
| | |
| | | #region ■ 文件保存和读取_____________________
|
| | |
|
| | | /// <summary>
|
| | | /// 文件保存,仅限当前住宅(整天忘记,所以建一个函数来玩玩)
|
| | | /// 文件保存(整天忘记,所以建一个函数来玩玩)
|
| | | /// </summary>
|
| | | /// <param name="fullName">全路径</param>
|
| | | /// <param name="obj">需要序列化的东西</param>
|
| | | public static void SaveFileContent(string fullName, object obj)
|
| | | {
|
| | | var data = JsonConvert.SerializeObject(obj);
|
| | | var byteData = Encoding.UTF8.GetBytes(data);
|
| | | SaveTexToFile(fullName, data);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 文件保存(整天忘记,所以建一个函数来玩玩)
|
| | | /// </summary>
|
| | | /// <param name="fullName">全路径</param>
|
| | | /// <param name="obj">需要序列化的东西</param>
|
| | | public static void SaveTexToFile(string fullName, string textValue)
|
| | | {
|
| | | var byteData = Encoding.UTF8.GetBytes(textValue);
|
| | | //写入内容
|
| | | System.IO.FileStream fileStream = null;
|
| | | try
|