| | |
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | {
|
| | | //删除子账号
|
| | | this.DeleteSubAccount();
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | this.DeleteSubAccount();
|
| | | });
|
| | | });
|
| | | };
|
| | | }
|
| | |
| | | }
|
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | btnSwitch.CanClick = false;
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | var pra = new
|
| | | {
|
| | |
| | | };
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ChangeSubAccountIsAllowRemoteCtrl", false, pra);
|
| | | var result = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ChangeSubAccountIsAllowRemoteCtrl", false, pra);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | |
| | |
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | btnSwitch.CanClick = true;
|
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected;
|
| | | });
|
| | | });
|
| | |
| | | /// <summary>
|
| | | /// 升级或者降级子账号
|
| | | /// </summary>
|
| | | public async void UpOrDownSubAccountLevel()
|
| | | public void UpOrDownSubAccountLevel()
|
| | | {
|
| | | //开启进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | var pra = new UpOrDownLevelPra();
|
| | | pra.DistributedMark = memberInfo.DistributedMark;
|
| | |
|
| | | bool result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpSubAccount", false, pra);
|
| | | if (result == false)
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | this.CloseProgressBar();
|
| | | //开启进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | //变更权限
|
| | | memberInfo.AccountType = memberInfo.AccountType == 1 ? 0 : 1;
|
| | | var pra = new UpOrDownLevelPra();
|
| | | pra.DistributedMark = memberInfo.DistributedMark;
|
| | |
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | if (this.Parent == null)
|
| | | bool result = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpSubAccount", false, pra);
|
| | | if (result == false)
|
| | | {
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | //变更权限图标
|
| | | if (memberInfo.AccountType == 1)
|
| | | {
|
| | | btnTopIcon.UnSelectedImagePath = "Item/HadAuthority.png";
|
| | | }
|
| | | else
|
| | | {
|
| | | btnTopIcon.UnSelectedImagePath = "Item/NotAuthority.png";
|
| | | }
|
| | | //变更权限文字
|
| | | btnAuthority.TextID = memberInfo.AccountType == 1 ? R.MyInternationalizationString.uMemberHadActionAuthority : R.MyInternationalizationString.uMember;
|
| | | this.CloseProgressBar();
|
| | |
|
| | | //打开显示成功的画面
|
| | | var form = new SubAccountLevelUpSuccessForm();
|
| | | form.AddForm(memberInfo);
|
| | | //变更权限
|
| | | memberInfo.AccountType = memberInfo.AccountType == 1 ? 0 : 1;
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | if (this.Parent == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //变更权限图标
|
| | | if (memberInfo.AccountType == 1)
|
| | | {
|
| | | btnTopIcon.UnSelectedImagePath = "Item/HadAuthority.png";
|
| | | }
|
| | | else
|
| | | {
|
| | | btnTopIcon.UnSelectedImagePath = "Item/NotAuthority.png";
|
| | | }
|
| | | //变更权限文字
|
| | | btnAuthority.TextID = memberInfo.AccountType == 1 ? R.MyInternationalizationString.uMemberHadActionAuthority : R.MyInternationalizationString.uMember;
|
| | |
|
| | | //打开显示成功的画面
|
| | | var form = new SubAccountLevelUpSuccessForm();
|
| | | form.AddForm(memberInfo);
|
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 删除子账号
|
| | | /// </summary>
|
| | | private async void DeleteSubAccount()
|
| | | private void DeleteSubAccount()
|
| | | {
|
| | | //开启进度条
|
| | | this.ShowProgressBar();
|
| | |
| | | var pra = new DeleteSubAccountPra();
|
| | | pra.SubAccount = memberInfo.SubAccountDistributedMark;
|
| | |
|
| | | bool result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/DeletedSubAccount", false, pra);
|
| | | bool result = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/DeletedSubAccount", false, pra);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | //移除缓存
|
| | | UserCenterResourse.ListMemberInfo.RemoveAll((obj) =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | if (obj.SubAccountDistributedMark == memberInfo.SubAccountDistributedMark)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | //从成员一览画面移除
|
| | | this.LoadFormMethodByName("MemberListForm", "DeleteRowByAccount", memberInfo.Account);
|
| | | //自身关闭
|
| | | this.CloseForm();
|
| | | });
|
| | | UserCenterLogic.SaveLocalMemberListInfo();
|
| | |
|
| | | //从成员一览画面移除
|
| | | this.LoadFormMethodByName("MemberListForm", "DeleteRowByAccount", memberInfo.Account);
|
| | | //自身关闭
|
| | | this.CloseForm();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// </summary>
|
| | | private void GetMemberIcon(ImageView btnUserIcon)
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | var pra = new AccountInfoPra();
|
| | | pra.Account = memberInfo.Account;
|
| | | var result = await UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string>() { "NotSetAgain" });
|
| | | var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra);
|
| | | if (result == null)
|
| | | {
|
| | | return;
|