示例#1
0
        public static AdminTransport GetInstance()
        {
            if (State == null)
            {
                State = new AdminTransport();
            }

            State.TransportWorkArea.Content = AdminTransportTable.GetInstance();
            return(State);
        }
示例#2
0
        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);
            }
        }
示例#3
0
 private void TransportViewerr_Click(object sender, RoutedEventArgs e)
 {
     TransportWorkArea.Content = AdminTransportTable.GetInstance();
 }
示例#4
0
 public AdminTransport()
 {
     InitializeComponent();
     controller = new RepositoryController();
     TransportWorkArea.Content = AdminTransportTable.GetInstance();
 }