2b4cad4234
- Inserito filtro in offerte in base allo stato
101 lines
2.2 KiB
C#
101 lines
2.2 KiB
C#
|
|
using EgwCoreLib.Lux.Data.DbModel.Warehouse;
|
|
|
|
namespace Lux.UI.Components.Pages
|
|
{
|
|
public partial class Dealer
|
|
{
|
|
|
|
#region Protected Methods
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
isLoading = true;
|
|
await ReloadBaseData();
|
|
isLoading = false;
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private DealerModel? editRecord = null;
|
|
|
|
private bool isLoading = false;
|
|
|
|
private List<DealerModel> ListDealer = new List<DealerModel>();
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
[Inject]
|
|
private IDealerService DService { get; set; } = null!;
|
|
private string searchVal { get; set; } = string.Empty;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private void DoAdd()
|
|
{
|
|
editRecord = new DealerModel()
|
|
{
|
|
CompanyName = "",
|
|
FirstName = "Nuovo cliente",
|
|
LastName = "Nuovo cliente",
|
|
VAT = ""
|
|
};
|
|
// manca aggiungere il record!!!!
|
|
}
|
|
|
|
private void DoCancel()
|
|
{
|
|
editRecord = null;
|
|
}
|
|
|
|
private async Task DoSaveSelCustomer(DealerModel currRec)
|
|
{
|
|
isLoading = true;
|
|
// salvo
|
|
//await CService.UpsertAsync(currRec);
|
|
editRecord = null;
|
|
await Task.Delay(100);
|
|
isLoading = false;
|
|
}
|
|
|
|
private void EditCustomer(DealerModel editRec)
|
|
{
|
|
editRecord = editRec;
|
|
}
|
|
|
|
private async Task ReloadBaseData()
|
|
{
|
|
ListDealer = await DService.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
|
|
}
|
|
} |