Merge branch 'main' of https://git.oaservice.it/g.vitari/TecniStamp
This commit is contained in:
@ -19,5 +19,4 @@ public class Cliente : EntitaBase
|
|||||||
[ForeignKey(nameof(Comune))]
|
[ForeignKey(nameof(Comune))]
|
||||||
public Guid? ComuneId { get; set; }
|
public Guid? ComuneId { get; set; }
|
||||||
public ComuneIstat Comune { get; set; }
|
public ComuneIstat Comune { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 18
|
||||||
VisualStudioVersion = 17.14.36915.13
|
VisualStudioVersion = 18.1.11304.174 d18.0
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TecniStamp", "TecniStamp\TecniStamp.csproj", "{CFA3D1CC-936B-4DF5-B2AE-A46A8616501A}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TecniStamp", "TecniStamp\TecniStamp.csproj", "{CFA3D1CC-936B-4DF5-B2AE-A46A8616501A}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
@ -110,5 +110,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowTooltip(ElementReference elementReference, TooltipOptions options = null) => _tooltipService.Open(elementReference, options.Text, options);
|
void ShowTooltip(ElementReference elementReference, TooltipOptions options = null) => _tooltipService.Open(elementReference, options.Text, options);
|
||||||
}
|
}
|
||||||
@ -1,22 +1,8 @@
|
|||||||
@using TecniStamp.Model.Commesse
|
@using TecniStamp.Model.Commesse
|
||||||
|
@using TecniStamp.Utils
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row g-5 mb-5">
|
|
||||||
<div class="col-md-6"></div>
|
|
||||||
<div class="col-md-2">
|
|
||||||
<RadzenButton Icon="date_range"></RadzenButton>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-2">
|
|
||||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Data ultima modifica</RadzenText>
|
|
||||||
<RadzenLabel Text="@DateTime.Now.ToShortDateString()"></RadzenLabel>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-2">
|
|
||||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Data ultima Check</RadzenText>
|
|
||||||
<RadzenLabel Text="@DateTime.Now.ToShortDateString()"></RadzenLabel>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row g-5">
|
<div class="row g-5">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<RadzenDataGrid @ref="posizioniGrid" AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.CheckBoxList" AllowSorting="true" PageSize="25"
|
<RadzenDataGrid @ref="posizioniGrid" AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.CheckBoxList" AllowSorting="true" PageSize="25"
|
||||||
@ -31,6 +17,13 @@
|
|||||||
<RadzenDataGridColumn Property="@nameof(CommessaPosizioneViewModel.Categoria)" Title="Categoria"></RadzenDataGridColumn>
|
<RadzenDataGridColumn Property="@nameof(CommessaPosizioneViewModel.Categoria)" Title="Categoria"></RadzenDataGridColumn>
|
||||||
<RadzenDataGridColumn Property="@nameof(CommessaPosizioneViewModel.DataConsegna)" Title="Data consegna"></RadzenDataGridColumn>
|
<RadzenDataGridColumn Property="@nameof(CommessaPosizioneViewModel.DataConsegna)" Title="Data consegna"></RadzenDataGridColumn>
|
||||||
<RadzenDataGridColumn Property="@nameof(CommessaPosizioneViewModel.DataTerminePrevisto)" Title="Data termine previsto"></RadzenDataGridColumn>
|
<RadzenDataGridColumn Property="@nameof(CommessaPosizioneViewModel.DataTerminePrevisto)" Title="Data termine previsto"></RadzenDataGridColumn>
|
||||||
|
|
||||||
|
<RadzenDataGridColumn Context="posizione" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Width="250px">
|
||||||
|
<Template Context="posizione">
|
||||||
|
<RadzenButton Visible="canEdit" Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" class="rz-my-1 rz-ms-1" Click="@(args => EditRow(posizione))" @onclick:stopPropagation="true" />
|
||||||
|
<RadzenButton Visible="canDelete" Icon="delete" ButtonStyle="ButtonStyle.Danger" Variant="Variant.Flat" Size="ButtonSize.Medium" Shade="Shade.Lighter" class="rz-my-1 rz-ms-1" Click="@(args => DeleteRow(posizione))" @onclick:stopPropagation="true" />
|
||||||
|
</Template>
|
||||||
|
</RadzenDataGridColumn>
|
||||||
</Columns>
|
</Columns>
|
||||||
</RadzenDataGrid>
|
</RadzenDataGrid>
|
||||||
</div>
|
</div>
|
||||||
@ -43,4 +36,29 @@
|
|||||||
|
|
||||||
RadzenDataGrid<CommessaPosizioneViewModel> posizioniGrid;
|
RadzenDataGrid<CommessaPosizioneViewModel> posizioniGrid;
|
||||||
|
|
||||||
|
private bool canEdit = false;
|
||||||
|
private bool canDelete = false;
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
|
canEdit = await MembershipUtils.CheckPermission(_auth, _managerService, "Commesse_Edit");
|
||||||
|
canDelete = await MembershipUtils.CheckPermission(_auth, _managerService, "Commesse_Delete");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EditRow(CommessaPosizioneViewModel posizione)
|
||||||
|
{
|
||||||
|
/*_navManager.NavigateTo($"/commesse/modifica/{commessa.Id}");*/
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task DeleteRow(CommessaPosizioneViewModel posizione)
|
||||||
|
{
|
||||||
|
var ok = await _dialogService.Confirm($"Vuoi davvero eliminare la posizione: {posizione.Posizione}?", "Conferma eliminazione", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" });
|
||||||
|
|
||||||
|
if (ok == true)
|
||||||
|
{
|
||||||
|
await _managerService.CommessaPosizioneService.Elimina(posizione.Id, await MembershipUtils.GetUserId(_auth));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
55
TecniStamp/TecniStamp/Components/Pages/Tempi/Tempi.razor
Normal file
55
TecniStamp/TecniStamp/Components/Pages/Tempi/Tempi.razor
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
@page "/tempi"
|
||||||
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using TecniStamp.Model.Tempi
|
||||||
|
@using TecniStamp.Model.Common
|
||||||
|
@using TecniStamp.Utils
|
||||||
|
|
||||||
|
@rendermode InteractiveServer
|
||||||
|
@inject AuthenticationStateProvider auth
|
||||||
|
|
||||||
|
<PageTitle>Tempi</PageTitle>
|
||||||
|
<Breadcrumb Items="BreadcrumbList" />
|
||||||
|
|
||||||
|
<main role="main">
|
||||||
|
<div class="container-fluid h-100 mt-5">
|
||||||
|
<div class="row justify-content-start">
|
||||||
|
<div class="row row-cards">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<RadzenDataGrid @ref="tempiGrid" AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.CheckBoxList" AllowSorting="true" PageSize="25"
|
||||||
|
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||||
|
Data="@tempi" ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||||
|
<Columns>
|
||||||
|
<RadzenDataGridColumn Property="@nameof(TempiViewModel.Operatore)" Title="Operatore" Width="160px" />
|
||||||
|
<RadzenDataGridColumn Property="@nameof(TempiViewModel.Commessa)" Title="Commessa" Width="160px" />
|
||||||
|
<RadzenDataGridColumn Property="@nameof(TempiViewModel.Prodotto)" Title="Prodotto" Width="160px" />
|
||||||
|
<RadzenDataGridColumn Property="@nameof(TempiViewModel.Lavorazione)" Title="Lavorazione" Width="160px" />
|
||||||
|
<RadzenDataGridColumn Property="@nameof(TempiViewModel.DataInizio)" Title="Data Inizio" FormatString="{0:dd/MM/yyyy HH:mm}" Width="160px" />
|
||||||
|
<RadzenDataGridColumn Property="@nameof(TempiViewModel.DataFine)" Title="Data Fine" FormatString="{0:dd/MM/yyyy HH:mm}" Width="160px" />
|
||||||
|
<RadzenDataGridColumn Property="@nameof(TempiViewModel.TempoTotale)" Title="Tempo Totale" Width="160px" />
|
||||||
|
</Columns>
|
||||||
|
</RadzenDataGrid>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
List<TempiViewModel> tempi;
|
||||||
|
RadzenDataGrid<TempiViewModel> tempiGrid;
|
||||||
|
public List<BreadcrumbViewModel> BreadcrumbList { get; set; } = new();
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BreadcrumbList = await BreadcrumbUtils.BuildBreadcrumbByFeature(_managerService, "Tempi_Info");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
17
TecniStamp/TecniStamp/Model/Tempi/TempiViewModel.cs
Normal file
17
TecniStamp/TecniStamp/Model/Tempi/TempiViewModel.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using TecniStamp.Model.Commesse;
|
||||||
|
|
||||||
|
namespace TecniStamp.Model.Tempi;
|
||||||
|
|
||||||
|
public class TempiViewModel
|
||||||
|
{
|
||||||
|
public string Operatore { get; set; }
|
||||||
|
public string Commessa { get; set; }
|
||||||
|
public string Prodotto { get; set; }
|
||||||
|
public string Lavorazione { get; set; }
|
||||||
|
public DateTime DataInizio { get; set; }
|
||||||
|
public DateTime DataFine { get; set; }
|
||||||
|
public decimal TempoTotale { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user