示例#1
0
        private void NumPad_Click(object sender, EventArgs e)
        {
            Button button = (Button)sender;

            if (_localID.Length < _adminID.MaxLength && button.Text != "CLEAR" && button.Text != "ENTER")
            {
                _localID     += button.Text;
                _adminID.Text = _localID;
                return;
            }
            if (button.Text == "CLEAR")
            {
                _localID      = "";
                _adminID.Text = _localID;
                return;
            }
            if (button.Text == "ENTER")
            {
                var idCheck = new IDCheckEventArgs()
                {
                    ID = _localID
                };
                CompareID?.Invoke(null, idCheck);
                if (idCheck.Valid)
                {
                    _adminContinue.LoggedIn = true;
                    Close();
                }
                else
                {
                    _localID      = "";
                    _adminID.Text = _localID;
                }
                return;
            }
        }
 private void Admin_CompareID(object sender, IDCheckEventArgs e)
 {
     e.Valid = _adminList.Contains(e.ID);
     GiveAdminAccess(e.Valid);
 }