public List <GarmentExpenditureGood> GetExpenditureGood(string RONo) { string expenditureUri = "expenditure-goods/byRO"; IHttpClientService httpClient = (IHttpClientService)_serviceProvider.GetService(typeof(IHttpClientService)); var response = httpClient.GetAsync($"{ApplicationSetting.ProductionEndpoint}{expenditureUri}?RONo={RONo}").Result; if (response.IsSuccessStatusCode) { var content = response.Content.ReadAsStringAsync().Result; Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(content); List <GarmentExpenditureGood> viewModel; if (result.GetValueOrDefault("data") == null) { viewModel = null; } else { viewModel = JsonConvert.DeserializeObject <List <GarmentExpenditureGood> >(result.GetValueOrDefault("data").ToString()); } return(viewModel); } else { return(null); } }
public EmailService( ApiSettings apiSettings, IHttpClientService httpClientService) { _httpClientService = httpClientService; _baseUrl = $"{apiSettings.JobManagementApiBaseUrl}/api/period-end-email"; }
/// <summary> /// Initializes a new instance of the <see cref="AuthenticationDelegate"/> class. /// </summary> /// <param name="logger">The injected logger provider.</param> /// <param name="httpClientService">The injected http client service.</param> public AuthenticationDelegate( ILogger <IAuthenticationDelegate> logger, IHttpClientService httpClientService) { this.logger = logger; this.httpClientService = httpClientService; }
public StockPhotoServices(IConfiguration configuration, IHttpClientService httpClientService) { _baseUrl = configuration.GetSection("Pexel:URL").Value; _key = configuration.GetSection("Pexel:Key").Value; _httpClientService = httpClientService; }
public DPPVATBankExpenditureNoteViewModel GetInvoice(long InvoiceId) { string financeUri = "dpp-vat-bank-expenditure-notes/invoice"; IHttpClientService httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); var response = httpClient.GetAsync($"{APIEndpoint.Finance}{financeUri}/{InvoiceId}").Result; if (response.IsSuccessStatusCode) { var content = response.Content.ReadAsStringAsync().Result; Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(content); DPPVATBankExpenditureNoteViewModel viewModel; if (result.GetValueOrDefault("data") == null) { viewModel = null; } else { viewModel = JsonConvert.DeserializeObject <DPPVATBankExpenditureNoteViewModel>(result.GetValueOrDefault("data").ToString()); } return(viewModel); } else { return(null); } }
//private List<SupplierViewModel> GetSuppliers(string code) //{ // string supplierUri = "master/garment-suppliers"; // IHttpClientService httpClient = (IHttpClientService)this.serviceProvider.GetService(typeof(IHttpClientService)); // if (httpClient != null) // { // var response = httpClient.GetAsync($"{APIEndpoint.Core}{supplierUri}/byCodes?code={code}").Result.Content.ReadAsStringAsync(); // Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>>(response.Result); // List<SupplierViewModel> viewModel = JsonConvert.DeserializeObject<List<SupplierViewModel>>(result.GetValueOrDefault("data").ToString()); // return viewModel; // } // else // { // List<SupplierViewModel> viewModel = null; // return viewModel; // } //} private List <GarmentSupplierViewModel> GetSuppliers(HashSet <long> productIds) { var param = string.Join('&', productIds.Select(id => $"garmentSupplierList[]={id}")); IHttpClientService httpClient = (IHttpClientService)this.serviceProvider.GetService(typeof(IHttpClientService)); if (httpClient != null) { var response = httpClient.GetAsync($"{APIEndpoint.Core}master/garment-suppliers/byId?{param}").Result.Content.ReadAsStringAsync(); Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(response.Result); List <GarmentSupplierViewModel> viewModel = JsonConvert.DeserializeObject <List <GarmentSupplierViewModel> >(result.GetValueOrDefault("data").ToString()); return(viewModel); } else { List <GarmentSupplierViewModel> viewModel = null; return(viewModel); } //var param = string.Join('&', productIds.Select(id => $"garmentSupplierList[]={id}")); //var httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); //var response = await httpClient.GetAsync($"{APIEndpoint.Core}master/garment-suppliers/byId?{param}"); //var content = await response.Content.ReadAsStringAsync(); //Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>>(content) ?? new Dictionary<string, object>(); //if (response.IsSuccessStatusCode) //{ // List<SupplierViewModel> data = JsonConvert.DeserializeObject<List<SupplierViewModel>>(result.GetValueOrDefault("data").ToString()); // return data; //} //else //{ // throw new Exception(string.Concat("Failed Get Supplier : ", (string)result.GetValueOrDefault("error") ?? "- ", ". Message : ", (string)result.GetValueOrDefault("message") ?? "- ", ". Status : ", response.StatusCode, ".")); //} }
public AppCenterPushNotificationServerService( IHttpClientService httpClientService, ILogger <AppCenterPushNotificationServerService> logger) { _httpClientService = httpClientService; _logger = logger; }
public MaintenanceController( IHttpClientService httpClientService, ICommonService commonService) { _httpClientService = httpClientService; _commonService = commonService; }
public AddVehiclePage() { this.InitializeComponent(); _httpClientService = new HttpClientService(); BtnAddVehicle.Click += BtnAddVehicle_Click; progressBar.Visibility = Windows.UI.Xaml.Visibility.Collapsed; }
public SpotifyDataProvider(IHttpClientService httpClientService, IUsersService usersService, SpotifyApiDataProvider spotifyApiDataProvider) { _httpClientService = httpClientService; _usersService = usersService; _spotifyApiDataProvider = spotifyApiDataProvider; }
public ALLFPeriodEndService( IStorageService storageService, IFileUploadJobMetaDataModelBuilderService fileUploadJobMetaDataModelBuilderService, ICollectionsService collectionService, IPeriodService periodService, IStateService stateService, ICloudStorageService cloudStorageService, IJobService jobService, ILogger logger, AzureStorageSection azureStorageConfig, ApiSettings apiSettings, IHttpClientService httpClientService) { _storageService = storageService; _fileUploadJobMetaDataModelBuilderService = fileUploadJobMetaDataModelBuilderService; _collectionService = collectionService; _periodService = periodService; _stateService = stateService; _cloudStorageService = cloudStorageService; _jobService = jobService; _logger = logger; _azureStorageConfig = azureStorageConfig; _httpClientService = httpClientService; _baseUrl = apiSettings.JobManagementApiBaseUrl; }
private List <ItemCoreViewModel> GetItem(string itemCode) { if (itemCode.Length < 14) { return(null); } else { string itemUri = "items/finished-goods/Code"; IHttpClientService httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); var response = httpClient.GetAsync($"{APIEndpoint.Core}{itemUri}/{itemCode}").Result; if (response.IsSuccessStatusCode) { var content = response.Content.ReadAsStringAsync().Result; Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(content); List <ItemCoreViewModel> viewModel = JsonConvert.DeserializeObject <List <ItemCoreViewModel> >(result.GetValueOrDefault("data").ToString()); //return viewModel.OrderByDescending(s => s.Date).FirstOrDefault(s => s.Date < doDate.AddDays(1)); ; return(viewModel); } else { return(null); } } }
public LinkedinRepository(ISecretsRepository secrets, IHttpClientService client) { _secretsRepository = secrets; _client = client; _clientId = secrets.GetSecret("LinkedinClientId"); _clientSecret = secrets.GetSecret("LinkedinClientSecret"); }
public ProfileController( IHttpClientService httpClientService, ICommonService commonService) { _httpClientService = httpClientService; _commonService = commonService; }
public ParticipantRestResolver(ILogger logger, IConfigurationService configurationService, IHttpClientService httpClientService, IMapper mapper) { _logger = logger; _participantConfig = configurationService.ServerConfig.ParticipantEndpoints; _clientService = httpClientService; _participantMapper = mapper; }
public SubscriptionController(ILogger <SubscriptionController> logger, IMediator mediator, IHttpClientService client, IOptions <Settings> options) { _logger = logger; _mediator = mediator; _client = client; _options = options; }
public DPPVATBankExpenditureNoteViewModel GetNoKasBank(long donos) { var param = new StringContent(JsonConvert.SerializeObject(donos), Encoding.UTF8, "application/json"); string expenditureUri = APIEndpoint.Finance + $"dpp-vat-bank-expenditure-notes/invoice/" + donos; //string queryUri = "?dateFrom=" + datefrom + "&dateTo=" + dateTo; //string uri = expenditureUri + queryUri; IHttpClientService httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); var httpResponse = httpClient.SendAsync(HttpMethod.Get, expenditureUri, param).Result; if (httpResponse.IsSuccessStatusCode) { var content = httpResponse.Content.ReadAsStringAsync().Result; Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(content); DPPVATBankExpenditureNoteViewModel viewModel; if (result.GetValueOrDefault("data") == null) { viewModel = new DPPVATBankExpenditureNoteViewModel(); } else { viewModel = JsonConvert.DeserializeObject <DPPVATBankExpenditureNoteViewModel>(result.GetValueOrDefault("data").ToString()); } return(viewModel); } else { return(new DPPVATBankExpenditureNoteViewModel()); } }
public List <GarmentInvoiceMonitoringViewModel> GetInvoiceFromPacking(DateTime datefrom, DateTime dateTo) { //var param = new StringContent(JsonConvert.SerializeObject(RONo), Encoding.UTF8, "application/json"); string expenditureUri = APIEndpoint.PackingInventory + $"garment-shipping/monitoring/garment-cmt-sales"; string queryUri = "?dateFrom=" + datefrom + "&dateTo=" + dateTo; string uri = expenditureUri + queryUri; IHttpClientService httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); var httpResponse = httpClient.GetAsync(uri).Result; if (httpResponse.IsSuccessStatusCode) { var content = httpResponse.Content.ReadAsStringAsync().Result; Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(content); List <GarmentInvoiceMonitoringViewModel> viewModel; //if (result.GetValueOrDefault("data") == null) //{ // viewModel = new List<GarmentInvoiceMonitoringViewModel>(); //} //else //{ viewModel = JsonConvert.DeserializeObject <List <GarmentInvoiceMonitoringViewModel> >(result.GetValueOrDefault("data").ToString()); //} return(viewModel); } else { return(new List <GarmentInvoiceMonitoringViewModel>()); } }
// public List<GarmentExpenditureGoodViewModel> GetExpenditureGood(string RONo) // { // string expenditureUri = "expenditure-goods/byRO"; // // string queryUri = "?filter=" + filter + "&keyword=" + keyword + "&order=" + order + "&page=" + page + "&size=" + size; // // string uri = dispositionUri + queryUri; // IHttpClientService httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); // var response = httpClient.GetAsync($"{APIEndpoint.GarmentProduction}{expenditureUri}?RONo={RONo}").Result; // if (response.IsSuccessStatusCode) // { // var content = response.Content.ReadAsStringAsync().Result; // Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>>(content); // List<GarmentExpenditureGoodViewModel> viewModel; // if (result.GetValueOrDefault("data") == null) // { // viewModel = null; // } // else // { //// var viewModels = JsonConvert.DeserializeObject<List<GarmentExpenditureGoodViewModel>>(result.GetValueOrDefault("data").ToString()); //// viewModel = viewModels.Count() == 0 ? null : viewModels; // viewModel = JsonConvert.DeserializeObject<List<GarmentExpenditureGoodViewModel>>(result.GetValueOrDefault("data").ToString()); // } // return viewModel; // } // else // { // return null; // } // } public List <GarmentExpenditureGoodViewModel> GetExpenditureGood(string invoices) { var param = new StringContent(JsonConvert.SerializeObject(invoices), Encoding.UTF8, "application/json"); string expenditureUri = APIEndpoint.GarmentProduction + $"expenditure-goods/traceable-by-ro"; IHttpClientService httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); var httpResponse = httpClient.SendAsync(HttpMethod.Get, expenditureUri, param).Result; if (httpResponse.IsSuccessStatusCode) { var content = httpResponse.Content.ReadAsStringAsync().Result; Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(content); List <GarmentExpenditureGoodViewModel> viewModel; //if (result.GetValueOrDefault("data") == null) //{ // viewModel = new List<GarmentExpenditureGoodViewModel>(); //} //else //{ viewModel = JsonConvert.DeserializeObject <List <GarmentExpenditureGoodViewModel> >(result.GetValueOrDefault("data").ToString()); //} return(viewModel); } else { return(new List <GarmentExpenditureGoodViewModel>()); } }
public ValidityPeriodService( ApiSettings apiSettings, IHttpClientService httpClientService) { _httpClientService = httpClientService; _baseUrl = apiSettings.JobManagementApiBaseUrl; }
private const string RequestUri = "anonymous/MT"; //production public MessageOutListener(IResolutionRoot kernel, IModel channel) { _channelTxSub = channel; _log = kernel.Get <ILogger>(); _outgoingService = kernel.Get <IOutgoingService>(); _externalPublisher = kernel.Get <IHttpClientService>(); }
public VehiclesPage() { this.InitializeComponent(); _httpClientService = new HttpClientService(); _vehicles = new List <VehicleEntity>(); btnVehicleAdd.Click += BtnVehicleAdd_Click; }
public List <BeacukaiAddedViewModel> GetPEBbyDate(DateTime?dateFrom, DateTime?dateTo) { //var param = new StringContent(JsonConvert.SerializeObject(invoice), Encoding.UTF8, "application/json"); string shippingInvoiceUri = APIEndpoint.CustomsReport + $"customs-reports/getPEB/byDate?dateFrom={dateFrom}&dateTo={dateTo}"; IHttpClientService httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); var httpResponse = httpClient.GetAsync(shippingInvoiceUri).Result; if (httpResponse.IsSuccessStatusCode) { var content = httpResponse.Content.ReadAsStringAsync().Result; Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(content); List <BeacukaiAddedViewModel> viewModel; if (result.GetValueOrDefault("data") == null) { viewModel = new List <BeacukaiAddedViewModel>(); } else { viewModel = JsonConvert.DeserializeObject <List <BeacukaiAddedViewModel> >(result.GetValueOrDefault("data").ToString()); } return(viewModel); } else { return(new List <BeacukaiAddedViewModel>()); } }
public List <GarmentExpenditureGoodViewModel> GetExpenditureGood(string RONo) { string expenditureUri = "expenditure-goods/byRO"; // string queryUri = "?filter=" + filter + "&keyword=" + keyword + "&order=" + order + "&page=" + page + "&size=" + size; // string uri = dispositionUri + queryUri; IHttpClientService httpClient = (IHttpClientService)serviceProvider.GetService(typeof(IHttpClientService)); var response = httpClient.GetAsync($"{APIEndpoint.GarmentProduction}{expenditureUri}?RONo={RONo}").Result; if (response.IsSuccessStatusCode) { var content = response.Content.ReadAsStringAsync().Result; Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(content); List <GarmentExpenditureGoodViewModel> viewModel; if (result.GetValueOrDefault("data") == null) { viewModel = null; } else { // var viewModels = JsonConvert.DeserializeObject<List<GarmentExpenditureGoodViewModel>>(result.GetValueOrDefault("data").ToString()); // viewModel = viewModels.Count() == 0 ? null : viewModels; viewModel = JsonConvert.DeserializeObject <List <GarmentExpenditureGoodViewModel> >(result.GetValueOrDefault("data").ToString()); } return(viewModel); } else { return(null); } }
private HttpNodeJSService CreateHttpNodeJSService(IOptions <OutOfProcessNodeJSServiceOptions> outOfProcessNodeHostOptionsAccessor = null, IHttpContentFactory httpContentFactory = null, IEmbeddedResourcesService embeddedResourcesService = null, IFileWatcherFactory fileWatcherFactory = null, IMonitorService monitorService = null, ITaskService taskService = null, IHttpClientService httpClientService = null, IJsonService jsonService = null, INodeJSProcessFactory nodeProcessFactory = null, ILogger <HttpNodeJSService> logger = null) { if (logger == null) { Mock <ILogger <HttpNodeJSService> > mockLogger = _mockRepository.Create <ILogger <HttpNodeJSService> >(); logger = mockLogger.Object; } return(new HttpNodeJSService(outOfProcessNodeHostOptionsAccessor, httpContentFactory, embeddedResourcesService, fileWatcherFactory, monitorService, taskService, httpClientService, jsonService, nodeProcessFactory, logger)); }
public SetStageDialog(UserAuthDto userAuthDto, AdminEntity adminEntity) { this.InitializeComponent(); _httpClientService = new HttpClientService(); _httpClientService.SetAuthorizationHeaderToken(_httpClientService.HttpClient, userAuthDto.Token); _adminEntity = adminEntity; }
public PatternRestResolver(ILogger logger, IConfigurationService configurationService, IHttpClientService httpClientService, IMapper mapper) { _logger = logger; _patternConfig = configurationService.ServerConfig.PatternEndpoints; _clientService = httpClientService; _patternMapper = mapper; }
public ManageProvidersService( ApiSettings apiSettings, IDateTimeProvider dateTimeProvider, IHttpClientService httpClientService) : base(apiSettings, dateTimeProvider, httpClientService) { }
public JobFailedCurrentPeriodService( ApiSettings apiSettings, IHttpClientService httpClientService) { _httpClientService = httpClientService; _baseUrl = apiSettings.JobManagementApiBaseUrl; }
public JobProcessingService( ApiSettings apiSettings, IHttpClientService httpClientService) { _httpClientService = httpClientService; _baseUrl = apiSettings.JobManagementApiBaseUrl; }
public ErrorService(IHttpClientService httpClient, IJsonSerializationService jsonSerialization, IEnvironmentService environmentService, IAccountsService accountsService) { _jsonSerialization = jsonSerialization; _environmentService = environmentService; _accountsService = accountsService; _httpClient = httpClient.Create(); _httpClient.Timeout = new TimeSpan(0, 0, 10); _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); }
public FeaturesService(IDefaultValueService defaultValueService, IHttpClientService httpClientService, IJsonSerializationService jsonSerializationService) { _defaultValueService = defaultValueService; _httpClientService = httpClientService; _jsonSerializationService = jsonSerializationService; }
public UpgradesViewModel(IHttpClientService httpClientService, IJsonSerializationService jsonSerializationService) { _httpClientService = httpClientService; _jsonSerializationService = jsonSerializationService; }
public JsonService(ISettingsService settingsService, IHttpClientService httpClientService) { this.settingsService = settingsService; this.httpClientService = httpClientService; }
public PushNotificationsService(IApplicationService applicationService, IHttpClientService httpClientService) { _applicationService = applicationService; _httpClientService = httpClientService; }
public ApiService(IHttpClientService httpClient) { _httpClient = httpClient; }