private void btnLock_Click(object sender, EventArgs e) { //locks register and clears any user entry if (btnLock.Text == "Lock") { LockForm(); txtInput.Clear(); TxtCashOut.Clear(); label12.Text = "Lock"; txtInput.Enabled = false; return; } //enables the form to be ulocked if (btnLock.Text == "Unlock") { groupBoxLock.Visible = false; groupBoxUnlock.Visible = true; groupBoxUnlock.BringToFront(); BtnLogOff.Visible = false; label12.Text = "Unlock"; TxtUnlock.Focus(); } }
private void BtnLogOff_Click(object sender, EventArgs e) { //allows the user to log out of their current session as long as there are is not a transaction in progress if (listViewGrocery.Items.Count < 1) { groupBoxUnlock.Visible = true; groupBoxUnlock.BringToFront(); groupBoxLock.Visible = false; //groupBoxPad.Enabled = true; label12.Text = "Log Off"; TxtUnlock.Focus(); txtInput.Enabled = false; } else { MessageBox.Show("Transaction in Progress!" + Environment.NewLine + "Unable to Log Out"); } }