public void RemoveRelationShips(SubroutesInRoute subrouteinroute) { //route subrouteinroute.Route.SubroutesInRoutes.Remove(subrouteinroute); //subroute subrouteinroute.Subroute.SubroutesInRoutes.Remove(subrouteinroute); }
public void DeleteSubrouteInRoute(SubroutesInRoute subrouteinroute) { using (ConfigurationToolContext context = new ConfigurationToolContext()) { var repository = new SubroutesInRouteRepository(context); repository.Delete(subrouteinroute); context.SaveChanges(); } }
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); }
private void RemoveSubrouteFromRoute(SubroutesInRoute subrouteInRoute) { //remove from database SubrouteInRouteService service = new SubrouteInRouteService(); service.DeleteSubrouteInRoute(subrouteInRoute); //remove from overall structure service.RemoveRelationShips(subrouteInRoute); ArrangeSequences(); }
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); }
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); }