Пример #1
0
 public void AddRouteMethod()
 {
     ViewModels.AddRouteViewModel addRouteViewModel = new AddRouteViewModel(new Models.Route());
     Views.AddRouteView           addRouteView      = new Views.AddRouteView(
         addRouteViewModel
         );
     addRouteView.Owner = CurrentWorkWindow;
     MakeLogEntry(8, null, null, "open AddRoute. Start adding route");
     if ((bool)addRouteView.ShowDialog())
     {
         Models.Route route_to_base = Models.Route.GetCopyOfRoute(addRouteViewModel.CurrentRoute);
         AddEntry <Models.Route>(route_to_base);
     }
     else
     {
         MakeLogEntry(8, null, null, "open AddRoute. Cancel adding route");
     }
 }
Пример #2
0
 public void EditRouteMethod(Models.Route SelectedItem)
 {
     if (SelectedItem == null)
     {
         return;
     }
     Models.Route route_to_view = Models.Route.GetCopyOfRoute(SelectedItem);
     ViewModels.AddRouteViewModel addRouteViewModel = new AddRouteViewModel(route_to_view);
     Views.AddRouteView           addRouteView      = new Views.AddRouteView(
         addRouteViewModel
         );
     addRouteView.Owner = CurrentWorkWindow;
     MakeLogEntry(8, null, null, "open AddRoute. Start editing route");
     if ((bool)addRouteView.ShowDialog())
     {
         Models.Route route_to_base = Models.Route.GetCopyOfRoute(addRouteViewModel.CurrentRoute);
         EditEntry <Models.Route>(route_to_base);
     }
     else
     {
         MakeLogEntry(8, null, null, "open AddRoute. Cancel editing route");
     }
 }