| | |
| | | Function device; |
| | | VideoDoorlockUser doorlockUser; |
| | | public Action delCallBackAction; |
| | | |
| | | public Action<string> updataUserNameAction; |
| | | Loading waitPage; |
| | | |
| | | |
| | | public VideoDoorlockUserManagerPage(Function function,VideoDoorlockUser user) |
| | | { |
| | |
| | | doorlockUser = user; |
| | | BackgroundColor = CSS_Color.BackgroundColor; |
| | | waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Hide(); |
| | | |
| | | } |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | base.RemoveFromParent(); |
| | | bodyView = null; |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.AddChidren(waitPage); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.UserManagement)).LoadTopView(); |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | |
| | | { |
| | | return; |
| | | } |
| | | if (System.Text.Encoding.Default.GetBytes(str).Length > 20) |
| | | if (System.Text.Encoding.Unicode.GetBytes(str).Length > 20) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | var pack = ApiUtlis.Ins.HttpRequest.EditDoorlockUserName(device.deviceId, doorlockUser.extUserId, str); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnUserName.Text = str; |
| | | updataUserNameAction?.Invoke(str); |
| | | }); |
| | | } |
| | | else |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | var pa = new PublicAssmebly(); |
| | | pa.entryMaxLength = 30; |
| | | pa.entryMaxLength = 20; |
| | | pa.LoadDialog_EditParater(StringId.ChangeName, "", callBack, StringId.UesrNameCannotBeEmpty, 0, new List<string>()); |
| | | }; |
| | | btnUserName.MouseUpEventHandler = eventHandler; |
| | |
| | | fingerprintView.AddChidren(btnClearFingerprints); |
| | | btnClearFingerprints.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUserFingerPassword(device.deviceId, doorlockUser.lockUserIndex); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | digitalPasswordView.AddChidren(btnClearDigitalPassword); |
| | | btnClearDigitalPassword.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUserNumberPassword(device.deviceId, doorlockUser.lockUserIndex); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | }; |
| | | nfcView.AddChidren(btnClearNfc); |
| | | btnClearNfc.MouseUpEventHandler = (sender, e) => { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUserCardPassword(device.deviceId, doorlockUser.lockUserIndex); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | }; |
| | | faceView.AddChidren(btnClearFace); |
| | | btnClearFace.MouseUpEventHandler = (sender, e) => { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUserFacePassword(device.deviceId, doorlockUser.lockUserIndex); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | { |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteDoorlockUserTip, () => |
| | | { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | var pack = ApiUtlis.Ins.HttpRequest.DeleteDoorlockUser(device.deviceId, doorlockUser.lockUserIndex); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(pack.message)) { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | //失败提示 |
| | | var tip = new Tip() |
| | | { |