private void btnEnroll_Click(object sender, EventArgs e) { if (!ExtractTemplate(m_Template1, out m_Template1Size)) { return; } DrawCapturedImage(m_Scanner); UserInfoForm dlg = new UserInfoForm(false); UFD_STATUS ufd_res; tbxMessage.AppendText("Input user data\r\n"); if (dlg.ShowDialog(this) != DialogResult.OK) { tbxMessage.AppendText("User data input is cancelled by user\r\n"); return; } ufd_res = m_Database.AddData(dlg.UserID, dlg.FingerIndex, m_Template1, m_Template1Size, null, 0, dlg.Memo); if (ufd_res != UFD_STATUS.OK) { UFDatabase.GetErrorString(ufd_res, out m_strError); tbxMessage.AppendText("UFDatabase AddData: " + m_strError + "\r\n"); } else { cbScanTemplateType.Enabled = false; } UpdateDatabaseList(); }
private void btnSelectionUpdateUserInfo_Click(object sender, EventArgs e) { UserInfoForm dlg = new UserInfoForm(true); UFD_STATUS ufd_res; int Serial; if (lvDatabaseList.SelectedIndices.Count == 0) { tbxMessage.AppendText("Select data\r\n"); return; } else { Serial = Convert.ToInt32(lvDatabaseList.SelectedItems[0].SubItems[DATABASE_COL_SERIAL].Text); dlg.UserID = lvDatabaseList.SelectedItems[0].SubItems[DATABASE_COL_USERID].Text; dlg.FingerIndex = Convert.ToInt32(lvDatabaseList.SelectedItems[0].SubItems[DATABASE_COL_FINGERINDEX].Text); dlg.Memo = lvDatabaseList.SelectedItems[0].SubItems[DATABASE_COL_MEMO].Text; } tbxMessage.AppendText("Update user data\r\n"); tbxMessage.AppendText("UserID and FingerIndex will not be updated\r\n"); if (dlg.ShowDialog(this) != DialogResult.OK) { tbxMessage.AppendText("User data input is cancelled by user\r\n"); return; } ufd_res = m_Database.UpdateDataBySerial(Serial, null, 0, null, 0, dlg.Memo); if (ufd_res == UFD_STATUS.OK) { tbxMessage.AppendText("UFD_UpdateDataBySerial: OK\r\n"); UpdateDatabaseList(); } else { UFDatabase.GetErrorString(ufd_res, out m_strError); tbxMessage.AppendText("UFDatabase UpdateDataBySerial: " + m_strError + "\r\n"); } }