Exemple #1
0
        public void RemoveRelationShips(SubroutesInRoute subrouteinroute)
        {
            //route
            subrouteinroute.Route.SubroutesInRoutes.Remove(subrouteinroute);

            //subroute
            subrouteinroute.Subroute.SubroutesInRoutes.Remove(subrouteinroute);
        }
Exemple #2
0
 public void DeleteSubrouteInRoute(SubroutesInRoute subrouteinroute)
 {
     using (ConfigurationToolContext context = new ConfigurationToolContext())
     {
         var repository = new SubroutesInRouteRepository(context);
         repository.Delete(subrouteinroute);
         context.SaveChanges();
     }
 }
Exemple #3
0
        public void AddRelationShips(SubroutesInRoute subrouteInRoute, Subroute subroute, Route route)
        {
            subrouteInRoute.Subroute = subroute;
            subrouteInRoute.Route    = route;

            //route
            OrderObservableList.AddSorted(subrouteInRoute.Route.SubroutesInRoutes, subrouteInRoute);

            //subroute
            OrderObservableList.AddSorted(subrouteInRoute.Subroute.SubroutesInRoutes, subrouteInRoute);
        }
Exemple #4
0
        private void RemoveSubrouteFromRoute(SubroutesInRoute subrouteInRoute)
        {
            //remove from database
            SubrouteInRouteService service = new SubrouteInRouteService();

            service.DeleteSubrouteInRoute(subrouteInRoute);

            //remove from overall structure
            service.RemoveRelationShips(subrouteInRoute);

            ArrangeSequences();
        }
Exemple #5
0
        public SubroutesInRoute GenerateNewSubrouteInRoute(Subroute subroute, Route route, int sequencenumber)
        {
            SubroutesInRoute subrouteInRoute = new SubroutesInRoute()
            {
                sri_ProcCellId = route.ProcesCell.prc_ProcescellId,
                sri_RouteId    = route.rot_RouteId,
                sri_SeqNr      = sequencenumber,
                sri_SubRouteId = subroute.sur_SubRouteId
            };

            return(subrouteInRoute);
        }
Exemple #6
0
        private void AddSubroutesToSequence(Sequence sequence)
        {
            if (SelectedSubroutes.Count == 0)
            {
                _View.ShowMessage("Select one or multiple routes to add");
                return;
            }


            foreach (Subroute S in SelectedSubroutes)
            {
                //Add to database
                SubrouteInRouteService service         = new SubrouteInRouteService();
                SubroutesInRoute       subrouteInRoute = service.GenerateNewSubrouteInRoute(S, Route, sequence.Id);
                service.CreateSubrouteInRoute(subrouteInRoute);

                //add to overall structure
                service.AddRelationShips(subrouteInRoute, S, Route);
            }

            ArrangeSequences();
        }
 private void OpenSetBinsWindow(SubroutesInRoute subrouteInRoute)
 {
     _MainView.OpenSetBinsWindow(subrouteInRoute.Subroute);
 }