Ok filtro x PlantId
This commit is contained in:
@@ -139,10 +139,11 @@ namespace GWMS.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<DatabaseModels.OrderModel> GetOrdersFilt()
|
||||
public List<DatabaseModels.OrderModel> GetOrdersFilt(int PlantId)
|
||||
{
|
||||
var dbResult = dbCtx
|
||||
.DbSetOrders
|
||||
.Where(x => (x.PlantId == PlantId || PlantId == 0))
|
||||
.Include(p => p.Plant)
|
||||
.Include(s => s.Supplier)
|
||||
.Include(t => t.Transporter)
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace GWMS.UI.Data
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.GetOrdersFilt();
|
||||
dbResult = dbController.GetOrdersFilt(CurrFilter.PlantId);
|
||||
rawData = JsonConvert.SerializeObject(dbResult);
|
||||
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
||||
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
<h1>Hello, world!</h1>
|
||||
|
||||
Welcome to your new app.
|
||||
|
||||
<SurveyPrompt Title="How is Blazor working for you?" />
|
||||
Da sistemare homepage...
|
||||
@@ -9,7 +9,33 @@
|
||||
Ordini
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
selettore PLANT
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="p-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<span class="oi oi-basket" aria-hidden="true"></span>
|
||||
</span>
|
||||
</div>
|
||||
<select @bind="@SelPlantId" class="form-control form-control-sm">
|
||||
<option value="0">--- Tutti ---</option>
|
||||
@if (PlantsList != null)
|
||||
{
|
||||
foreach (var item in PlantsList)
|
||||
{
|
||||
<option value="@item.PlantId">@item.PlantCode | @item.PlantDesc</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
aaaa
|
||||
</div>
|
||||
<div class="p-2">
|
||||
aaaa
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -56,7 +82,7 @@
|
||||
</div>
|
||||
<div class="small">@record.Transporter.TransporterCode | @record.Transporter.TransporterDesc</div>
|
||||
</td>
|
||||
<td class="text-right">@record.OrderQty</td>
|
||||
<td class="text-right">@record.OrderQty.ToString("N0")</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace GWMS.UI.Pages
|
||||
private OrderModel currRecord = null;
|
||||
|
||||
private List<OrderModel> ListRecords;
|
||||
private List<PlantDTO> PlantsList;
|
||||
private List<OrderModel> SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -24,6 +25,7 @@ namespace GWMS.UI.Pages
|
||||
#region Private Properties
|
||||
|
||||
private int _currPage { get; set; } = 1;
|
||||
|
||||
private int _numRecord { get; set; } = 10;
|
||||
|
||||
private int currPage
|
||||
@@ -34,7 +36,7 @@ namespace GWMS.UI.Pages
|
||||
if (_currPage != value)
|
||||
{
|
||||
_currPage = value;
|
||||
var pUpd = Task.Run(async () => await reloadData());
|
||||
var pUpd = Task.Run(async () => await ReloadData());
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
@@ -50,12 +52,31 @@ namespace GWMS.UI.Pages
|
||||
if (_numRecord != value)
|
||||
{
|
||||
_numRecord = value;
|
||||
var pUpd = Task.Run(async () => await reloadData());
|
||||
var pUpd = Task.Run(async () => await ReloadData());
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int SelPlantId
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
if (MessageService.Order_Filter != null)
|
||||
{
|
||||
answ = MessageService.Order_Filter.PlantId;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
MessageService.Order_Filter.PlantId = value;
|
||||
var pUpd = Task.Run(async () => await ReloadData());
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
private bool ShowCharts { get; set; } = false;
|
||||
|
||||
#endregion Private Properties
|
||||
@@ -108,7 +129,7 @@ namespace GWMS.UI.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task reloadData()
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await DataService.OrdersGetFilt(currFilter);
|
||||
@@ -136,7 +157,13 @@ namespace GWMS.UI.Pages
|
||||
MessageService.PageName = "Ordini";
|
||||
MessageService.PageIcon = "fas fa-file-invoice pr-2";
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
await reloadData();
|
||||
await ReloadAllData();
|
||||
}
|
||||
|
||||
protected async Task ReloadAllData()
|
||||
{
|
||||
PlantsList = await DataService.PlantsGetAll();
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected async Task ResetFilter(SelectOrderData newFilter)
|
||||
@@ -145,7 +172,7 @@ namespace GWMS.UI.Pages
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = SelectOrderData.Init(5, 7);
|
||||
await reloadData();
|
||||
await ReloadAllData();
|
||||
}
|
||||
|
||||
protected void Select(OrderModel selRecord)
|
||||
@@ -157,7 +184,7 @@ namespace GWMS.UI.Pages
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo statistiche MAPO</i>
|
||||
<h4>Versione: 1.0.2106.0318</h4>
|
||||
<h4>Versione: 1.0.2106.0319</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.2106.0318
|
||||
1.0.2106.0319
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.0.2106.0318</version>
|
||||
<version>1.0.2106.0319</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP-STATS/stable/0/GWMS.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP-STATS/stable/0/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user