public static AdminTransport GetInstance() { if (State == null) { State = new AdminTransport(); } State.TransportWorkArea.Content = AdminTransportTable.GetInstance(); return(State); }
private void TransportDelete_Click(object sender, RoutedEventArgs e) { try { if (Id.Text == "") { throw new Exception("Укажите ID транспорта, который хотите удалить"); } string delete_id = Convert.ToString(Id.Text); Truck truck = controller.GetTrucks().Where(t => t.Id.Equals(delete_id)).FirstOrDefault(); controller.RemoveTruck(truck); TransportWorkArea.Content = AdminTransportTable.GetInstance(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void TransportViewerr_Click(object sender, RoutedEventArgs e) { TransportWorkArea.Content = AdminTransportTable.GetInstance(); }
public AdminTransport() { InitializeComponent(); controller = new RepositoryController(); TransportWorkArea.Content = AdminTransportTable.GetInstance(); }