2b4cad4234
- Inserito filtro in offerte in base allo stato
99 lines
2.2 KiB
C#
99 lines
2.2 KiB
C#
|
|
namespace Lux.UI.Components.Pages
|
|
{
|
|
public partial class Customer
|
|
{
|
|
|
|
#region Protected Methods
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
isLoading = true;
|
|
await ReloadBaseData();
|
|
isLoading = false;
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private CustomerModel? editRecord = null;
|
|
|
|
private bool isLoading = false;
|
|
|
|
private List<CustomerModel> ListCustomer = new List<CustomerModel>();
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
[Inject]
|
|
private ICustomerService CService { get; set; } = null!;
|
|
|
|
private string searchVal { get; set; } = string.Empty;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private void DoAdd()
|
|
{
|
|
editRecord = new CustomerModel()
|
|
{
|
|
CompanyName = "",
|
|
FirstName = "Nuovo cliente",
|
|
LastName = "Nuovo cliente",
|
|
VAT = ""
|
|
};
|
|
// manca aggiungere il record!!!!
|
|
}
|
|
|
|
private void DoCancel()
|
|
{
|
|
editRecord = null;
|
|
}
|
|
|
|
private async Task DoSaveSelCustomer(CustomerModel currRec)
|
|
{
|
|
isLoading = true;
|
|
// salvo
|
|
//await CService.UpsertAsync(currRec);
|
|
editRecord = null;
|
|
await Task.Delay(100);
|
|
isLoading = false;
|
|
}
|
|
|
|
private void EditCustomer(CustomerModel editRec)
|
|
{
|
|
editRecord = editRec;
|
|
}
|
|
|
|
private async Task ReloadBaseData()
|
|
{
|
|
ListCustomer = await CService.GetAllAsync();
|
|
}
|
|
private string SearchVal
|
|
{
|
|
get => searchVal;
|
|
set
|
|
{
|
|
if (searchVal != value)
|
|
{
|
|
searchVal = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
private string btnResetCss
|
|
{
|
|
get => string.IsNullOrEmpty(searchVal) ? "btn-outline-secondary" : "btn-primary";
|
|
}
|
|
|
|
private void ResetSearch()
|
|
{
|
|
SearchVal = "";
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |