Template pagina lista ticket e file allegati

This commit is contained in:
marco.salvi
2022-02-04 13:02:18 +01:00
parent 9c80209d9b
commit e389cbd7a3
12 changed files with 306 additions and 14 deletions
+35
View File
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/LiMan.UI/bin/Debug/net5.0/LiMan.UI.dll",
"args": [],
"cwd": "${workspaceFolder}/LiMan.UI",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
+41
View File
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/LiMan.UI/LiMan.UI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/LiMan.UI/LiMan.UI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/LiMan.UI/LiMan.UI.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
+76
View File
@@ -901,6 +901,82 @@ namespace LiMan.DB.Controllers
return dbResult;
}
public List<TicketDTO> TicketGetFiltAllLic(bool onlyOpen, TipologiaTicket Tipo, string CodApp, string CodInst, int maxNum)
{
List<TicketDTO> dbResult = new List<TicketDTO>();
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
// recupero locenza...
var currLic = localDbCtx
.DbSetLicenze
.Where(x => x.CodApp == CodApp && x.CodInst == CodInst)
.FirstOrDefault();
if (currLic != null)
{
dbResult = localDbCtx
.DbSetTicket
.Where(x => (x.LicenzaNav.CodApp == CodApp && x.LicenzaNav.CodInst == CodInst) && (x.Status <= StatoRichiesta.Valutazione || !onlyOpen) && (x.TType == Tipo || Tipo == TipologiaTicket.ND))
.OrderByDescending(x => x.IdxTicket)
.Take(maxNum)
.Select(x => new TicketDTO
{
IdxTicket = x.IdxTicket,
IdxLic = x.IdxLic,
IdxSubLic = x.IdxSubLic,
CodImpiego = x.CodImpiego,
ContactName = x.ContactName,
ContactEmail = x.ContactEmail,
ContactPhone = x.ContactPhone,
DtReq = x.DtReq,
ReqBody = x.ReqBody,
Status = x.Status,
SupplAnsw = x.SupplAnsw,
SupplEmail = x.SupplEmail,
SupplUserCode = x.SupplUserCode,
Tipo = x.Tipo
})
.ToList();
}
}
return dbResult;
}
public List<TicketDTO> TicketGetAll(bool onlyOpen, int maxNum)
{
List<TicketDTO> dbResult = new List<TicketDTO>();
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
dbResult = localDbCtx
.DbSetTicket
.Where(x => (x.Status <= StatoRichiesta.Valutazione || !onlyOpen))
.OrderByDescending(x => x.IdxTicket)
.Take(maxNum)
.Select(x => new TicketDTO
{
IdxTicket = x.IdxTicket,
IdxLic = x.IdxLic,
IdxSubLic = x.IdxSubLic,
CodImpiego = x.CodImpiego,
ContactName = x.ContactName,
ContactEmail = x.ContactEmail,
ContactPhone = x.ContactPhone,
DtReq = x.DtReq,
ReqBody = x.ReqBody,
Status = x.Status,
SupplAnsw = x.SupplAnsw,
SupplEmail = x.SupplEmail,
SupplUserCode = x.SupplUserCode,
Tipo = x.Tipo
})
.ToList();
}
return dbResult;
}
public bool TicketUpdateState(int IdxTicket, StatoRichiesta NewStatus)
{
bool fatto = false;
+66
View File
@@ -0,0 +1,66 @@
@using LiMan.UI.Components
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-9">
<h3>File Allegati</h3>
</div>
<div class="col-3 text-right">
<button class="btn btn-sm btn-success" @onclick="() => AddNew()"><i class="fas fa-plus"></i></button>
</div>
</div>
</div>
<div class="card-body bg-light p-1">
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th>
<button type="button" class="btn btn-sm btn-warning btn-block" @onclick="close"><i class="fas fa-times"></i></button>
</th>
<th>#</th>
<th>OriginalName</th>
<th>FullStoragePath</th>
</tr>
</thead>
<tbody>
@* @foreach (var record in ListRecords)
{
<tr>
<td>
<button type="button" class="btn btn-sm btn-primary" @onclick="() => showDet(record)"><i class="fas fa-search"></i></button>
</td>
<td>
@record.IdxTicket<br />
@record.Status
</td>
<td>
<div><b>@record.ContactName</b></div>
<div>@record.DtReq</div>
</td>
<td>
<div>@record.ContactEmail</div>
<div>@record.ContactPhone</div>
</td>
<td>
@record.ReqBody
</td>
</tr>
}*@
</tbody>
</table>
}
</div>
</div>>
+20
View File
@@ -0,0 +1,20 @@
using Core;
using LiMan.DB.DBModels;
using LiMan.DB.DTO;
using LiMan.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static LiMan.DB.Enum;
namespace LiMan.UI.Components
{
public partial class ListAttach
{
private List<FileAttachModel> files;
protected int totalCount = 0;
}
}
+18 -3
View File
@@ -1,14 +1,28 @@
<div class="card">
@using LiMan.UI.Components
<div class="card">
<div class="card-header bg-success py-1 text-light">
<h3>Tickets</h3>
</div>
<div class="card-body bg-light p-1">
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th>
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="close"><i class="fas fa-times"></i></button>
<button type="button" class="btn btn-sm btn-warning btn-block" @onclick="close"><i class="fas fa-times"></i></button>
</th>
<th>#</th>
<th>Richiedente</th>
@@ -23,7 +37,7 @@
{
<tr>
<td>
<button type="button" class="btn btn-sm btn-primary" value="Cancel" @onclick="() => showDet(record)"><i class="fas fa-search"></i></button>
<button type="button" class="btn btn-sm btn-primary" @onclick="() => showDet(record)"><i class="fas fa-search"></i></button>
</td>
<td>
@record.IdxTicket<br />
@@ -44,6 +58,7 @@
}
</tbody>
</table>
}
@if (idxTicketSel > 0)
{
<div class="table-primary p-2">
+11 -7
View File
@@ -1,5 +1,6 @@
using Core;
using LiMan.DB.DBModels;
using LiMan.DB.DTO;
using LiMan.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
@@ -16,7 +17,8 @@ namespace LiMan.UI.Components
#region Private Fields
private List<SubLicenzaModel> ListActivations;
private List<TicketModel> ListRecords;
private List<TicketDTO> ListRecords;
protected int totalCount = 0;
#endregion Private Fields
@@ -106,7 +108,9 @@ namespace LiMan.UI.Components
ListActivations = null;
idxTicketSel = 0;
await Task.Delay(1);
ListRecords = MasterLicence.Tickets.ToList();
//bool StatoRichiesta = true;
ListRecords = await DataService.TicketsGetAll();
totalCount = ListRecords.Count();
isLoading = false;
}
@@ -157,16 +161,16 @@ namespace LiMan.UI.Components
showKey = !showKey;
}
protected void showDet(TicketModel currTicket)
protected void showDet(TicketDTO currTicket)
{
// salvo ticket sel
idxTicketSel = currTicket.IdxTicket;
StatusSel = currTicket.Status;
// mostro SOLO le attivazioni di cui ho ticket attivi...
ListActivations = MasterLicence
.Attivazioni
.Where(a => a.IdxSubLic == currTicket.IdxSubLic)
.ToList();
//ListActivations = MasterLicence
//.Attivazioni
//.Where(a => a.IdxSubLic == currTicket.IdxSubLic)
//.ToList();
}
protected async Task UnLock(SubLicenzaModel selRecord)
+35
View File
@@ -584,6 +584,41 @@ namespace LiMan.UI.Data
return await Task.FromResult(fatto);
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<DB.DTO.TicketDTO>> TicketsGetFilt(SelectNext CurrFilter)
{
Stopwatch stopWatch = new Stopwatch();
List<DB.DTO.TicketDTO> dbResult = new List<DB.DTO.TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetFiltAllLic(CurrFilter.OnlyActive, Core.TipologiaTicket.ND, CurrFilter.ApplicazioneSel, CurrFilter.InstallazioneSel, 1000);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<DB.DTO.TicketDTO>> TicketsGetAll()
{
Stopwatch stopWatch = new Stopwatch();
List<DB.DTO.TicketDTO> dbResult = new List<DB.DTO.TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetAll(false, 1000);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetAll: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
#endregion Public Methods
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.1.2112.2211</Version>
<Version>1.1.2202.0316</Version>
<RootNamespace>LiMan.UI</RootNamespace>
<AssemblyName>LiMan.UI</AssemblyName>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 1.1.2112.2211</h4>
<h4>Versione: 1.1.2202.0316</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
1.1.2112.2211
1.1.2202.0316
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2112.2211</version>
<version>1.1.2202.0316</version>
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>