last
This commit is contained in:
@@ -1,34 +1,36 @@
|
||||
using Front.Services;
|
||||
using Shared.DTOs;
|
||||
using System.Net.Http.Json;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Front
|
||||
{
|
||||
public class Fixedvalues
|
||||
{
|
||||
public readonly HttpClientController _hc;
|
||||
private List<ForCustomerSearch>? Cus=null;
|
||||
private List<ForCustomerSearch>? Cus = null;
|
||||
private List<IdName<int>>? Patterns = null;
|
||||
private List<IdName<int>>? Units = null;
|
||||
private List<CODIdName<int>>? Cods = null;
|
||||
private CompanyDTO? InfoCompany = null;
|
||||
public InvoiceDTO? invoice { get; set; }=null;
|
||||
public InvoiceDTO? invoice { get; set; } = null;
|
||||
private DashBoardDTO? dashBoard { get; set; } = null;
|
||||
public Fixedvalues(HttpClientController hc)
|
||||
{
|
||||
_hc = hc;
|
||||
}
|
||||
public async Task<List<ForCustomerSearch>?> GetCustomers()
|
||||
{
|
||||
if (Cus == null)
|
||||
{
|
||||
if (Cus == null)
|
||||
{
|
||||
var request = await _hc.Get($"Customer/GetAllForidName");
|
||||
if (request.IsSuccessStatusCode)
|
||||
{
|
||||
Cus= await request.Content.ReadFromJsonAsync<List<ForCustomerSearch>>();
|
||||
Cus = await request.Content.ReadFromJsonAsync<List<ForCustomerSearch>>();
|
||||
}
|
||||
}
|
||||
|
||||
return Cus;
|
||||
|
||||
return Cus;
|
||||
|
||||
|
||||
}
|
||||
@@ -49,12 +51,12 @@ namespace Front
|
||||
}
|
||||
public async Task<List<IdName<int>>?> GetPatterns()
|
||||
{
|
||||
if (Patterns==null)
|
||||
if (Patterns == null)
|
||||
{
|
||||
var request = await _hc.Get($"Invoice/GetPatterns");
|
||||
if (request.IsSuccessStatusCode)
|
||||
{
|
||||
Patterns =await request.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||
Patterns = await request.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,5 +91,19 @@ namespace Front
|
||||
|
||||
return dashBoard;
|
||||
}
|
||||
public async Task<List<IdName<int>>> GetUnits()
|
||||
{
|
||||
if (Units == null)
|
||||
{
|
||||
var rsp = await _hc.Get("COD/GetUnits");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
Units = await rsp.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||
}
|
||||
}
|
||||
return Units;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user