public void fill() { AdminPanel ap = (AdminPanel)App.Current.MainWindow; var b_old = (Bus)ap.BusListView.SelectedItem; regNUmberTextBlock.Text = b_old.RegNumber; ModelTextBlock.Text = b_old.Model; CapacityTextBlock.Text = (b_old.Capacity).ToString(); }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { AdminPanel ap = (AdminPanel)App.Current.MainWindow; if (ap.BusListView.SelectedItems.Count > 0) { var b = (Bus)ap.BusListView.SelectedItem; dl.DeleteBus(b.Id); } }
private void OkButton_Click(object sender, RoutedEventArgs e) { AdminPanel ap = (AdminPanel)App.Current.MainWindow; var b = (Bus)ap.BusListView.SelectedItem; b.RegNumber = RegNumberTextBox.Text; b.Model = ModelTextBox.Text; b.Capacity = Convert.ToInt16(CapacityTextBox.Text); dl.SaveBus(b); this.Close(); }
private void LoginButton_Click(object sender, RoutedEventArgs e) { if (LoginTextBox.Text == adminlogin && PasswordTextBox.Password.ToString() == adminpassword) { Admin.AdminPanel ap = new AdminPanel(); ap.Show(); this.Close(); } else { MessageBox.Show("Login or password isn't correct!\nTry again!", "Error"); } }