public bool Init()
        {
            //TODO: move this to the constructors...but hey, so convienient just like this...maybe leave it as is...
            var ker = ((ResSched.App)Xamarin.Forms.Application.Current).Kernel;

            _dataService     = ker.Get <IDataRetrievalService>();
            _dataLoadService = ker.Get <IDataLoadService>();
            return(true);
        }
Exemple #2
0
 public TransferVendorDataController(
     IVendorRepository vendorRepository,
     IVendorBankAccountRepository vendorBankAccountRepository,
     IDataRetrievalService dataRetrievalService)
 {
     _vendorRepository            = vendorRepository;
     _vendorBankAccountRepository = vendorBankAccountRepository;
     _dataRetrievalService        = dataRetrievalService;
 }
Exemple #3
0
        public DataRetrievalServiceTests()
        {
            ServiceProvider serviceProvider = new ServiceCollection()
                                              .AddHttpClient()
                                              .AddSingleton <IApiService, ApiService>()
                                              .AddSingleton <IDataRetrievalService, DataRetrievalService>()
                                              .BuildServiceProvider();

            _dataRetrievalService = serviceProvider.GetService <IDataRetrievalService>();
            _dataSetId            = "5yv1I3dA1wg";
        }
Exemple #4
0
        //https://developer.xamarin.com/api/type/System.IDisposable/
        //http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface

        public CustomViewModelBase(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService)
        {
            if (navService == null)
            {
                throw new ArgumentException("Invalid navService");
            }

            NavService           = navService;
            DataLoadService      = dataLoadService;
            DataRetrievalService = dataRetrievalService;
        }
Exemple #5
0
        public static async Task Main()
        {
            try
            {
                IDataRetrievalService api           = services.GetService <IDataRetrievalService>();
                AuthenticationModel   authenticated = await api.GetToken();

                #region Web Request:

                var budget     = api.GetBudgetReport(authenticated);
                var site       = api.GetSiteReport(authenticated);
                var project    = api.GetProjectReport(authenticated);
                var task       = api.GetTaskReport(authenticated);
                var workEffort = api.GetWorkEffortReport(authenticated);

                #endregion

                IDatabaseCleanupService cleanup = services.GetService <IDatabaseCleanupService>();

                await Task.WhenAll(
                    api.GetBudgetReport(authenticated),
                    cleanup.PurgeBudget(),

                    api.GetSiteReport(authenticated),
                    cleanup.PurgeSite(),

                    api.GetProjectReport(authenticated),
                    cleanup.PurgeProject(),

                    api.GetTaskReport(authenticated),
                    cleanup.PurgeTask(),

                    api.GetWorkEffortReport(authenticated),
                    cleanup.PurgeWorkEffort()
                    );

                IDatabaseImporterService importer = services.GetService <IDatabaseImporterService>();

                await Task.WhenAll(
                    importer.InsertBudget(await budget),
                    importer.InsertSite(await site),
                    importer.InsertProject(await project),
                    importer.InsertTask(await task),
                    importer.InsertWorkEffort(await workEffort)
                    );
            }

            catch (Exception exception)
            {
                exception.Decorate(Log.Logger);
                throw;
            }
        }
        public LoadingScreenViewModel(IConnectivityService connectivityService,
                                      IDataRetrievalService dataRetrievalService,
                                      IEventService eventService,
                                      IMvxNavigationService navigationService,
                                      IProductService productService)
        {
            _connectivityService  = connectivityService;
            _dataRetrievalService = dataRetrievalService;
            _eventService         = eventService;
            _productService       = productService;

            _navigationService = navigationService;
        }
 public async Task RunQueuedUpdatesAsync(CancellationToken token)
 {
     if (_dataService == null)
     {
         _dataService = ((QuikRide.App)Xamarin.Forms.Application.Current).Kernel.GetService(typeof(IDataRetrievalService)) as IDataRetrievalService;
     }
     if (Connectivity.NetworkAccess == NetworkAccess.Internet)
     {
         await _dataService.RunQueuedUpdatesAsync(token);
     }
     else
     {
         Debug.WriteLine($"No connectivity - RunQueuedUpdatesAsync cannot run");
     }
 }
Exemple #8
0
        //https://developer.xamarin.com/api/type/System.IDisposable/
        //http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface

        public CustomViewModelBase(INavigationService navService, IDataRetrievalService dataRetrievalService, IDataDownloadService dataDownloadService, IStateService stateService, ILoggingService loggingService, IMemoryReporterService memoryReporterService)
        {
            if (navService == null)
            {
                throw new ArgumentException("Invalid navService");
            }

            if (dataRetrievalService == null)
            {
                throw new ArgumentException("Invalid dataRetrievalService");
            }

            if (dataDownloadService == null)
            {
                throw new ArgumentException("Invalid dataDownloadService");
            }

            if (stateService == null)
            {
                throw new ArgumentException("Invalid stateService");
            }

            if (loggingService == null)
            {
                throw new ArgumentException("Invalid loggingService");
            }

            if (memoryReporterService == null)
            {
                throw new ArgumentException("Invalid memoryReporterService");
            }

            NavService            = navService;
            DataRetrievalService  = dataRetrievalService;
            DataDownloadService   = dataDownloadService;
            StateService          = stateService;
            LoggingService        = loggingService;
            MemoryReporterService = memoryReporterService;

            IsDev = false;
#if DEBUG
            IsDev = true;
#endif
        }
 public FeedbackViewModel(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService) :
     base(navService, dataLoadService, dataRetrievalService)
 {
 }
Exemple #10
0
 public UserLocationViewModel(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService)
     : base(navService, dataLoadService, dataRetrievalService)
 {
 }
Exemple #11
0
 public DealersAndVehiclesService(IDataRetrievalService dataRetrievalService, ILogger <DealersAndVehiclesService> logger)
 {
     _dataRetrievalService = dataRetrievalService;
     _logger = logger;
 }
Exemple #12
0
 public MapWithPinsViewModel(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService)
     : base(navService, dataLoadService, dataRetrievalService)
 {
 }
        public static async Task <ObservableCollection <HourlySchedule> > BuildHourlyScheduleAsync(this IDataRetrievalService _dataRetrievalService, DateTime selectedDate, Guid resourceId)
        {
            var hourlySchedule = new ObservableCollection <HourlySchedule>();
            var schedules      = await _dataRetrievalService.GetResourceSchedules(resourceId, selectedDate);

            foreach (var h in Config.Hours)
            {
                var hour  = selectedDate.AddHours(h);
                var sched = schedules.Where(x => x.ReservationStartDateTime <= hour && x.ReservationEndDateTime >= hour).FirstOrDefault();

                hourlySchedule.Add(new HourlySchedule()
                {
                    Hour             = hour,
                    ResourceSchedule = sched
                });
            }
            return(hourlySchedule);
        }
Exemple #14
0
 public AccountViewModel(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService) : base(navService, dataLoadService, dataRetrievalService)
 {
 }
Exemple #15
0
 public GeofencingViewModel(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService) : base(navService, dataLoadService, dataRetrievalService)
 {
     MyMonitoredRegions     = new ObservableCollection <GeofenceRegion>();
     RecentGeofenceActivity = new ObservableCollection <ModelsObj.GeofenceActivity>();
 }
 private UploadDataService()
 {
     _dataService = ((QuikRide.App)Xamarin.Forms.Application.Current).Kernel.GetService(typeof(IDataRetrievalService)) as IDataRetrievalService;
 }
Exemple #17
0
 public SplashViewModel(INavigationService navService, IDataRetrievalService dataRetrievalService, IDataDownloadService dataDownloadService, IStateService stateService, ILoggingService loggingService, IMemoryReporterService memoryReporterService)
     : base(navService, dataRetrievalService, dataDownloadService, stateService, loggingService, memoryReporterService)
 {
 }
Exemple #18
0
 public LoyaltyScannerViewModel(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService) : base(navService, dataLoadService, dataRetrievalService)
 {
 }
 public MyReservationRequestsViewModel(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService)
     : base(navService, dataLoadService, dataRetrievalService)
 {
     MyRequests = new ObservableCollection <ReservationRequest>();
 }
 public GameViewModel(INavigationService navService, IDataRetrievalService dataRetrievalService, IDataDownloadService dataDownloadService, IStateService stateService, ILoggingService loggingService, IMemoryReporterService memoryReporterService)
     : base(navService, dataRetrievalService, dataDownloadService, stateService, loggingService, memoryReporterService)
 {
     BingoInstanceContent = new List <ModelObj.BB.BingoInstanceContent>();
     Players = new List <PlayerViewModel>();
 }
 public AboutViewModelMVVMDI(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService)
     : base(navService, dataLoadService, dataRetrievalService)
 {
 }
 public WelcomeViewModel(INavigationService navService, IDataRetrievalService dataRetrievalService, IDataDownloadService dataDownloadService, IStateService stateService, ILoggingService loggingService, IMemoryReporterService memoryReporterService)
     : base(navService, dataRetrievalService, dataDownloadService, stateService, loggingService, memoryReporterService)
 {
     Meetings   = new ObservableCollection <Meeting>();
     _hasLoaded = false;
 }
Exemple #23
0
 public BarcodeReaderViewModel(INavigationService navService, IDataLoadService dataLoadService, IDataRetrievalService dataRetrievalService) : base(navService, dataLoadService, dataRetrievalService)
 {
 }