Compare commits
3 Commits
820a698a9f
...
b097dd54e6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b097dd54e6 | ||
![]() |
ae0dcb3bf1 | ||
![]() |
a7092ec705 |
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "dependencies/Connected.Components"]
|
||||
path = dependencies/Connected.Components
|
||||
url = https://git.tompit.com/Connected/Connected.Components.git
|
1
dependencies/Connected.Components
vendored
Submodule
1
dependencies/Connected.Components
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 323c66fecd302e569171172b82ab52f8530bf472
|
@ -1,4 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using Connected.Configuration;
|
||||
using Connected.Net;
|
||||
using Connected.Remote;
|
||||
using Connected.ServiceModel;
|
||||
@ -10,47 +11,62 @@ namespace Connected.Common.Types.TaxRates;
|
||||
/// This is the client implementation of the <see cref="ITaxRateService"/>.
|
||||
/// </summary>
|
||||
internal class TaxRateService : EntityService<int>, ITaxRateService, IRemoteService
|
||||
{
|
||||
public TaxRateService(IHttpService http)
|
||||
{
|
||||
public TaxRateService(IHttpService http, IConfigurationService configurationService)
|
||||
{
|
||||
Http = http;
|
||||
ConfigurationService = configurationService;
|
||||
}
|
||||
|
||||
private IHttpService Http { get; }
|
||||
|
||||
private IConfigurationService ConfigurationService { get; }
|
||||
|
||||
private string GetBaseAddress()
|
||||
{
|
||||
var serviceConfigurations = ConfigurationService.Remote.Query(nameof(TaxRateService));
|
||||
|
||||
foreach (var configuration in serviceConfigurations)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(configuration?.Address))
|
||||
return configuration.Address;
|
||||
}
|
||||
|
||||
throw new Exception("No base address registered for TaxRateService");
|
||||
}
|
||||
|
||||
public async Task Delete(PrimaryKeyArgs<int> e)
|
||||
{
|
||||
await Http.Post("http://localhost:5063/management/commonTypes/taxRates/delete", e);
|
||||
await Http.Post($"{GetBaseAddress()}/management/commonTypes/taxRates/delete", e);
|
||||
}
|
||||
|
||||
public async Task<int> Insert(InsertTaxRateArgs e)
|
||||
{
|
||||
return await Http.Post<int>("http://localhost:5063/management/commonTypes/taxRates/insert", e);
|
||||
return await Http.Post<int>($"{GetBaseAddress()}/management/commonTypes/taxRates/insert", e);
|
||||
}
|
||||
|
||||
public async Task<ImmutableList<ITaxRate>?> Query(PrimaryKeyListArgs<int> e)
|
||||
{
|
||||
return (await Http.Post<List<TaxRate>?>("http://localhost:5063/management/commonTypes/taxRates/select", e)).ToImmutableList<ITaxRate>();
|
||||
return (await Http.Post<List<TaxRate>?>($"{GetBaseAddress()}/management/commonTypes/taxRates/select", e))?.ToImmutableList<ITaxRate>() ?? ImmutableList<ITaxRate>.Empty;
|
||||
}
|
||||
|
||||
public async Task<ImmutableList<ITaxRate>?> Query(QueryArgs? args)
|
||||
{
|
||||
return (await Http.Post<List<TaxRate>?>("http://localhost:5063/management/commonTypes/taxRates/query", args ?? QueryArgs.NoPaging)).ToImmutableList<ITaxRate>();
|
||||
return (await Http.Post<List<TaxRate>?>($"{GetBaseAddress()}/management/commonTypes/taxRates/query", args ?? QueryArgs.NoPaging))?.ToImmutableList<ITaxRate>() ?? ImmutableList<ITaxRate>.Empty;
|
||||
}
|
||||
|
||||
public async Task<ITaxRate?> Select(PrimaryKeyArgs<int> e)
|
||||
{
|
||||
return await Http.Post<TaxRate>("http://localhost:5063/management/commonTypes/taxRates/select", e);
|
||||
return await Http.Post<TaxRate>($"{GetBaseAddress()}/management/commonTypes/taxRates/select", e);
|
||||
}
|
||||
|
||||
public async Task<ITaxRate?> Select(TaxRateArgs e)
|
||||
{
|
||||
return await Http.Post<TaxRate>("http://localhost:5063/management/commonTypes/taxRates/select", e);
|
||||
return await Http.Post<TaxRate>($"{GetBaseAddress()}/management/commonTypes/taxRates/select", e);
|
||||
}
|
||||
|
||||
public async Task Update(UpdateTaxRateArgs e)
|
||||
{
|
||||
await Http.Post<TaxRate>("http://localhost:5063/management/commonTypes/taxRates/update", e);
|
||||
await Http.Post<TaxRate>($"{GetBaseAddress()}/management/commonTypes/taxRates/update", e);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
@attribute [Route(CommonTypesUIRoutes.TaxRatesAdd)]
|
||||
|
||||
@using Connected.Common.Types.TaxRates.Components
|
||||
|
||||
<h3>TaxRateAdd</h3>
|
||||
|
||||
<TaxRateAdd></TaxRateAdd>
|
@ -1,4 +1,5 @@
|
||||
@using Common.Types.TaxRates.Components
|
||||
@using Connected.Common.Types.TaxRates.Components
|
||||
|
||||
@attribute [Route(CommonTypesUIRoutes.TaxRatesEdit)]
|
||||
|
||||
<h3>TaxRateEdit</h3>
|
||||
|
Loading…
x
Reference in New Issue
Block a user