private async void btnDelete_Click(object sender, RoutedEventArgs e) { if (lsvUser.SelectedItem == null) { await InfoDialog.ShowOK("请选择需要删除指纹信息的人员。"); return; } if ((lsvUser.SelectedItem as custPerDisplayItem).FID != "") { if (await InfoDialog.ShowYesNo("确定删除指定人员的指纹信息吗?") == ContentDialogResult.Secondary) { return; } await GPIOControl.PowerOnFingerprintPower( ); try { // Delete from fingerprint device fgRemoveFingerprint cmd = new fgRemoveFingerprint(Convert.ToUInt16((lsvUser.SelectedItem as custPerDisplayItem).FID.Trim( ))); CommonResult ret = await FingerprintDevice.Execute(cmd); // Update compare file await StorageControl.UpdateFIDByPID((lsvUser.SelectedItem as custPerDisplayItem).PID, string.Empty); await LoadFingprinterInfo( ); } catch (Exception ex) { throw new CommonResult(ResultCode.GN_SYS_ERROR, ex.Message); } finally { GPIOControl.PowerOffFingerprintPower( ); } } else { await InfoDialog.ShowOK("指定的人员没有记录指纹信息。"); } }
private void Dialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args) { GPIOControl.PowerOffFingerprintPower( ); }