Exemple #1
0
        public async Task <PolandVehicleDetail> GetPolandVehicleDetails(SearchByPolandNumberArgs searchByPolandNumberArgs, CancellationToken cancellationToken = default(CancellationToken)) =>
        await Task.Run(async() => {
            PolandVehicleDetail polandVehicleDetail = null;

            string url = string.Format(BaseSingleton <GlobalSetting> .Instance.RestEndpoints.VehicleEndpoints.PolandVehicleDetailsEndpoint,
                                       searchByPolandNumberArgs.Vin, searchByPolandNumberArgs.Date, searchByPolandNumberArgs.Number);
            string accessToken = BaseSingleton <GlobalSetting> .Instance.UserProfile.AccesToken;

            try {
                polandVehicleDetail = await _requestProvider.GetAsync <PolandVehicleDetail>(url, accessToken);
            }
            catch (ConnectivityException ex) {
                throw ex;
            }
            catch (HttpRequestExceptionEx ex) {
                polandVehicleDetail = null;
            }
            catch (ServiceAuthenticationException ex) {
                await _identityService.LogOutAsync();
                throw ex;
            }
            catch (Exception ex) {
                Debug.WriteLine($"ERROR:{ex.Message}");
                Debugger.Break();
            }
            return(polandVehicleDetail);
        }, cancellationToken);
Exemple #2
0
        public override Task InitializeAsync(object navigationData)
        {
            if (navigationData is SearchByPolandNumberArgs searchByPolandNumberArgs)
            {
                _searchByPolandNumberArgs = searchByPolandNumberArgs;
            }

            MainInput.Value = string.Empty;
#if DEBUG
            MainInput.Value = "wvwzzz1jzwb026870";
#endif

            return(base.InitializeAsync(navigationData));
        }