private void lbEmployerName_Click(object sender, EventArgs e) { barcoder.EnableScanner = false; int _oldUserGammaId = GlobalArea.CurrentEmployee.GammaID; try { using (AuthorisationForm auth = new AuthorisationForm()) { if (auth.ShowDialog() == DialogResult.OK) { lbEmployerName.Text = (GlobalArea.CurrentEmployee != null) ? GlobalArea.CurrentEmployee.Name : ""; if (_oldUserGammaId != GlobalArea.CurrentEmployee.GammaID) { lastOrderItem = null; } } } } finally { barcoder.EnableScanner = true; RefreshStatusBar(); } }
public static bool Authorized() { bool ready = false; using (AuthorisationForm auth = new AuthorisationForm()) { if (auth.ShowDialog() == DialogResult.OK) { ready = true; } } return(ready); }