using System; using HDL_ON.DAL.Server; using Shared; namespace HDL_ON.UI { public partial class AddMemberScanPage { void LoadEventList() { LoadEvent_BindMember(); Action action = (str) => { Application.RunOnMainThread(() => { etMemberAccount.Text = str; }); }; OpenScen(action); } void LoadEvent_BindMember() { btnAddMember.MouseUpEventHandler = (sender, e) => { var memberAccount = etMemberAccount.Text.Trim(); if(string.IsNullOrEmpty(memberAccount)) { TipDivMsg(Language.StringByID(StringId.PlsEntryAccount)); return; } BindMember(memberAccount); }; } /// /// 绑定账号 /// /// void BindMember(string memberAccount) { var waitPage = new Loading(); bodyView.AddChidren(waitPage); waitPage.Start(Language.StringByID(StringId.PleaseWait)); new System.Threading.Thread(() => { try { var result = new HttpServerRequest().BindResidenceMemberAccount(memberAccount, memberAccount); if (result.Code == StateCode.SUCCESS) { Application.RunOnMainThread(() => { backAction?.Invoke(); this.RemoveFromParent(); var page = new OperationResultDisPalyPage(); page.Show(); page.LoadPage(true, Language.StringByID(StringId.AddMember), Language.StringByID(StringId.WelcomeNewMmember), ""); }); } else { IMessageCommon.Current.ShowErrorInfoAlter(result.Code); } } catch { } finally { Application.RunOnMainThread(() => { if (waitPage != null) { waitPage.RemoveFromParent(); waitPage = null; } }); } }) { IsBackground = true }.Start(); } void OpenScen(Action action) { btnScan.MouseUpEventHandler = (sender, e) => { Scan.OpenScan((scanString) => { action(scanString); }); }; } } }