Employee ShowLoginForm() { Employee employee = null; Form7UserLogin userLogin = new Form7UserLogin(_userService, e => employee = e); userLogin.ShowDialog(); return(employee); }
private void авторизацияToolStripMenuItem_Click(object sender, EventArgs e) { Form7UserLogin f7 = new Form7UserLogin(_userService, em => GlobalSettings.LoginUser = em); if (f7.ShowDialog() == DialogResult.OK) { this.toolStripStatusLabel1.ForeColor = System.Drawing.Color.Black; toolStripStatusLabel1.Text = "Вход выполнен: " + GlobalSettings.LoginUser.ShortName; BtnCreateItem.Enabled = true; // contextMenuStrip1.Enabled = true; contextMenuStrip1.Items[3].Enabled = true; contextMenuStrip1.Items[4].Enabled = true; добавитьОрганизациюToolStripMenuItem.Enabled = true; выданныеПланшетыToolStripMenuItem.Enabled = true; переименоватьОрганизациюToolStripMenuItem.Enabled = true; сотрудникиИПодписиToolStripMenuItem.Enabled = true; редакторШаблоновToolStripMenuItem.Enabled = true; } }