public GetTripRequest WithMeansOfTransport(MeansOfTransport meansOfTransport) { Guard.Argument(meansOfTransport, nameof(meansOfTransport)).Defined(); MeansOfTransport = meansOfTransport; return(this); }
public FavStopDialog(MeansOfTransport meanOfTrans) { meameanOfTransport = meanOfTrans; InitializeComponent(); Task.Run(async() => { TestItems = await NewFavoriteStop.GetStaionNames(meameanOfTransport); }).Wait(); StopName.ItemsSource = TestItems; }
public static string GetStringFromMeansOfTransport(MeansOfTransport input) { var returnString = ""; switch (input) { case MeansOfTransport.Metro: returnString = Metro; break; case MeansOfTransport.Tram: returnString = Tram; break; case MeansOfTransport.TramWlb: returnString = TramWlb; break; case MeansOfTransport.Bus: returnString = Bus; break; case MeansOfTransport.NightBus: returnString = NightBus; break; } return(returnString); }
public CarrierBlock(IList<MergeField> mergeFields, MeansOfTransport meansOfTransport, CarrierCollection carrierCollection) { CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName); data = CarrierViewModel.CreateCarrierViewModelsForNotification(meansOfTransport, carrierCollection, new MeansOfTransportFormatter()); AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName); }
public CarrierBlock(IList <MergeField> mergeFields, MeansOfTransport meansOfTransport, CarrierCollection carrierCollection) { CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName); data = CarrierViewModel.CreateCarrierViewModelsForNotification(meansOfTransport, carrierCollection, new MeansOfTransportFormatter()); AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName); }
public void NotificationAddMeans_StoresMeans() { var notification = CreateNotificationApplication(); var means = new MeansOfTransport[] { MeansOfTransport.Road, MeansOfTransport.Sea, MeansOfTransport.Road }; notification.SetMeansOfTransport(means); Assert.Equal(means, notification.MeansOfTransport); }
public static async Task <List <string> > GetStaionNames(MeansOfTransport type) { if (stations == null) { stations = await Stations.GetAllStationsAsync(); } var mot = type; var listOfStations = (from v in stations from p in v.Platforms where p.MeansOfTransport == type select v.Name).Distinct().ToList(); return(listOfStations); }
public async Task <Guid> HandleAsync(SetMeansOfTransportForNotification message) { var meansOfTransport = await repository.GetByNotificationId(message.Id); if (meansOfTransport == null) { meansOfTransport = new MeansOfTransport(message.Id); repository.Add(meansOfTransport); } meansOfTransport.SetRoute(message.MeansOfTransport); await context.SaveChangesAsync(); return(meansOfTransport.NotificationId); }
public static IList<CarrierViewModel> CreateCarrierViewModelsForNotification( MeansOfTransport meansOfTransport, CarrierCollection carrierCollection, MeansOfTransportFormatter meansOfTransportFormatter) { if (meansOfTransport == null || carrierCollection == null || carrierCollection.Carriers == null || !carrierCollection.Carriers.Any()) { return new CarrierViewModel[0]; } var meansOfTransportDisplay = meansOfTransportFormatter.MeansOfTransportAsString(meansOfTransport.Route); return carrierCollection.Carriers.Select(c => new CarrierViewModel(c, meansOfTransportDisplay)) .ToArray(); }
public static IList <CarrierViewModel> CreateCarrierViewModelsForNotification( MeansOfTransport meansOfTransport, CarrierCollection carrierCollection, MeansOfTransportFormatter meansOfTransportFormatter) { if (meansOfTransport == null || carrierCollection == null || carrierCollection.Carriers == null || !carrierCollection.Carriers.Any()) { return(new CarrierViewModel[0]); } var meansOfTransportDisplay = meansOfTransportFormatter.MeansOfTransportAsString(meansOfTransport.Route); return(carrierCollection.Carriers.Select(c => new CarrierViewModel(c, meansOfTransportDisplay)) .ToArray()); }
public CarrierViewModelTests() { firstCarrier = new TestableCarrier { Address = TestableAddress.AddlestoneAddress, Business = TestableBusiness.WasteSolutions, Contact = TestableContact.BillyKnuckles }; secondCarrier = new TestableCarrier { Address = TestableAddress.WitneyAddress, Business = TestableBusiness.CSharpGarbageCollector, Contact = TestableContact.MikeMerry }; var notificationId = new Guid("1EB00552-0589-4AB2-804E-16CF9B8286BA"); carrierCollection = new TestableCarrierCollection(notificationId); meansOfTransport = new MeansOfTransport(notificationId); }
public void Add(MeansOfTransport meansOfTransport) { context.MeansOfTransports.Add(meansOfTransport); }
public void removeMeansOfTransport(MeansOfTransport m) { meansOfTransportList.Remove(m); }
public void addMeansOfTransport(MeansOfTransport m) { meansOfTransportList.Add(m); }
public static async Task <List <string> > GetLinesFromStation(string station, MeansOfTransport type) { if (stations == null) { stations = await Stations.GetAllStationsAsync(); } var lines = (from v in stations where v.Name.Equals(station) from p in v.Platforms where p.MeansOfTransport == type group p by p.Name into linesList select linesList.Key).ToList(); return(lines); }