|
|
|
|
using System.Collections.Immutable;
|
|
|
|
|
using Connected.Net;
|
|
|
|
|
using Connected.Remote;
|
|
|
|
|
using Connected.ServiceModel;
|
|
|
|
|
using Connected.Services;
|
|
|
|
|
|
|
|
|
|
namespace Connected.Common.Types.TaxRates;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is the client implementation of the <see cref="ITaxRateService"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class TaxRateService : EntityService<int>, ITaxRateService, IRemoteService
|
|
|
|
|
{
|
|
|
|
|
public TaxRateService(IHttpService http)
|
|
|
|
|
{
|
|
|
|
|
Http = http;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IHttpService Http { get; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task Delete(PrimaryKeyArgs<int> e)
|
|
|
|
|
{
|
|
|
|
|
await Http.Post("http://localhost:5063/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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<ITaxRate?> Select(PrimaryKeyArgs<int> e)
|
|
|
|
|
{
|
|
|
|
|
return await Http.Post<TaxRate>("http://localhost:5063/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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task Update(UpdateTaxRateArgs e)
|
|
|
|
|
{
|
|
|
|
|
await Http.Post<TaxRate>("http://localhost:5063/management/commonTypes/taxRates/update", e);
|
|
|
|
|
}
|
|
|
|
|
}
|