private void Window_Closed(object sender, EventArgs e) { Zakazchik zakazchik = new Zakazchik(); zakazchik.Show(); this.Hide(); }
private void Button_Click(object sender, RoutedEventArgs e) { try { string role = db.Пользователи.Where(x => x.Логин == Login.Text && x.Пароль == Password.Password).First().оль; switch (role) { case "client": Zakazchik zakazchik = new Zakazchik(); zakazchik.Show(); this.Hide(); break; case "manager": Manager manager = new Manager(); manager.Show(); this.Hide(); break; case "storekeeper": storekeeper storekeeper = new storekeeper(); storekeeper.Show(); this.Hide(); break; case "direktor": Director director = new Director(); director.Show(); this.Hide(); break; default: MessageBox.Show("Непредвиденная ошибка!"); break; } } catch (Exception ex) { MessageBox.Show("В доступе отказано!"); } }