aggiunta ricerca con campo libero e famiglia
This commit is contained in:
@@ -18,6 +18,9 @@ namespace StockMan.CORE.Components
|
||||
//public int CurrPage { get; set; } = 1;
|
||||
[Parameter]
|
||||
public ItemFamSelectFilter actFilter { get; set; } = new ItemFamSelectFilter();
|
||||
protected ItemSelectFilter itemFilter { get; set; } = new ItemSelectFilter();
|
||||
|
||||
|
||||
|
||||
[Inject]
|
||||
protected StockDataService SDService { get; set; } = null!;
|
||||
@@ -103,6 +106,7 @@ namespace StockMan.CORE.Components
|
||||
// await JSRuntime.InvokeVoidAsync("selectItem", id);
|
||||
//}
|
||||
currRowSel = item.Id;
|
||||
itemFilter.Id = item.Id;
|
||||
currModel = item;
|
||||
await selectedItemFam.InvokeAsync(currModel);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,23 @@
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-25">
|
||||
<label for="search">Search</label>
|
||||
<input id="search" @bind="searchVal" class="form-control" />
|
||||
<div class="w-50 d-flex justify-content-between">
|
||||
<div class="form-floating">
|
||||
|
||||
<input id="search" @bind="searchVal" class="form-control" />
|
||||
<label for="search">Search</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<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>
|
||||
<button data-bs-toggle="modal" data-bs-target="#modalNewFam" class="h-50 mt-4 buttonNew"><i class="fa-solid fa-plus"></i> NUOVO ARTICOLO</button>
|
||||
</div>
|
||||
|
||||
@@ -85,9 +85,9 @@ namespace StockMan.CORE.Components
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
if (searchVal != "")
|
||||
if (searchVal != "" || searchFamily != "*")
|
||||
{
|
||||
SearchRecords = await SDService.ItemsGetSearch(searchVal);
|
||||
SearchRecords = await SDService.ItemsGetSearch(searchVal, searchFamily);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -209,6 +209,16 @@ namespace StockMan.CORE.Components
|
||||
reloadData();
|
||||
}
|
||||
}
|
||||
//protected string _searchFamily = "";
|
||||
protected string searchFamily
|
||||
{
|
||||
get => actFilter.Id;
|
||||
set
|
||||
{
|
||||
actFilter.Id = value;
|
||||
reloadData();
|
||||
}
|
||||
}
|
||||
|
||||
protected string _descArt = "";
|
||||
protected string descArt
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
CurrPage = this.CurrPage,
|
||||
MaxRecord = this.MaxRecord,
|
||||
NumRec = this.NumRec,
|
||||
TotCount = this.TotCount
|
||||
TotCount = this.TotCount,
|
||||
};
|
||||
return clonedData;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
public int NumRec { get; set; } = 10;
|
||||
|
||||
public int TotCount { get; set; } = 0;
|
||||
public string Id { get; set; } = "*";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -31,7 +32,8 @@
|
||||
CurrPage = this.CurrPage,
|
||||
MaxRecord = this.MaxRecord,
|
||||
NumRec = this.NumRec,
|
||||
TotCount = this.TotCount
|
||||
TotCount = this.TotCount,
|
||||
Id = this.Id
|
||||
};
|
||||
return clonedData;
|
||||
}
|
||||
@@ -56,6 +58,9 @@
|
||||
if (CurrPage != item.CurrPage)
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace StockMan.CORE.Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento record selezionato
|
||||
/// Aggiornamento record selezionato famiglia item
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
@@ -122,6 +122,20 @@ namespace StockMan.CORE.Data
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiornamento record selezionato item
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ItemMod(ItemModel currRec)
|
||||
{
|
||||
var dbResult = await dbController.ItemMod(currRec);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{rKeyItems}:*");
|
||||
bool answ = await ExecFlushRedisPattern(pattern);
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -330,6 +344,46 @@ namespace StockMan.CORE.Data
|
||||
Log.Debug($"ItemsGetAll | {source} in: {ts.TotalMilliseconds} ms");
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Lista Location
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<LocationModel>> LocationGetAll()
|
||||
{
|
||||
string source = "DB";
|
||||
List<LocationModel>? dbResult = new List<LocationModel>();
|
||||
string currKey = $"{rKeyLocation}:*";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
source = "REDIS";
|
||||
var tempResult = JsonConvert.DeserializeObject<List<LocationModel>>(rawData);
|
||||
if (tempResult == null)
|
||||
{
|
||||
dbResult = new List<LocationModel>();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = tempResult;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.LocationGetAll();
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
}
|
||||
if (dbResult == null)
|
||||
{
|
||||
dbResult = new List<LocationModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"LocationGetAll | {source} in: {ts.TotalMilliseconds} ms");
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Lista Articoli da ricerca
|
||||
@@ -375,15 +429,27 @@ namespace StockMan.CORE.Data
|
||||
/// Lista Articoli da ricerca
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ItemModel>> ItemsGetSearch(string searcVal)
|
||||
public async Task<List<ItemModel>> ItemsGetSearch(string searcVal, string itemFamId)
|
||||
{
|
||||
string source = "DB";
|
||||
List<ItemModel>? dbResult = new List<ItemModel>();
|
||||
string currKey = $"{rKeyItems}:Search:{searcVal}";
|
||||
string currKey = "";
|
||||
if (itemFamId != "*" && string.IsNullOrEmpty(searcVal))
|
||||
{
|
||||
currKey = $"{rKeyItems}:Search:{searcVal}";
|
||||
}
|
||||
else if(!string.IsNullOrEmpty(searcVal) && itemFamId == "*")
|
||||
{
|
||||
currKey = $"{rKeyItems}:Family:{itemFamId}";
|
||||
}
|
||||
else
|
||||
{
|
||||
currKey = $"{rKeyItems}:Family:{itemFamId}:Search:{searcVal}";
|
||||
}
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
dbResult = dbController.ItemsGetSearch(searcVal);
|
||||
dbResult = dbController.ItemsGetSearch(searcVal, itemFamId);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
if (dbResult == null)
|
||||
|
||||
@@ -5,53 +5,78 @@
|
||||
{
|
||||
<div class="d-flex justify-content-between">
|
||||
|
||||
<div class="card my-2 col-4">
|
||||
<div class="card-header">
|
||||
Dettagli articolo
|
||||
<div class="card my-2 col-4 h-100">
|
||||
<div class="card-header d-flex justify-content-between ">
|
||||
<div class="d-flex flex-wrap align-content-center">
|
||||
Dettagli articolo
|
||||
</div>
|
||||
@if (!isMod)
|
||||
{
|
||||
<button class="btnMod" @onclick="()=>setEditMode()"><i class="fa-solid fa-pen-to-square"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="w-100">
|
||||
<div class="form-floating">
|
||||
<input id="famid" @bind-value="@itemToDet.ItemFamilyId" class="form-control w-100 w-100w-100 my-1" />
|
||||
<div class="w-100 modItem">
|
||||
<div class="form-floating mb-1">
|
||||
<select id="pos" @bind="@itemToDet.ItemFamilyId" class="form-select" style="@enable">
|
||||
@if (itemFams != null)
|
||||
{
|
||||
@foreach (var item in itemFams)
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="famid" class="form-label">Categoria</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<textarea id="descArt" @bind="@itemToDet.Descr" class="form-control w-100" rows="3"></textarea>
|
||||
<textarea id="descArt" @bind="@itemToDet.Descr" class="form-control w-100" rows="3" style="@enable"></textarea>
|
||||
<label for="descArt" class="form-label">Descr. Articolo</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input id="codArt" @bind="@itemToDet.CodInt" class="form-control w-100 my-1" />
|
||||
<input id="codArt" @bind="@itemToDet.CodInt" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="codArt" class="form-label">Cod. Articolo</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input id="codExt" @bind="@itemToDet.CodExt" class="form-control w-100 my-1" />
|
||||
<input id="codExt" @bind="@itemToDet.CodExt" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="codExt" class="form-label">Cod. Fornitore</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<textarea id="descExt" @bind="@itemToDet.DescrExt" class="form-control w-100" rows="5"></textarea>
|
||||
<textarea id="descExt" @bind="@itemToDet.DescrExt" class="form-control w-100" rows="5" style="@enable"></textarea>
|
||||
<label for="descExt" class="form-label">Descr. Fornitore</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input id="qtaMin" type="number" @bind="@itemToDet.QtaMin" class="form-control w-100 my-1" />
|
||||
<label for="qtaMin" class="form-label">Giacenza Minima</label>
|
||||
<div class="row">
|
||||
<div class="form-floating col">
|
||||
<input id="qtaMin" type="number" @bind="@itemToDet.QtaMin" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="qtaMin" class="form-label">Giacenza Minima</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<input id="qtaBatch" type="number" @bind="@itemToDet.QtaBatch" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="qtaBatch" class="form-label">Lotto Acquisto</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input id="qtaBatch" type="number" @bind="@itemToDet.QtaBatch" class="form-control w-100 my-1" />
|
||||
<label for="qtaBatch" class="form-label">Lotto Acquisto</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input id="currVal" type="number" @bind="@itemToDet.CurrValue" class="form-control w-100 my-1" />
|
||||
<label for="currVal" class="form-label">Valore Unit.</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input id="um" @bind="@itemToDet.Um" class="form-control w-100 my-1" />
|
||||
<label for="um" class="form-label">Unità di Misura</label>
|
||||
<div class="row">
|
||||
<div class="form-floating col">
|
||||
<input id="currVal" type="number" @bind="@itemToDet.CurrValue" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="currVal" class="form-label">Valore Unit.</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<input id="um" @bind="@itemToDet.Um" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="um" class="form-label">Unità di Misura</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (isMod)
|
||||
{
|
||||
<div class="text-end">
|
||||
<button class="btnAccept"><i class="fa-regular fa-circle-check" @onclick="()=>modItem()"></i></button>
|
||||
<button class="btnDecline"><i class="fa-solid fa-ban" data-bs-dismiss="modal"></i></button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="card my-2 col-5">
|
||||
<div class="card-header">
|
||||
<div class="card my-2 col-7 h-100 @cardCss">
|
||||
<div class="card-header @headerCss">
|
||||
Stock Giacenze
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -83,6 +108,113 @@
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<button class="btn btn-outline-primary col mx-1"><i class="fa-solid fa-download"></i> Conferma Movimenti</button>
|
||||
<button class="btn btn-outline-primary col mx-1">Elimina Duplicati <i class="fa-solid fa-delete-left"></i></button>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
@if (!isCarico)
|
||||
{
|
||||
<button class="btn btn-outline-success col mx-1" @onclick="()=>carico()"><i class="fa-solid fa-plus"></i> Carico</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-success col mx-1"><i class="fa-solid fa-plus"></i> Carico</button>
|
||||
}
|
||||
@if (!isScarico)
|
||||
{
|
||||
<button class="btn btn-outline-danger col mx-1" @onclick="()=>scarico()"><i class="fa-solid fa-minus"></i> Scarico</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-danger col mx-1"><i class="fa-solid fa-minus"></i> Scarico</button>
|
||||
}
|
||||
@if (!isRettifica)
|
||||
{
|
||||
<button class="btn btn-outline-warning col mx-1" @onclick="()=>rettifica()"><i class="fa-solid fa-pen-to-square"></i> Rettifica </button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-warning col mx-1"><i class="fa-solid fa-pen-to-square"></i> Rettifica </button>
|
||||
}
|
||||
</div>
|
||||
@if (isCarico || isScarico || isRettifica)
|
||||
{
|
||||
|
||||
<div class="my-2">
|
||||
<div class="form-floating col">
|
||||
@if (isCarico)
|
||||
{
|
||||
<select id="forn" @bind="@fornitore" class="form-select">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "FOR").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="forn" class="form-label">Fornitore </label>
|
||||
}
|
||||
else if (isScarico || isRettifica)
|
||||
{
|
||||
<select id="cliente" @bind="@cliente" class="form-select">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "CLI").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="cliente" class="form-label">Cliente </label>
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-floating col">
|
||||
<input id="doc" @bind="@documento" class="form-control w-100 my-1" />
|
||||
<label for="doc" class="form-label">Documento</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<input id="data" type="date" @bind="@dataDocumento" class="form-control w-100 my-1" />
|
||||
<label for="data" class="form-label">Data documento </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-floating col">
|
||||
<input id="qta" type="number" @bind="@qta" class="form-control w-100 my-1" />
|
||||
<label for="qta" class="form-label">Quantità</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<input id="importo" type="number" @bind="@importo" class="form-control w-100 my-1" />
|
||||
<label for="importo" class="form-label">Importo</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<select id="pos" @bind="@pos" class="form-select">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "MAG").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="pos" class="form-label">Posizione</label>
|
||||
</div>
|
||||
<div class="form-floating col mt-2">
|
||||
<textarea id="note" @bind="@note" class="form-control w-100" rows="3"></textarea>
|
||||
<label for="note" class="form-label">Note</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
@if (!string.IsNullOrEmpty(fornitore) && !string.IsNullOrEmpty(pos))
|
||||
{
|
||||
<button class="btnAccept"><i class="fa-regular fa-circle-check" @onclick="()=>modItem()"></i></button>
|
||||
}
|
||||
<button class="btnDecline"><i class="fa-solid fa-ban" data-bs-dismiss="modal"></i></button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace StockMan.CORE.Pages
|
||||
protected List<ItemFamilyModel> itemFams { get; set; } = new List<ItemFamilyModel>();
|
||||
protected List<ItemFluxModel> itemFlux { get; set; } = new List<ItemFluxModel>();
|
||||
protected List<ItemModel> listItemsSearch { get; set; } = new List<ItemModel>();
|
||||
protected List<LocationModel> listLocation { get; set; } = new List<LocationModel>();
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
@@ -43,7 +44,7 @@ namespace StockMan.CORE.Pages
|
||||
}
|
||||
private async Task reloadData()
|
||||
{
|
||||
listItemsSearch = await SDService.ItemsGetSearch(ItemID.ToString());
|
||||
listItemsSearch = await SDService.ItemsGetSearch(ItemID.ToString(), "*");
|
||||
if (listItemsSearch != null)
|
||||
{
|
||||
itemToDet = listItemsSearch.FirstOrDefault();
|
||||
@@ -53,8 +54,107 @@ namespace StockMan.CORE.Pages
|
||||
|
||||
itemFlux = await SDService.ItemFluxGetById(itemToDet.Id);
|
||||
|
||||
itemFams = await SDService.ItemFamilyGetAll();
|
||||
|
||||
listLocation = await SDService.LocationGetAll();
|
||||
|
||||
await Task.Delay(1);
|
||||
}
|
||||
private async Task setEditMode()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
isMod = true;
|
||||
}
|
||||
protected int ItemID { get; set; } = 0;
|
||||
protected bool isMod { get; set; } = false;
|
||||
protected bool isCarico { get; set; } = false;
|
||||
protected bool isScarico { get; set; } = false;
|
||||
protected bool isRettifica { get; set; } = false;
|
||||
protected async Task modItem()
|
||||
{
|
||||
var done = await SDService.ItemMod(itemToDet);
|
||||
if (done)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
protected void carico()
|
||||
{
|
||||
isScarico = false;
|
||||
isRettifica = false;
|
||||
isCarico = true;
|
||||
}
|
||||
protected void scarico()
|
||||
{
|
||||
isRettifica = false;
|
||||
isCarico = false;
|
||||
isScarico = true;
|
||||
}
|
||||
protected void rettifica()
|
||||
{
|
||||
isScarico = false;
|
||||
isCarico = false;
|
||||
isRettifica = true;
|
||||
}
|
||||
protected string enable
|
||||
{
|
||||
get => isMod ? "Background-color: #fff" : "pointer-events: none";
|
||||
}
|
||||
protected string headerCss
|
||||
{
|
||||
get => (isCarico || isScarico || isRettifica) ? "bg-primary" : "";
|
||||
}
|
||||
protected string cardCss
|
||||
{
|
||||
get => (isCarico || isScarico || isRettifica) ? "border border-primary" : "";
|
||||
}
|
||||
protected string _fornitore { get; set; } = "";
|
||||
protected string fornitore
|
||||
{
|
||||
get => _fornitore;
|
||||
set => _fornitore = value;
|
||||
}
|
||||
protected string _cliente{ get; set; } = "";
|
||||
protected string cliente
|
||||
{
|
||||
get => _cliente;
|
||||
set => _cliente = value;
|
||||
}
|
||||
protected string _documento{ get; set; } = "RDA/DDT/FT";
|
||||
protected string documento
|
||||
{
|
||||
get => _documento;
|
||||
set => _documento = value;
|
||||
}
|
||||
protected DateTime _dataDocumento{ get; set; } = DateTime.Now.Date;
|
||||
protected DateTime dataDocumento
|
||||
{
|
||||
get => _dataDocumento;
|
||||
set => _dataDocumento = value;
|
||||
}
|
||||
protected int _qta{ get; set; } = 0;
|
||||
protected int qta
|
||||
{
|
||||
get => _qta;
|
||||
set => _qta = value;
|
||||
}
|
||||
protected decimal _importo { get; set; } = 0.00M;
|
||||
protected decimal importo
|
||||
{
|
||||
get => _importo;
|
||||
set => _importo = value;
|
||||
}
|
||||
protected string _pos { get; set; } = "";
|
||||
protected string pos
|
||||
{
|
||||
get => _pos;
|
||||
set => _pos = value;
|
||||
}
|
||||
protected string _note { get; set; } = "";
|
||||
protected string note
|
||||
{
|
||||
get => _note;
|
||||
set => _note = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,54 @@
|
||||
/*input, textarea{
|
||||
border: none;
|
||||
border-bottom: 1px solid #000;
|
||||
}*/
|
||||
input,
|
||||
textarea {
|
||||
.modItem input,
|
||||
.modItem textarea,
|
||||
.modItem select {
|
||||
font-size: 0.8rem;
|
||||
width: 80%;
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
.buttonGlobal {
|
||||
border-radius: 50%;
|
||||
padding: 0.5rem;
|
||||
width: 2.8rem;
|
||||
height: 2.8rem;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
.btnMod {
|
||||
border-radius: 50%;
|
||||
padding: 0.5rem;
|
||||
width: 2.8rem;
|
||||
height: 2.8rem;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
margin-right: 1rem;
|
||||
background-color: rgba(52, 152, 219, 0.2);
|
||||
color: #3498DB;
|
||||
}
|
||||
.btnAccept {
|
||||
border-radius: 50%;
|
||||
padding: 0.5rem;
|
||||
width: 2.8rem;
|
||||
height: 2.8rem;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
margin-right: 1rem;
|
||||
background-color: rgba(86, 184, 167, 0.2);
|
||||
color: #56b8a7;
|
||||
}
|
||||
.btnDecline {
|
||||
border-radius: 50%;
|
||||
padding: 0.5rem;
|
||||
width: 2.8rem;
|
||||
height: 2.8rem;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
margin-right: 1rem;
|
||||
background-color: rgba(192, 57, 43, 0.2);
|
||||
color: #C0392B;
|
||||
}
|
||||
/*label {
|
||||
font-weight: bold;
|
||||
|
||||
@@ -1,14 +1,36 @@
|
||||
/*input, textarea{
|
||||
border: none;
|
||||
border-bottom: 1px solid #000;
|
||||
}*/
|
||||
|
||||
|
||||
input, textarea {
|
||||
.modItem input, .modItem textarea, .modItem select {
|
||||
font-size: 0.8rem;
|
||||
width: 80%;
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
|
||||
.buttonGlobal {
|
||||
border-radius: 50%;
|
||||
padding: 0.5rem;
|
||||
width: 2.8rem;
|
||||
height: 2.8rem;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.btnMod {
|
||||
.buttonGlobal;
|
||||
background-color: rgba(52, 152, 219, 0.2);
|
||||
color: #3498DB;
|
||||
}
|
||||
|
||||
.btnAccept {
|
||||
.buttonGlobal;
|
||||
background-color: rgba(86,184,167,0.2);
|
||||
color: #56b8a7;
|
||||
}
|
||||
|
||||
.btnDecline {
|
||||
.buttonGlobal;
|
||||
background-color: rgba(192, 57, 43, 0.2);
|
||||
color: #C0392B;
|
||||
}
|
||||
/*label {
|
||||
font-weight: bold;
|
||||
font-size: 0.8rem;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
input,textarea{font-size:.8rem;width:80%;}
|
||||
.modItem input,.modItem textarea,.modItem select{font-size:.8rem;background-color:#e9ecef;}.buttonGlobal{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;}.btnMod{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(52,152,219,.2);color:#3498db;}.btnAccept{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(86,184,167,.2);color:#56b8a7;}.btnDecline{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(192,57,43,.2);color:#c0392b;}
|
||||
@@ -6,7 +6,8 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
@*<meta name="viewport" content="width=device-width, initial-scale=1.0" />*@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="google" content="notranslate">
|
||||
<base href="~/" />
|
||||
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
|
||||
|
||||
@@ -93,26 +93,26 @@ namespace StockMan.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modifica Famiglie Articoli
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ItemFamilyModel> ItemFamilyMod()
|
||||
{
|
||||
List<ItemFamilyModel> dbResult = new List<ItemFamilyModel>();
|
||||
using (StockManContext localDbCtx = new StockManContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetItemFamily
|
||||
.OrderBy(x => x.Descr)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
///// <summary>
|
||||
///// Modifica Famiglie Articoli
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//public List<ItemFamilyModel> ItemFamilyMod()
|
||||
//{
|
||||
// List<ItemFamilyModel> dbResult = new List<ItemFamilyModel>();
|
||||
// using (StockManContext localDbCtx = new StockManContext(_configuration))
|
||||
// {
|
||||
// dbResult = localDbCtx
|
||||
// .DbSetItemFamily
|
||||
// .OrderBy(x => x.Descr)
|
||||
// .ToList();
|
||||
// }
|
||||
// return dbResult;
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Lista Item Flux (ALL!)
|
||||
/// Modifica famiglia articoli
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ItemFamilyMod(ItemFamilyModel editRec)
|
||||
@@ -147,6 +147,43 @@ namespace StockMan.Data.Controllers
|
||||
}
|
||||
return fatto;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Modifica item,
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ItemMod(ItemModel editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
List<ItemModel> dbResult = new List<ItemModel>();
|
||||
using (StockManContext localDbCtx = new StockManContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = localDbCtx
|
||||
.DbSetItem
|
||||
.Where(x => x.Id == editRec.Id)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec = editRec;
|
||||
}
|
||||
else
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetItem
|
||||
.Add(editRec);
|
||||
}
|
||||
await localDbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante ItemMod{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -294,12 +331,12 @@ namespace StockMan.Data.Controllers
|
||||
/// Lista Items da ricerca
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ItemModel> ItemsGetSearch(string searchVal)
|
||||
public List<ItemModel> ItemsGetSearch(string searchVal, string itemFamId)
|
||||
{
|
||||
List<ItemModel> dbResult = new List<ItemModel>();
|
||||
using (StockManContext localDbCtx = new StockManContext(_configuration))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(searchVal))
|
||||
if (!string.IsNullOrEmpty(searchVal) && itemFamId == "*")
|
||||
{
|
||||
var risultato = localDbCtx
|
||||
.DbSetItem
|
||||
@@ -311,6 +348,30 @@ namespace StockMan.Data.Controllers
|
||||
dbResult = risultato;
|
||||
}
|
||||
}
|
||||
else if(itemFamId != "*" && string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
var risultato = localDbCtx
|
||||
.DbSetItem
|
||||
.Where(x => ((x.ItemFamilyId == itemFamId)))
|
||||
.ToList();
|
||||
|
||||
if (risultato != null)
|
||||
{
|
||||
dbResult = risultato;
|
||||
}
|
||||
}
|
||||
else if(itemFamId != "*" && !string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
var risultato = localDbCtx
|
||||
.DbSetItem
|
||||
.Where(x => ((x.ItemFamilyId == itemFamId) && ((x.CodInt.Contains(searchVal)) || (x.CodExt.Contains(searchVal)) || (x.Descr.Contains(searchVal) || (x.CurrValue.ToString().Contains(searchVal))))))
|
||||
.ToList();
|
||||
|
||||
if (risultato != null)
|
||||
{
|
||||
dbResult = risultato;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
|
||||
Reference in New Issue
Block a user