Gestioen QRCode filt
- completata correzione selezione con distinct - fix join come richeista Gian
This commit is contained in:
@@ -85,7 +85,7 @@ namespace MP.AppAuth.Controllers
|
||||
// ritorno
|
||||
return dbResult;
|
||||
}
|
||||
public List<Models.AnagraficaOperatori> AnagOpByGruppoGetAll(string codGruppo, string searchVal)
|
||||
public List<Models.AnagraficaOperatori> AnagOpByGruppoGetFilt(string codGruppo, string searchVal)
|
||||
{
|
||||
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
|
||||
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||
@@ -94,25 +94,27 @@ namespace MP.AppAuth.Controllers
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetGruppi2Oper
|
||||
.Where(x => x.CodGruppo == codGruppo)
|
||||
.Where(x => x.CodGruppo == codGruppo || string.IsNullOrEmpty(codGruppo))
|
||||
.Join(
|
||||
localDbCtx.DbSetAnagOpr.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal)),
|
||||
gruppo => gruppo.MatrOpr,
|
||||
operatore => operatore.MatrOpr,
|
||||
(gruppo, operatore) => operatore
|
||||
).ToList();
|
||||
)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetGruppi2Oper
|
||||
.Where(x => x.CodGruppo == codGruppo)
|
||||
.Where(x => x.CodGruppo == codGruppo || string.IsNullOrEmpty(codGruppo))
|
||||
.Join(
|
||||
localDbCtx.DbSetAnagOpr,
|
||||
gruppo => gruppo.MatrOpr,
|
||||
operatore => operatore.MatrOpr,
|
||||
(gruppo, operatore) => operatore
|
||||
).ToList();
|
||||
)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
// ritorno
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
{
|
||||
<div class="input-group input-group-sm">
|
||||
<select @bind="@PageSize" class="form-control form-control-sm">
|
||||
<option value="2">2</option>
|
||||
<option value="4">4</option>
|
||||
<option value="10">10</option>
|
||||
<option value="3">3</option>
|
||||
<option value="6">6</option>
|
||||
<option value="9">9</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace MP.Land.Components
|
||||
|
||||
protected int _numPage { get; set; } = 1;
|
||||
|
||||
protected int _numRecord { get; set; } = 4;
|
||||
protected int _numRecord { get; set; } = 6;
|
||||
|
||||
protected int percLoading { get; set; } = 0;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (!firstRender)
|
||||
if (firstRender)
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{CurrItem.MatrOpr}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
|
||||
|
||||
@@ -157,7 +157,12 @@ namespace MP.Land.Data
|
||||
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.AnagOpByGruppoGetAll(codGruppo, searchVal);
|
||||
var rawData = dbController
|
||||
.AnagOpByGruppoGetFilt(codGruppo, searchVal);
|
||||
dbResult = rawData
|
||||
.GroupBy(user => user.MatrOpr)
|
||||
.Select(grp => grp.First())
|
||||
.ToList();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagOperByGroupList: {ts.TotalMilliseconds} ms");
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace MP.Land.Data
|
||||
public bool OnlyMod { get; set; } = false;
|
||||
public bool OnlyNoTag { get; set; } = false;
|
||||
public int PageNum { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 4;
|
||||
public int PageSize { get; set; } = 6;
|
||||
public string SearchVal { get; set; } = "";
|
||||
public string Tag { get; set; } = "";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>6.15.2207.0418</Version>
|
||||
<Version>6.15.2207.0419</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -160,15 +160,15 @@ namespace MP.Land.Pages
|
||||
// importante altrimenti NON mostra update UI
|
||||
await Task.Delay(1);
|
||||
// se ho selezionato qualcosa cerco x gruppo
|
||||
if (groupName != "")
|
||||
{
|
||||
//if (groupName != "")
|
||||
//{
|
||||
SearchRecords = await DataService.AnagOperByGroupList(groupName, AppMService.SearchVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
//altrimenti TUTTI
|
||||
SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //altrimenti TUTTI
|
||||
// SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
|
||||
//}
|
||||
ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList();
|
||||
totalCount = SearchRecords.Count();
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -53,31 +53,5 @@
|
||||
|
||||
<script type="text/javascript" src="~/lib/qrcode.js"></script>
|
||||
<script type="text/javascript" src="~/lib/qrHelper.js"></script>
|
||||
@*<script type="text/javascript">
|
||||
function clearContent(elementID) {
|
||||
console.log(elementID);
|
||||
document.getElementById(elementID).innerHTML = "";
|
||||
}
|
||||
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
|
||||
//var qrcode = new QRCode("qrCodeImg");
|
||||
function displayQr(elementName, rawData) {
|
||||
console.log(elementName);
|
||||
try {
|
||||
if (elementName != "" && rawData != "") {
|
||||
qrcode = new QRCode(document.getElementById(elementName),
|
||||
{
|
||||
text: rawData,
|
||||
width: 200,
|
||||
height: 200
|
||||
});
|
||||
//qrcode = new QRCode(document.getElementById(elementName));
|
||||
//qrcode.clear();
|
||||
//qrcode.makeCode(rawData);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
</script>*@
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.15.2207.0418</h4>
|
||||
<h4>Versione: 6.15.2207.0419</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2207.0418
|
||||
6.15.2207.0419
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2207.0418</version>
|
||||
<version>6.15.2207.0419</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
function clearContent(elementID) {
|
||||
console.log(elementID);
|
||||
console.log("Remove " + elementID);
|
||||
document.getElementById(elementID).innerHTML = "";
|
||||
}
|
||||
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
|
||||
//var qrcode = new QRCode("qrCodeImg");
|
||||
function displayQr(elementName, rawData) {
|
||||
console.log(elementName);
|
||||
console.log("Add " + elementName);
|
||||
try {
|
||||
if (elementName != "" && rawData != "") {
|
||||
qrcode = new QRCode(document.getElementById(elementName),
|
||||
|
||||
Reference in New Issue
Block a user