コード例 #1
0
        public List <List <TOURNEE_ETAPE> > GetEtapes(LIGNE ligne, ARRET arretDepart, ARRET arretArrivee)
        {
            using (TRANSPORT_PUBLICContext context = new TRANSPORT_PUBLICContext())
            {
                List <List <TOURNEE_ETAPE> > returnedValue = new List <List <TOURNEE_ETAPE> >();
                var tourneeEtapes = context.TOURNEE_ETAPEs.Where(te => te.PARCOURS_ETAPE.PARCOURS.LIGNE.ID == ligne.ID &&
                                                                 te.PARCOURS_ETAPE.ARRET.ID == arretDepart.ID);

                foreach (var tourneeEtape in tourneeEtapes.OrderBy(p => p.HEURE_REEL))
                {
                    List <TOURNEE_ETAPE> listTourneeEtapes = new List <TOURNEE_ETAPE>();
                    var tourneeEtapeFin = context.TOURNEE_ETAPEs.SingleOrDefault(te => te.ID_TOURNEE == tourneeEtape.ID_TOURNEE && te.PARCOURS_ETAPE.ARRET.ID == arretArrivee.ID);

                    if (tourneeEtapeFin != null)
                    {
                        listTourneeEtapes.Add(tourneeEtape);
                        listTourneeEtapes.AddRange(context.TOURNEE_ETAPEs.Where(te => te.ID_TOURNEE == tourneeEtape.ID_TOURNEE &&
                                                                                te.PARCOURS_ETAPE.ORDRE > tourneeEtape.PARCOURS_ETAPE.ORDRE &&
                                                                                te.PARCOURS_ETAPE.ORDRE < tourneeEtapeFin.PARCOURS_ETAPE.ORDRE));
                        listTourneeEtapes.Add(tourneeEtapeFin);

                        returnedValue.Add(listTourneeEtapes);
                    }
                }
                return(returnedValue);
            }
        }
コード例 #2
0
 public RechercheOperation(TRIP_AT_LUXContext contextTrip, TRANSPORT_PUBLICContext contextTransport)
 {
     _contextTransport = contextTransport;
     _contextTrip      = contextTrip;
 }
コード例 #3
0
 public TransportPublicArretOperation(TRANSPORT_PUBLICContext context) : base(context)
 {
 }
コード例 #4
0
 public TransportPublicTourneeEtapeOperation(TRANSPORT_PUBLICContext context) : base(context)
 {
 }
コード例 #5
0
 public TransportPublicParcoursOperation(TRANSPORT_PUBLICContext context) : base(context)
 {
 }
コード例 #6
0
 public BaseOperationTransportPublic(TRANSPORT_PUBLICContext context)
 {
     _context = context;
 }