aggiunti componenti per progetti
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
@if (ListProgetti == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (ListProgetti.Count == 0)
|
||||
{
|
||||
<div class="alert alert-info">
|
||||
<h3>Timbrature da Approvare</h3>
|
||||
Nessun record trovato
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ProjectsList ListProj="@ListProgetti" EnableAdmin="false" EnableEdit="true" ReqUpdate="DoUpdate" TextCss="text-light"></ProjectsList>
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using GPW.CORE.Data.DbModels;
|
||||
using GPW.CORE.Data.DTO;
|
||||
using GPW.CORE.Smart.Data;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace GPW.CORE.Smart.Components
|
||||
{
|
||||
public partial class CompProj
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public int IdxDipCurr { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public List<DailyDataDTO>? ListProgetti { get; set; } = null;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorno e riporto update
|
||||
/// </summary>
|
||||
protected async void DoUpdate(bool forceReload)
|
||||
{
|
||||
if (forceReload)
|
||||
{
|
||||
await ReloadData();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private CoreSmartDataService CDService { get; set; } = null!;
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
await Task.Delay(1);
|
||||
isLoading = true;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
@using GPW.CORE.Data.DbModels
|
||||
@using GPW.CORE.Smart.Data
|
||||
|
||||
@if (ListProj != null)
|
||||
{
|
||||
@foreach (var item in ListProj)
|
||||
{
|
||||
<div>
|
||||
@item.Descrizione
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
using GPW.CORE.Data.DbModels;
|
||||
using GPW.CORE.Data.DTO;
|
||||
using GPW.CORE.Smart.Data;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace GPW.CORE.Smart.Components
|
||||
{
|
||||
public partial class ProjectsList
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public bool EnableAdmin { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public bool EnableEdit { get; set; } = false;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public string TextCss { get; set; } = "text-dark";
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public List<DailyDataDTO> ListProj { get; set; } = null!;
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
|
||||
// return _ListProj.Select(x => x.ListRA);
|
||||
// }
|
||||
|
||||
// set
|
||||
// {
|
||||
// _ListProj = value;
|
||||
// }
|
||||
//}
|
||||
public List<RegAttivitaModel> ListRegAtt { get; set; } = null!;
|
||||
protected override Task OnParametersSetAsync()
|
||||
{
|
||||
ListRegAtt = ListProj.Select(x=>x.ListRA).ToList();
|
||||
}
|
||||
|
||||
private bool canDelete(TimbratureModel currRec)
|
||||
{
|
||||
bool answ = false;
|
||||
if (currRec.Approv != null)
|
||||
{
|
||||
answ = !(bool)currRec.Approv;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> ReqUpdate { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
|
||||
protected async void Delete(TimbratureModel currRecord)
|
||||
{
|
||||
string message = "Sicuro di voler eliminare/rifiutare la richiesta selezionata?";
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", message))
|
||||
return;
|
||||
|
||||
isLoading = true;
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
// elimino
|
||||
await CDService.TimbratureDelete(currRecord);
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
await ReqUpdate.InvokeAsync(true);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private List<DailyDataDTO> _ListProj { get; set; } = new List<DailyDataDTO>();
|
||||
|
||||
[Inject]
|
||||
private CoreSmartDataService CDService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user