...
This commit is contained in:
@@ -1,9 +1,46 @@
|
||||
using Shared.DTOs;
|
||||
using Front.Services;
|
||||
using Shared.DTOs;
|
||||
using System.Net.Http.Json;
|
||||
|
||||
namespace Front
|
||||
{
|
||||
public static class Fixedvalues
|
||||
public class Fixedvalues
|
||||
{
|
||||
public static UserAuthenticationDTO Userinfo=new UserAuthenticationDTO();
|
||||
public readonly HttpClientController _hc;
|
||||
private List<ForCustomerSearch>? Cus=null;
|
||||
private List<IdName<int>>? Patterns = null;
|
||||
public Fixedvalues(HttpClientController hc)
|
||||
{
|
||||
_hc = hc;
|
||||
}
|
||||
public async Task<List<ForCustomerSearch>?> GetCustomers()
|
||||
{
|
||||
if (Cus == null)
|
||||
{
|
||||
var request = await _hc.Get($"Customer/GetAllForidName");
|
||||
if (request.IsSuccessStatusCode)
|
||||
{
|
||||
Cus= await request.Content.ReadFromJsonAsync<List<ForCustomerSearch>>();
|
||||
}
|
||||
}
|
||||
|
||||
return Cus;
|
||||
|
||||
|
||||
}
|
||||
public async Task<List<IdName<int>>?> GetPatterns()
|
||||
{
|
||||
if (Patterns==null)
|
||||
{
|
||||
var request = await _hc.Get($"Invoice/GetPatterns");
|
||||
if (request.IsSuccessStatusCode)
|
||||
{
|
||||
Patterns =await request.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Patterns;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user