2024-05-17 23:05:46 +03:30
|
|
|
|
using Front.Services;
|
|
|
|
|
using Shared.DTOs;
|
|
|
|
|
using System.Net.Http.Json;
|
2024-04-18 18:26:12 +03:30
|
|
|
|
|
|
|
|
|
namespace Front
|
|
|
|
|
{
|
2024-05-17 23:05:46 +03:30
|
|
|
|
public class Fixedvalues
|
2024-04-18 18:26:12 +03:30
|
|
|
|
{
|
2024-05-17 23:05:46 +03:30
|
|
|
|
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;
|
|
|
|
|
}
|
2024-04-18 18:26:12 +03:30
|
|
|
|
}
|
|
|
|
|
}
|