private void LoginSystem(object sender, RoutedEventArgs e) { int num = 0; bool ok = true; try { num = Convert.ToInt32(Number.Text.ToString()); } catch (Exception) { ok = false; MessageBox.Show("Неверный номер комнаты!"); } if (ok && (Stock.MainWindowDC as Hotel).FindHost(Name.Text.ToString(), num)) { ApartInfo Apr = new ApartInfo(0); Apr.Show(); Close(); } else if (ok) { MessageBox.Show("Такого пользователя не существует!"); } }
private void InfoAboutApartment(object sender, RoutedEventArgs e) { if ((Stock.MainWindowDC as Hotel).IsApartament != null) { ApartInfo Apr = new ApartInfo(1); Apr.Show(); } }