Inizio gestione spostamento categorie

This commit is contained in:
Samuele Locatelli
2024-02-12 19:09:46 +01:00
parent 2e90a1b081
commit b3ffbf1635
5 changed files with 47 additions and 225 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.0.2402.1218</Version>
<Version>2.0.2402.1219</Version>
<Copyright>Egalware 2021+</Copyright>
</PropertyGroup>
-14
View File
@@ -20,20 +20,6 @@ namespace SHERPA.BBM
Licenza = 10000
}
#if false
/// <summary>
/// Tipo Risorsa BBM
/// </summary>
public enum BbmResType
{
ND = 0,
HR = 1,
License = 2,
HW = 3,
Service = 4
}
#endif
/// <summary>
/// Tipo Tag
/// </summary>
+20 -77
View File
@@ -8,28 +8,9 @@
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-8">
<div class="col-12">
<h4><span class="fas fa-exchange-alt pr-3" aria-hidden="true"></span> Spostamento Item (in Categorie)</h4>
</div>
<div class="col-4 text-right">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="oi oi-calendar" aria-hidden="true"></span>
</span>
</div>
<select @bind="@YearSel" class="form-control form-control-sm">
<option value="0">--- Tutti ---</option>
@foreach (var item in yearsList)
{
<option value="@item">@item</option>
}
</select>
<div class="input-group-append">
<button class="@cssBtnResYear" @onclick="ResetYear"><i class="fas fa-undo"></i></button>
</div>
</div>
</div>
</div>
</div>
@@ -47,100 +28,62 @@
<div class="d-flex flex-column small">
<div class="py-1">
<div class="row">
<div class="col-4">
<label>Cliente:</label>
<div class="col-12">
<label>Categoria:</label>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-users" aria-hidden="true"></span>
<span class="fas fa-hashtag" aria-hidden="true"></span>
</span>
</div>
<select @bind="@SelCustomerIdSx" class="form-control form-control">
@foreach (var item in CustomersList)
<select @bind="@SelResTypeIdSx" class="form-control form-control">
@* <option value="1">-- Tutti ---</option> *@
@foreach (var item in ResTypeList)
{
<option value="@item.CustomerId">@item.RagSoc</option>
<option value="@item.ResTypeId">@item.Name [@item.ResTypeId]</option>
}
</select>
<div class="input-group-append">
<button class="@cssBtnResCustSx" @onclick="ResetCustSx"><i class="fas fa-undo"></i></button>
</div>
</div>
</div>
<div class="col-8">
<label>Basket:</label>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="oi oi-basket" aria-hidden="true"></span>
</span>
</div>
<select @bind="@SelBasketIdSx" class="form-control form-control">
<option value="1">-- Tutti ---</option>
@foreach (var item in BasketListSx)
{
<option value="@item.BasketId">@item.CodBasket - @item.Descript</option>
}
</select>
<div class="input-group-append">
<button class="@cssBtnResBaskSx" @onclick="ResetBasketSx"><i class="fas fa-undo"></i></button>
<button class="@cssBtnResBaskSx" @onclick="ResetResTypeSx"><i class="fas fa-undo"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
<NegotMovList AnnoSel="@YearSel" BaskIdSour="@SelBasketIdSx" MoveRequested="moveRight" CustomerId="SelCustomerIdSx"></NegotMovList>
@* <NegotMovList AnnoSel="@YearSel" BaskIdSour="@SelResTypeIdSx" MoveRequested="moveRight" CustomerId="SelCustomerIdSx"></NegotMovList> *@
</div>
<div class="col-6">
<div class="d-flex flex-column small">
<div class="py-1">
<div class="row">
<div class="col-4">
<label>Cliente:</label>
<div class="col-12">
<label>Categoria:</label>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-users" aria-hidden="true"></span>
<span class="fas fa-hashtag" aria-hidden="true"></span>
</span>
</div>
<select @bind="@SelCustomerIdDx" class="form-control form-control">
@foreach (var item in CustomersList)
<select @bind="@SelResTypeIdDx" class="form-control form-control">
@* <option value="1">--- Tutti ---</option> *@
@if (ResTypeList != null)
{
<option value="@item.CustomerId">@item.RagSoc</option>
}
</select>
<div class="input-group-append">
<button class="@cssBtnResCustDx" @onclick="ResetCustDx"><i class="fas fa-undo"></i></button>
</div>
</div>
</div>
<div class="col-8">
<label>Basket:</label>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="oi oi-basket" aria-hidden="true"></span>
</span>
</div>
<select @bind="@SelBasketIdDx" class="form-control form-control">
<option value="1">--- Tutti ---</option>
@if (BasketListDx != null)
{
@foreach (var item in BasketListDx)
@foreach (var item in ResTypeList)
{
<option value="@item.BasketId">@item.CodBasket - @item.Descript</option>
<option value="@item.ResTypeId">@item.Name [@item.ResTypeId]</option>
}
}
</select>
<div class="input-group-append">
<button class="@cssBtnResBaskDx" @onclick="ResetBasketDx"><i class="fas fa-undo"></i></button>
<button class="@cssBtnResBaskDx" @onclick="ResetResTypeDx"><i class="fas fa-undo"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
<NegotMovList AnnoSel="@YearSel" BaskIdSour="@SelBasketIdDx" MoveRequested="moveLeft" CustomerId="SelCustomerIdDx"></NegotMovList>
@* <NegotMovList AnnoSel="@YearSel" BaskIdSour="@SelResTypeIdDx" MoveRequested="moveLeft" CustomerId="SelCustomerIdDx"></NegotMovList> *@
</div>
</div>
}
+25 -132
View File
@@ -17,12 +17,10 @@ namespace SHERPA.BBM.UI.Pages
#region Protected Fields
protected int _dxBaskId = 1;
protected int _dxCustId = 1;
protected int _dxNegoId = 1;
protected int _sxBaskId = 1;
protected int _sxCustId = 1;
protected int _dxResTypeId = 0;
protected int _sxNegoId = 1;
protected int _sxResTypeId = 0;
#endregion Protected Fields
@@ -31,40 +29,25 @@ namespace SHERPA.BBM.UI.Pages
[Inject]
protected MessageService MService { get; set; } = null!;
protected int YearSel
{
get => yearSel;
set
{
if (yearSel != value)
{
yearSel = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
}
#endregion Protected Properties
#region Protected Methods
protected async Task moveLeft(int currIdx)
{
if (SelBasketIdSx > 0)
if (SelResTypeIdSx > 0)
{
// eseguo spostamento...
await BBMService.NegotiationMoveBasket(currIdx, SelBasketIdSx);
await BBMService.NegotiationMoveBasket(currIdx, SelResTypeIdSx);
}
}
protected async Task moveRight(int currIdx)
{
if (SelBasketIdDx > 0)
if (SelResTypeIdDx > 0)
{
// eseguo spostamento...
await BBMService.NegotiationMoveBasket(currIdx, SelBasketIdDx);
await BBMService.NegotiationMoveBasket(currIdx, SelResTypeIdDx);
}
}
@@ -78,30 +61,15 @@ namespace SHERPA.BBM.UI.Pages
isLoading = false;
}
protected async Task ReloadDataDx()
{
CustomersList = await BBMService.CustomersGetAll("");
BasketListDx = await BBMService.BasketsGetAsync(1, YearSel);
}
protected async Task ReloadDataSx()
{
CustomersList = await BBMService.CustomersGetAll("");
BasketListSx = await BBMService.BasketsGetAsync(1, YearSel);
}
#endregion Protected Methods
#region Private Fields
private List<vBasketsDataModel> BasketListDx = new List<vBasketsDataModel>();
private List<ItemResTypeModel> ResTypeList = new List<ItemResTypeModel>();
private List<vBasketsDataModel> BasketListSx = new List<vBasketsDataModel>();
private List<CustomersModel> CustomersList = new List<CustomersModel>();
private int yearSel = 0;
private List<int> yearsList = new List<int>();
private List<ItemResTypeModel> CatListSx = new List<ItemResTypeModel>();
#endregion Private Fields
@@ -109,90 +77,44 @@ namespace SHERPA.BBM.UI.Pages
private string cssBtnResBaskDx
{
get => SelBasketIdDx == 1 ? "btn btn-secondary" : "btn btn-primary";
get => SelResTypeIdDx == 0 ? "btn btn-secondary" : "btn btn-primary";
}
private string cssBtnResBaskSx
{
get => SelBasketIdSx == 1 ? "btn btn-secondary" : "btn btn-primary";
}
private string cssBtnResCustDx
{
get => SelCustomerIdDx == 1 ? "btn btn-secondary" : "btn btn-primary";
}
private string cssBtnResCustSx
{
get => SelCustomerIdSx == 1 ? "btn btn-secondary" : "btn btn-primary";
}
private string cssBtnResYear
{
get => YearSel == 0 ? "btn btn-secondary" : "btn btn-primary";
get => SelResTypeIdSx == 0 ? "btn btn-secondary" : "btn btn-primary";
}
private bool isLoading { get; set; } = false;
private int SelBasketIdDx
private int SelResTypeIdDx
{
get
{
return _dxBaskId;
return _dxResTypeId;
}
set
{
_dxBaskId = value;
_dxResTypeId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadDataDx());
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
private int SelBasketIdSx
private int SelResTypeIdSx
{
get
{
return _sxBaskId;
return _sxResTypeId;
}
set
{
_sxBaskId = value;
_sxResTypeId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadDataSx());
pUpd.Wait();
}
}
private int SelCustomerIdDx
{
get
{
return _dxCustId;
}
set
{
_dxCustId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadDataDx());
pUpd.Wait();
}
}
private int SelCustomerIdSx
{
get
{
return _sxCustId;
}
set
{
_sxCustId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadDataSx());
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
@@ -213,52 +135,23 @@ namespace SHERPA.BBM.UI.Pages
private async Task ReloadAllData()
{
yearsList = await BBMService.DocsYears();
await ReloadDataSx();
await ReloadDataDx();
ResTypeList = await BBMService.ItemResTypeGetAll();
}
private async Task ResetBasketDx()
private async Task ResetResTypeDx()
{
if (SelBasketIdDx != 1)
if (SelResTypeIdDx != 1)
{
SelBasketIdDx = 1;
SelResTypeIdDx = 0;
await Task.Delay(1);
}
}
private async Task ResetBasketSx()
private async Task ResetResTypeSx()
{
if (SelBasketIdSx != 1)
if (SelResTypeIdSx != 1)
{
SelBasketIdSx = 1;
await Task.Delay(1);
}
}
private async Task ResetCustDx()
{
if (SelCustomerIdDx != 1)
{
SelCustomerIdDx = 1;
await Task.Delay(1);
}
}
private async Task ResetCustSx()
{
if (SelCustomerIdSx != 1)
{
SelCustomerIdSx = 1;
await Task.Delay(1);
}
}
private async Task ResetYear()
{
if (YearSel != 0)
{
YearSel = 0;
SelResTypeIdSx = 0;
await Task.Delay(1);
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>60fcdaab-6c1e-4bec-9d88-f7727ef1c12c</UserSecretsId>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
<Version>2.0.2402.1218</Version>
<Version>2.0.2402.1219</Version>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Copyright>Egalware 2021+</Copyright>