| | |
| | | btnOk.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //添加成员
|
| | | this.DoAddMember();
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | this.DoAddMember();
|
| | | });
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 添加成员
|
| | | /// </summary>
|
| | | private async void DoAddMember()
|
| | | private void DoAddMember()
|
| | | {
|
| | | //开启进度条
|
| | | this.ShowProgressBar();
|
| | |
| | | var pra = new BindSubAccountPra();
|
| | | pra.SubAccount = memberResult.Account;
|
| | |
|
| | | bool result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/BindSubAccount", false, pra);
|
| | | bool result = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/BindSubAccount", false, pra);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | |
|
| | | //获取这个成员的SubDistributedMark
|
| | | var pra2 = new MemberListInfoPra();
|
| | | string resultValue = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra2);
|
| | | string resultValue = UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra2);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | if (resultValue == null)
|
| | | if (string.IsNullOrEmpty(resultValue) == true)
|
| | | {
|
| | | //出现未知错误,数据丢失
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uUnKnownError);
|
| | |
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | return;
|
| | | }
|
| | | //添加缓存
|
| | | UserCenterResourse.ListMemberInfo.Add(memberInfoRes);
|
| | | UserCenterLogic.SaveLocalMemberListInfo();
|
| | |
|
| | | string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, memberInfoRes.DistributedMark + ".png");
|
| | | if (memberResult.HeadImage != null)
|
| | |
| | | Shared.IO.FileUtils.WriteFileByBytes(iconPath, memberResult.HeadImage);
|
| | | }
|
| | |
|
| | | //成员添加成功
|
| | | var form = new AddMemberSuccessForm();
|
| | | form.AddForm(memberInfoRes, memberInfoRes.DistributedMark);
|
| | | form.FormCloseEvent += (() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | this.CloseForm();
|
| | | //关闭手动输入成员ID的画面
|
| | | this.CloseFormByFormName("AddMemberByIdForm");
|
| | | //添加成员
|
| | | this.LoadFormMethodByName("MemberListForm", "AddRowLayoutByOtherForm", memberInfoRes);
|
| | | //成员添加成功
|
| | | var form = new AddMemberSuccessForm();
|
| | | form.AddForm(memberInfoRes, memberInfoRes.DistributedMark);
|
| | | form.FormCloseEvent += (() =>
|
| | | {
|
| | | this.CloseForm();
|
| | | //关闭手动输入成员ID的画面
|
| | | this.CloseFormByFormName("AddMemberByIdForm");
|
| | | //添加成员
|
| | | this.LoadFormMethodByName("MemberListForm", "AddRowLayoutByOtherForm", memberInfoRes);
|
| | | });
|
| | | });
|
| | | }
|
| | |
|