|
|
|
@ -21,37 +21,28 @@ namespace ValblazeProject.Pages
|
|
|
|
|
public partial class Inventaire
|
|
|
|
|
{
|
|
|
|
|
/******************* Initialisation des attributs *******************/
|
|
|
|
|
private List<Item> items;
|
|
|
|
|
private int totalItem;
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public IStringLocalizer<List> Localizer { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public IDataService DataService { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public IWebHostEnvironment WebHostEnvironment { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public NavigationManager NavigationManager { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the java script runtime.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Inject]
|
|
|
|
|
internal IJSRuntime JavaScriptRuntime { get; set; }
|
|
|
|
|
|
|
|
|
|
[CascadingParameter]
|
|
|
|
|
public IModalService Modal { get; set; }
|
|
|
|
|
private List<Item> items;
|
|
|
|
|
private int totalItem;
|
|
|
|
|
|
|
|
|
|
private DataGrid<Item> dataGrid;
|
|
|
|
|
private string _searchText;
|
|
|
|
|
private int totalSizeByPage = 10;
|
|
|
|
|
private int totalSizeByPage = 5;
|
|
|
|
|
private bool _trie = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Autre
|
|
|
|
|
// Gestion logs
|
|
|
|
|
public ObservableCollection<CraftingAction> Actions { get; set; }
|
|
|
|
|
|
|
|
|
|
public Item CurrentDragItem { get; set; }
|
|
|
|
@ -68,7 +59,6 @@ namespace ValblazeProject.Pages
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Drag
|
|
|
|
|
|
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
|
{
|
|
|
|
|
base.OnAfterRenderAsync(firstRender);
|
|
|
|
@ -81,6 +71,8 @@ namespace ValblazeProject.Pages
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CraftingItem Drag;
|
|
|
|
|
|
|
|
|
|
public void OnDragEnter()
|
|
|
|
|
{
|
|
|
|
|
Drag.OnDragEnter();
|
|
|
|
@ -97,9 +89,7 @@ namespace ValblazeProject.Pages
|
|
|
|
|
{
|
|
|
|
|
Drag.OnDragLeave();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CraftingItem Drag;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************* Attribut modifier *******************/
|
|
|
|
|
private string search
|
|
|
|
@ -165,12 +155,6 @@ namespace ValblazeProject.Pages
|
|
|
|
|
|
|
|
|
|
if (!e.CancellationToken.IsCancellationRequested)
|
|
|
|
|
{
|
|
|
|
|
/* Il est important de découper le processus en 3 étapes:
|
|
|
|
|
1. le filtre
|
|
|
|
|
2. le tri
|
|
|
|
|
3. la pagination
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
items = await DataService.List();
|
|
|
|
|
|
|
|
|
|
// Search
|
|
|
|
@ -192,24 +176,5 @@ namespace ValblazeProject.Pages
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* private async void OnDelete(int id)
|
|
|
|
|
{
|
|
|
|
|
var parameters = new ModalParameters();
|
|
|
|
|
parameters.Add(nameof(Item.Id), id);
|
|
|
|
|
|
|
|
|
|
var modal = Modal.Show<DeleteConfirmation>("Delete Confirmation", parameters);
|
|
|
|
|
var result = await modal.Result;
|
|
|
|
|
|
|
|
|
|
if (result.Cancelled)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await DataService.Delete(id);
|
|
|
|
|
|
|
|
|
|
// Reload the page
|
|
|
|
|
NavigationManager.NavigateTo("list", true);
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|