protected void btnRegister_Click(object sender, EventArgs e) { if (connectDevice.fingerPrintTemplate == string.Empty) { lblResult.ForeColor = System.Drawing.Color.Red; lblResult.Text = "Number of Times Scanned: " + connectDevice.RegisterCount + "/3"; lblResult.Visible = true; } else { if (IsValid) { if (UpdateUserDAO.UpdateUserF(txbUser.Text.ToUpper(), connectDevice.fingerPrintTemplate) == null) { lblResult.ForeColor = System.Drawing.Color.Red; lblResult.Text = "UserName was not found"; lblResult.Visible = true; if (connectDevice.DeviceConnected == 1) { connectDevice.bIsTimeToDie = true; connectDevice.DisconnectDevice(); connectDevice.connect(); captureThread.IsBackground = true; connectDevice.bIsTimeToDie = false; captureThread.Start(); } } else { lblResult.ForeColor = System.Drawing.Color.Green; lblResult.Text = "Finger Print Registered!"; lblResult.Visible = true; if (connectDevice.DeviceConnected == 1) { connectDevice.bIsTimeToDie = true; connectDevice.DisconnectDevice(); connectDevice.connect(); captureThread.IsBackground = true; connectDevice.bIsTimeToDie = false; captureThread.Start(); } } } } }
protected void btnUpdate_Click(object sender, EventArgs e) { if (IsValid) { if (txbPassword.Text != "" & txbUsername.Text != "") { string status = UpdateUserDAO.UpdateUser(txbUsername.Text.ToUpper(), txbPassword.Text); if (status == null) { lblInvalid.ForeColor = System.Drawing.Color.Red; lblInvalid.Text = "No UserName found"; lblInvalid.Visible = true; } else { lblInvalid.Text = "Password Updated for user"; lblInvalid.Visible = true; lblInvalid.ForeColor = System.Drawing.Color.Green; } } } }