public DashboardController(IGroupService groupService,
                            IStopService stopService, TenantContext tenantContext)
 {
     this.groupService  = groupService;
     this.stopService   = stopService;
     this.tenantContext = tenantContext;
 }
コード例 #2
0
 public GenerateCpraReport(IStopCosmosDbService stopCosmosDbService, IStopService stopService)
 {
     _storageConnectionString    = Environment.GetEnvironmentVariable("RipaStorage");
     _storageContainerNamePrefix = "cpra";
     _blobContainerClient        = GetBlobContainerClient();
     _stopCosmosDbService        = stopCosmosDbService;
     _stopService = stopService;
 }
 public TenantSettingsController(IUserService userService,
                                 IStopService stopService, ITenantService tenantService, TenantContext tenantContext)
 {
     this.stopService   = stopService;
     this.tenantService = tenantService;
     this.userService   = userService;
     this.tenantContext = tenantContext;
 }
コード例 #4
0
 public GroupsController(IGroupService groupService, IUserService userService,
                         IStopService stopService, ITenantService tenantService, TenantContext tenantContext)
 {
     this.groupService  = groupService;
     this.stopService   = stopService;
     this.tenantService = tenantService;
     this.userService   = userService;
     this.tenantContext = tenantContext;
 }
コード例 #5
0
        public DvbTelegramBot(IConfiguration config, CloudTable favoriteStopTable)
        {
            _stopService         = new StopService();
            _favoriteStopService =
                new FavoriteStopService(new FavoriteStopRepository(favoriteStopTable, new StopRepository()));

            var token     = config["TelegramBotToken"];
            var botClient = new TelegramBotClient(token);

            _sendMessageService = new SendMessageService(botClient);
        }
コード例 #6
0
 public TimersSubmissionConsumer(IStopCosmosDbService stopCosmosDbService, ISftpService sftpService, IStopService stopService, ISubmissionServiceBusService submissionServiceBusService)
 {
     _stopCosmosDbService         = stopCosmosDbService;
     _sftpService                 = sftpService;
     _stopService                 = stopService;
     _submissionServiceBusService = submissionServiceBusService;
     _storageConnectionString     = Environment.GetEnvironmentVariable("RipaStorage");
     _storageContainerNamePrefix  = Environment.GetEnvironmentVariable("ContainerPrefixSubmissions");
     _sftpInputPath               = Environment.GetEnvironmentVariable("SftpInputPath");
     _blobContainerClient         = GetBlobContainerClient();
 }
コード例 #7
0
 public PostSubmitSearch(ISftpService sftpService, IStopService stopService, ISubmissionCosmosDbService submissionCosmosDbService, IStopCosmosDbService stopCosmosDbService, IUserProfileCosmosDbService userProfileCosmosDbService, ISubmissionServiceBusService submissionServiceBusService)
 {
     _sftpService = sftpService;
     _stopService = stopService;
     _submissionCosmosDbService  = submissionCosmosDbService;
     _stopCosmosDbService        = stopCosmosDbService;
     _userProfileCosmosDbService = userProfileCosmosDbService;
     _sftpInputPath               = Environment.GetEnvironmentVariable("SftpInputPath");
     _storageConnectionString     = Environment.GetEnvironmentVariable("RipaStorage");
     _storageContainerNamePrefix  = Environment.GetEnvironmentVariable("ContainerPrefixSubmissions");
     _submissionServiceBusService = submissionServiceBusService;
 }
コード例 #8
0
        public SearchAddressViewModel()
        {
            stopService = (App.Current as App).Container.GetService <IStopService>();

            // New up our observable collection
            AddressesFound = new ObservableCollection <StringWrapper>();

            SearchCommand = new RelayCommand(async() =>
            {
                // If our button is showing "search", let's do the following
                if (SearchAddButtonText == "Search")
                {
                    // Reset everything
                    AddressesFound.Clear();
                    AddressSelected = new StringWrapper();

                    MapLocationFinderResult result = await
                                                     MapLocationFinder.FindLocationsAsync(BuildingNumber + " " + StreetName + ", " + PostCode, null);

                    if (result.Status == MapLocationFinderStatus.Success)
                    {
                        MapAddress address = result.Locations.FirstOrDefault().Address;
                        Geopoint point     = result.Locations.FirstOrDefault().Point;
                        var stringw        = new StringWrapper
                        {
                            StringContent = address.FormattedAddress,
                            TempLatitude  = Convert.ToDecimal(point.Position.Latitude),
                            TempLongitude = Convert.ToDecimal(point.Position.Longitude)
                        };
                        AddressesFound.Add(stringw);
                    }
                    else
                    {
                        return;
                    }
                }
                else // it's basically showing "Add" at this point, so add our item to the list of stops
                {
                    StopModel stopModel = new StopModel()
                    {
                        Name     = StopName, Address = AddressSelected.StringContent,
                        Latitude = AddressSelected.TempLatitude, Longitude = AddressSelected.TempLongitude
                    };
                    stopService.AddStop(stopModel);
                }
            });
        }
コード例 #9
0
        public NewRouteConfirmationViewModel()
        {
            routeService = (App.Current as App).Container.GetService <IRouteService>();
            stopService  = (App.Current as App).Container.GetService <IStopService>();

            CreateRouteCommand = new RelayCommand(() =>
            {
                List <DateTime> datesForRoute = GetDatesSetForRoute();

                if (!string.IsNullOrEmpty(RouteName) &&
                    stopService.Stops.Count > 0 &&
                    datesForRoute.Count > 0)
                {
                    RouteModel routeToAdd = new RouteModel()
                    {
                        RouteName            = this.RouteName,
                        Stops                = new System.Collections.ObjectModel.ObservableCollection <StopModel>(stopService.Stops),
                        DatesForCurrentRoute = new List <DateTime>(datesForRoute)
                    };

                    // Add route to list of routes
                    routeService.AddRoute(routeToAdd);

                    // Cleanup
                    CleanupRouteCreation();

                    // Navigate to route page
                    NavigationService.Navigate(typeof(RoutesPage));
                }
            });

            DateChangedCommand = new RelayCommand <CalendarDatePicker>((param) =>
            {
                selectedDate = param.Date;
            });
        }
コード例 #10
0
 public StopController(IStopService stops)
 {
     _stops = stops;
 }
コード例 #11
0
ファイル: StopCacheService.cs プロジェクト: domints/TTSSWeb
 public StopCacheService(IStopService stopService)
 {
     _stopService = stopService;
 }
 public BroadcastController(IGroupService groupService,
                            IStopService stopService, TenantContext tenantContext)
 {
     this.stopService   = stopService;
     this.tenantContext = tenantContext;
 }
コード例 #13
0
 public ServiceBusResultConsumer(IStopCosmosDbService stopCosmosDbService, IStopService stopService)
 {
     _stopCosmosDbService = stopCosmosDbService;
     _stopService         = stopService;
 }
コード例 #14
0
ファイル: Form1.cs プロジェクト: domints/TTSSX
 public Form1()
 {
     InitializeComponent();
     _stopService    = new StopService();
     _passageService = new PassageService();
 }
コード例 #15
0
 public ShowDeparturesCommand(ISendMessageService sendMessageService, IStopService stopService, IFavoriteStopService favoriteStopService)
 {
     _sendMessageService  = sendMessageService;
     _stopService         = stopService;
     _favoriteStopService = favoriteStopService;
 }
コード例 #16
0
        public RoutesNewViewModel()
        {
            stopService = (App.Current as App).Container.GetService <IStopService>();
            mapService  = (App.Current as App).Container.GetService <IMapService>();

            Stops.CollectionChanged += Stops_CollectionChanged;

            Center = new Geopoint(defaultPosition);

            MapLoaded = new RelayCommand <object>((param) =>
            {
                MapControl newMap = param as MapControl;
                Map = newMap;
            });

            NewStopCommand    = new RelayCommand(async() => { await new SearchAddressDialog().ShowAsync(); });
            RemoveStopCommand = new RelayCommand <object>((param) =>
            {
                // will need to find out what's wrong with this binding at some point
                object stopModel = (param as Grid).DataContext as object;
                stopService.RemoveStop(stopModel);
            });

            SaveRouteCommand = new RelayCommand(async() => { await new NewRouteConfirmation().ShowAsync(); });

            SwitchStopUpCommand = new RelayCommand(() =>
            {
                // We are running a switch command
                isSwitchCommandRunning = true;

                // Find index of selected item in stops
                var indexOfStop = stopService.RetrieveIndexOfStop(SelectedStop as object);

                // if index is 0, do nothing
                if (indexOfStop == 0)
                {
                    return;
                }

                // Temp model object
                var tempStopToReinsert = SelectedStop.Clone();

                // Remove item from collection and reinsert at desired index (-1)
                stopService.RemoveStop(SelectedStop);

                // SelectedStop becomes null at this point, so let's use the
                // copy we made to reinsert
                stopService.AddStopAtIndex(tempStopToReinsert, indexOfStop - 1);

                // We've reached the end of the switch command
                isSwitchCommandRunning = false;
            });

            SwitchStopDownCommand = new RelayCommand(() =>
            {
                // We are running a switch command
                isSwitchCommandRunning = true;

                // Find index of selected item in stops
                var indexOfStop = stopService.RetrieveIndexOfStop(SelectedStop as object);

                // if index is the last index, do nothing
                if (indexOfStop == stopService.Stops.Count - 1)
                {
                    return;
                }

                // Temp model object
                var tempStopToReinsert = SelectedStop.Clone();

                // Remove item from collection and reinsert at desired index (+1)
                stopService.RemoveStop(SelectedStop);

                // SelectedStop becomes null at this point, so let's use the
                // copy we made to reinsert
                stopService.AddStopAtIndex(tempStopToReinsert, indexOfStop + 1);

                // We've reached the end of the switch command
                isSwitchCommandRunning = false;
            });
        }
コード例 #17
0
 public AutocompleteService(IStopService stopService)
 {
     this.stopService = stopService;
 }
コード例 #18
0
ファイル: StopsController.cs プロジェクト: domints/TTSSApi
 public StopsController(IStopService stopService)
 {
     _stopService = stopService;
 }
コード例 #19
0
 public StopsController(IStopService stopService)
 {
     _stopService = stopService ?? throw new ArgumentNullException(nameof(stopService));
 }