fix creazione nuovo operatore
+ fix grafici
This commit is contained in:
@@ -8,75 +8,85 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between">
|
||||
<div>
|
||||
Famiglie Articoli
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" data-bs-toggle="modal" data-bs-target="#modalNewFam" class="btn btn-sm btn-success"><i class="fa-solid fa-plus"></i> Aggiunta nuova famiglia</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr class="small">
|
||||
@if (!editMode)
|
||||
{
|
||||
<th>
|
||||
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr class="small">
|
||||
@if (!editMode)
|
||||
{
|
||||
<th>
|
||||
<button type="button" data-bs-toggle="modal" data-bs-target="#modalNewFam" class="buttonNew"><i class="fa-solid fa-plus"></i> Aggiunta nuova famiglia</button>
|
||||
</th>
|
||||
}
|
||||
<th>
|
||||
ID UNIVOCO
|
||||
</th>
|
||||
<th>
|
||||
CATEGORIA
|
||||
</th>
|
||||
<th>
|
||||
# ARTICOLI
|
||||
</th>
|
||||
<th>
|
||||
</th>
|
||||
}
|
||||
<th>
|
||||
ID UNIVOCO
|
||||
</th>
|
||||
<th>
|
||||
CATEGORIA
|
||||
</th>
|
||||
<th>
|
||||
# ARTICOLI
|
||||
</th>
|
||||
<th>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ListRecord)
|
||||
{
|
||||
<tr class="small">
|
||||
@if (!editMode)
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ListRecord)
|
||||
{
|
||||
<td class="d-flex justify-content-center">
|
||||
<button class="btnDet" @onclick="()=>selectItem(item)" title=@($"Selezionare la famiglia di articoli: {item.Id}")><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
<button class="btnEdit" @onclick="()=>enableEdit(item.Id)" title=@($"Modificare la famiglia di articoli: {item.Id}")><i class="fa-solid fa-pen-to-square"></i></button>
|
||||
</td>
|
||||
<tr class="small">
|
||||
@if (!editMode)
|
||||
{
|
||||
<td class="d-flex justify-content-center">
|
||||
<button class="btnDet" @onclick="()=>selectItem(item)" title=@($"Selezionare la famiglia di articoli: {item.Id}")><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
<button class="btnEdit" @onclick="()=>enableEdit(item.Id)" title=@($"Modificare la famiglia di articoli: {item.Id}")><i class="fa-solid fa-pen-to-square"></i></button>
|
||||
</td>
|
||||
}
|
||||
<td>
|
||||
@item.Id
|
||||
</td>
|
||||
<td>
|
||||
@if (editMode && (item.Id == currRowSel))
|
||||
{
|
||||
<input @bind="@item.Descr" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>
|
||||
@item.Descr
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@item.NumItems
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (item.NumItems == 0 && !editMode)
|
||||
{
|
||||
<button class="btnDel" @onclick="()=>deleteItemFam(item)"><i class="fa-solid fa-trash-can"></i></button>
|
||||
}
|
||||
else if (editMode && (item.Id == currRowSel))
|
||||
{
|
||||
<button class="btnAccept" @onclick="()=>editItemFam(item)"><i class="fa-solid fa-cloud-arrow-up"></i></button>
|
||||
<button class="btnDecline" @onclick="()=>disableEdit()"><i class="fa-solid fa-ban"></i></button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<td>
|
||||
@item.Id
|
||||
</td>
|
||||
<td >
|
||||
@if (editMode && (item.Id == currRowSel))
|
||||
{
|
||||
<input @bind="@item.Descr" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>
|
||||
@item.Descr
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@item.NumItems
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (item.NumItems == 0 && !editMode)
|
||||
{
|
||||
<button class="btnDel" @onclick="()=>deleteItemFam(item)"><i class="fa-solid fa-trash-can"></i></button>
|
||||
}
|
||||
else if (editMode && (item.Id == currRowSel))
|
||||
{
|
||||
<button class="btnAccept" @onclick="()=>editItemFam(item)"><i class="fa-solid fa-cloud-arrow-up"></i></button>
|
||||
<button class="btnDecline" @onclick="()=>disableEdit()"><i class="fa-solid fa-ban"></i></button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modalNewFam" tabindex="-1" aria-hidden="true">
|
||||
@@ -84,10 +94,10 @@ else
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Aggiungere nuova famiglia articoli</h1>
|
||||
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex justify-content-between">
|
||||
<input placeholder="ID UNIVOCO" @bind=@idUnivoco />
|
||||
<textarea placeholder="Descrizione" @bind=@descrizione></textarea>
|
||||
</div>
|
||||
|
||||
@@ -1,162 +1,166 @@
|
||||
<div class="row">
|
||||
<div class="w-50 d-flex row pb-1 col">
|
||||
<div class="form-floating col ps-1">
|
||||
<select id="fam" @bind="searchFamily" class="form-select">
|
||||
<option value="*">--TUTTI--</option>
|
||||
@if (itemFamList != null)
|
||||
{
|
||||
@foreach (var item in itemFamList)
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="fam">Famiglia articoli</label>
|
||||
</div>
|
||||
<div class="form-floating col ps-1">
|
||||
<input id="search" @bind="searchVal" class="form-control" />
|
||||
<label for="search">Search</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-end pe-4">
|
||||
<button data-bs-toggle="modal" data-bs-target="#modalNewFam" class="btnAccept" title="Aggiungere nuovo articolo"><i class="fa-solid fa-plus"></i></button>
|
||||
</div>
|
||||
@*<button data-bs-toggle="modal" data-bs-target="#modalNewFam" class="h-50 mt-4 btnAccept"><i class="fa-solid fa-plus"></i></button>*@
|
||||
</div>
|
||||
@if (isLoading)
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
@if (ListRecord == null || ListRecord.Count == 0)
|
||||
else if (ListRecord == null || ListRecord.Count == 0)
|
||||
{
|
||||
<b>nessun record</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr class="small row col-12">
|
||||
<th class="col-1">
|
||||
</th>
|
||||
|
||||
<th class="col-3">
|
||||
<div class="row">
|
||||
<div class="d-flex text-center" @onclick="()=>orderByCodInt()">
|
||||
COD. ARTICOLO
|
||||
@if (orderType == orderTypeEnum.codIntAscending)
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="w-50 d-flex row pb-1 col">
|
||||
<div class="form-floating col ps-1">
|
||||
<select id="fam" @bind="searchFamily" class="form-select">
|
||||
<option value="*">--TUTTI--</option>
|
||||
@if (itemFamList != null)
|
||||
{
|
||||
<i class="fa-solid fa-sort-up text-primary mx-2"></i>
|
||||
@foreach (var item in itemFamList)
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
else if (orderType == orderTypeEnum.codIntDescending)
|
||||
</select>
|
||||
<label for="fam">Famiglia articoli</label>
|
||||
</div>
|
||||
<div class="form-floating col ps-1">
|
||||
<input id="search" @bind="searchVal" class="form-control" />
|
||||
<label for="search">Search</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-end pe-4">
|
||||
<button data-bs-toggle="modal" data-bs-target="#modalNewFam" class="btn btn-success" title="Aggiungere nuovo articolo"><i class="fa-solid fa-plus"></i> Aggiungi nuovo articolo</button>
|
||||
</div>
|
||||
@*<button data-bs-toggle="modal" data-bs-target="#modalNewFam" class="h-50 mt-4 btnAccept"><i class="fa-solid fa-plus"></i></button>*@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr class="small row col-12">
|
||||
<th class="col-1">
|
||||
</th>
|
||||
|
||||
<th class="col-3">
|
||||
<div class="row">
|
||||
<div class="d-flex text-center" @onclick="()=>orderByCodInt()">
|
||||
COD. ARTICOLO
|
||||
@if (orderType == orderTypeEnum.codIntAscending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-up text-primary mx-2"></i>
|
||||
}
|
||||
else if (orderType == orderTypeEnum.codIntDescending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-down text-primary mx-2"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-solid fa-sort text-primary mx-2"></i>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex text-secondary fst-italic text-center" @onclick="()=>orderByCodForn()">
|
||||
COD. FORNITORE
|
||||
@if (orderType == orderTypeEnum.codExtAscending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-up text-primary mx-2"></i>
|
||||
}
|
||||
else if (orderType == orderTypeEnum.codExtDescending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-down text-primary mx-2"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-solid fa-sort text-primary mx-2"></i>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th class="col-4">
|
||||
<div class="row">
|
||||
<div>
|
||||
DESC. ARTICOLO
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="text-secondary fst-italic">
|
||||
DESC. FORNITORE
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th @onclick="()=>orderByStock()" class="col-1">
|
||||
STOCK
|
||||
@if (orderType == orderTypeEnum.stockAscending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-down text-primary mx-2"></i>
|
||||
<i class="fa-solid fa-sort-down text-primary"></i>
|
||||
}
|
||||
else if (orderType == orderTypeEnum.stockDescending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-up text-primary"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-solid fa-sort text-primary mx-2"></i>
|
||||
<i class="fa-solid fa-sort text-primary"></i>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex text-secondary fst-italic text-center" @onclick="()=>orderByCodForn()">
|
||||
COD. FORNITORE
|
||||
@if (orderType == orderTypeEnum.codExtAscending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-up text-primary mx-2"></i>
|
||||
}
|
||||
else if (orderType == orderTypeEnum.codExtDescending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-down text-primary mx-2"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-solid fa-sort text-primary mx-2"></i>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th class="col-4">
|
||||
<div class="row">
|
||||
<div>
|
||||
DESC. ARTICOLO
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="text-secondary fst-italic">
|
||||
DESC. FORNITORE
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th @onclick="()=>orderByStock()"class="col-1">
|
||||
STOCK
|
||||
@if (orderType == orderTypeEnum.stockAscending)
|
||||
</th>
|
||||
<th class="col-1">
|
||||
VALORE UNIT.
|
||||
</th>
|
||||
<th class="col-1">
|
||||
VALORE TOT.
|
||||
</th>
|
||||
<th class="col-1">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ListRecord)
|
||||
{
|
||||
<i class="fa-solid fa-sort-down text-primary"></i>
|
||||
<tr class="small row col-12">
|
||||
<td class="text-center col-1">
|
||||
<button class="btnDet" @onclick="()=>selItemToDet(item.Id)" title=@($"Mostra dettagli oggetto {item.CodInt}")><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>
|
||||
<td class="col-3" style="font-size: 14px;">
|
||||
@item.CodInt
|
||||
<div class="small text-secondary fst-italic">
|
||||
@item.CodExt
|
||||
</div>
|
||||
</td>
|
||||
<td class="small col-4">
|
||||
<div class="row">
|
||||
<span class="d-inline-block text-truncate" style="max-width: 100%;" title="@item.Descr">
|
||||
@item.Descr
|
||||
</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="d-inline-block text-truncate text-secondary fst-italic" style="max-width: 100%;" title="@item.DescrExt">
|
||||
@item.DescrExt
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center col-1">
|
||||
<div>
|
||||
@item.QtaBatch
|
||||
</div>
|
||||
</td>
|
||||
<td class="small text-center col-1">
|
||||
@($"{item.CurrValue:C2}")
|
||||
</td>
|
||||
<td class="small text-center col-1">
|
||||
@($"{(item.CurrValue * item.QtaBatch):C2}")
|
||||
</td>
|
||||
<td class="text-center col-1">
|
||||
<button class="btnDup" data-bs-toggle="modal" data-bs-target="#modalNewFam" @onclick="()=>dupItem(item)" title=@($"Duplica oggetto {item.CodInt}")><i class="fa-solid fa-copy"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
else if (orderType == orderTypeEnum.stockDescending)
|
||||
{
|
||||
<i class="fa-solid fa-sort-up text-primary"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-solid fa-sort text-primary"></i>
|
||||
}
|
||||
</th>
|
||||
<th class="col-1">
|
||||
VALORE UNIT.
|
||||
</th>
|
||||
<th class="col-1">
|
||||
VALORE TOT.
|
||||
</th>
|
||||
<th class="col-1">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ListRecord)
|
||||
{
|
||||
<tr class="small row col-12">
|
||||
<td class="text-center col-1">
|
||||
<button class="btnDet" @onclick="()=>selItemToDet(item.Id)" title=@($"Mostra dettagli oggetto {item.CodInt}")><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>
|
||||
<td class="col-3" style="font-size: 14px;">
|
||||
@item.CodInt
|
||||
<div class="small text-secondary fst-italic">
|
||||
@item.CodExt
|
||||
</div>
|
||||
</td>
|
||||
<td class="small col-4">
|
||||
<div class="row">
|
||||
<span class="d-inline-block text-truncate" style="max-width: 100%;" title="@item.Descr">
|
||||
@item.Descr
|
||||
</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="d-inline-block text-truncate text-secondary fst-italic" style="max-width: 100%;" title="@item.DescrExt">
|
||||
@item.DescrExt
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center col-1">
|
||||
<div>
|
||||
@item.QtaBatch
|
||||
</div>
|
||||
</td>
|
||||
<td class="small text-center col-1">
|
||||
@($"{item.CurrValue:C2}")
|
||||
</td>
|
||||
<td class="small text-center col-1">
|
||||
@($"{(item.CurrValue * item.QtaBatch):C2}")
|
||||
</td>
|
||||
<td class="text-center col-1">
|
||||
<button class="btnDup" data-bs-toggle="modal" data-bs-target="#modalNewFam" @onclick="()=>dupItem(item)" title=@($"Duplica oggetto {item.CodInt}")><i class="fa-solid fa-copy"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modalNewFam" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
@page "/AnagraficaArticoli"
|
||||
|
||||
<div class="ps-2 pe-1">
|
||||
<ItemList updateRecordCount="UpdateTotCount" actFilter="@currFilter"></ItemList>
|
||||
|
||||
<DataPager @ref="pagerFamArt" PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" showLoading="@isLoading" />
|
||||
<div>
|
||||
<ItemList updateRecordCount="UpdateTotCount" actFilter="@currFilter"></ItemList>
|
||||
</div>
|
||||
<div>
|
||||
<DataPager @ref="pagerFamArt" PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" showLoading="@isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,8 +12,13 @@ else if (listOprAll == null)
|
||||
else
|
||||
{
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Lista Operatori
|
||||
<div class="card-header d-flex justify-content-between">
|
||||
<div class="py-1">
|
||||
Lista Operatori
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#modalNewFam">Aggiungi Operatore</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped">
|
||||
@@ -70,7 +75,7 @@ else
|
||||
<label for="codExt" class="form-label">Codice esterno</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input id="Cognome" @bind="@Cognome" class="form-control w-100 my-1" />
|
||||
<input id="Cognome" @bind="@Cognome" class="form-control w-100 my-1" />
|
||||
<label for="Cognome" class="form-label">Cognome</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
@@ -79,7 +84,7 @@ else
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-5">
|
||||
@if (currOpr != null)
|
||||
@if (currOpr == null)
|
||||
{
|
||||
|
||||
<button class="btn btn-success" @onclick="()=>addNewItem()"><i class="fa-regular fa-circle-check"></i></button>
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace StockMan.CORE.Pages
|
||||
{
|
||||
OperatorModel currRecToMod = new OperatorModel()
|
||||
{
|
||||
Id = Id,
|
||||
CodExt = CodExt,
|
||||
LastName = Cognome,
|
||||
FirstName = Nome
|
||||
@@ -55,6 +56,7 @@ namespace StockMan.CORE.Pages
|
||||
{
|
||||
OperatorModel currRecToMod = new OperatorModel()
|
||||
{
|
||||
Id = $"{Nome.Substring(0,1)}{Cognome.Substring(0,1)}".ToUpper(),
|
||||
CodExt = CodExt,
|
||||
LastName = Cognome,
|
||||
FirstName = Nome
|
||||
@@ -68,6 +70,7 @@ namespace StockMan.CORE.Pages
|
||||
protected async Task setCurrOpr(OperatorModel currRecToMod)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
Id = currRecToMod.Id;
|
||||
CodExt = currRecToMod.CodExt;
|
||||
Cognome = currRecToMod.LastName;
|
||||
Nome = currRecToMod.FirstName;
|
||||
@@ -82,6 +85,15 @@ namespace StockMan.CORE.Pages
|
||||
_CodExt = value;
|
||||
}
|
||||
}
|
||||
protected string _Id = "";
|
||||
protected string Id
|
||||
{
|
||||
get => _Id;
|
||||
set
|
||||
{
|
||||
_Id = value;
|
||||
}
|
||||
}
|
||||
protected string _Cognome = "";
|
||||
protected string Cognome
|
||||
{
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace StockMan.Data.Controllers
|
||||
{
|
||||
var currRec = localDbCtx
|
||||
.DbSetOperator
|
||||
.Where(x => x.CodExt == editRec.CodExt)
|
||||
.Where(x => x.Id == editRec.Id)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user