Iniziata creazione pagina contatti
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<div class="form-container">
|
||||
<span>Data effettiva</span>
|
||||
|
||||
<MudTextField T="DateTime" Format="yyyy-MM-dd" InputType="InputType.Date" @bind-Value="EffectiveDate" />
|
||||
<MudTextField T="DateTime?" Format="yyyy-MM-dd" InputType="InputType.Date" @bind-Value="EffectiveDate" />
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
private List<StbActivityResult> ActivityResult { get; set; } = [];
|
||||
|
||||
private DateTime EffectiveDate { get; set; } = DateTime.Today;
|
||||
private DateTime? EffectiveDate { get; set; } = DateTime.Today;
|
||||
|
||||
private TimeSpan EffectiveTime { get; set; }
|
||||
private TimeSpan EffectiveEndTime { get; set; }
|
||||
@@ -92,11 +92,14 @@
|
||||
|
||||
private void CloseBottomSheet()
|
||||
{
|
||||
ActivityModel.EffectiveTime = new DateTime(EffectiveDate.Year, EffectiveDate.Month, EffectiveDate.Day,
|
||||
EffectiveTime.Hours, EffectiveTime.Minutes, EffectiveTime.Seconds);
|
||||
if (EffectiveDate != null)
|
||||
{
|
||||
ActivityModel.EffectiveTime = new DateTime(EffectiveDate!.Value.Year, EffectiveDate!.Value.Month, EffectiveDate!.Value.Day,
|
||||
EffectiveTime.Hours, EffectiveTime.Minutes, EffectiveTime.Seconds);
|
||||
|
||||
ActivityModel.EffectiveEndtime = new DateTime(EffectiveDate.Year, EffectiveDate.Month, EffectiveDate.Day,
|
||||
EffectiveEndTime.Hours, EffectiveEndTime.Minutes, EffectiveEndTime.Seconds);
|
||||
ActivityModel.EffectiveEndtime = new DateTime(EffectiveDate!.Value.Year, EffectiveDate!.Value.Month, EffectiveDate!.Value.Day,
|
||||
EffectiveEndTime.Hours, EffectiveEndTime.Minutes, EffectiveEndTime.Seconds);
|
||||
}
|
||||
|
||||
IsSheetVisible = false;
|
||||
IsSheetVisibleChanged.InvokeAsync(IsSheetVisible);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
@using Template.Shared.Core.Entity
|
||||
|
||||
<div class="contact-card">
|
||||
<div class="contact-left-section">
|
||||
<div class="contact-body-section">
|
||||
<div class="title-section">
|
||||
<MudText Class="contact-title" Typo="Typo.body1" HtmlTag="h3">@Contact.PersonaRif</MudText>
|
||||
</div>
|
||||
|
||||
@if (Contact.Mansione is not null)
|
||||
{
|
||||
<MudText Class="contact-subtitle" Typo="Typo.body1" HtmlTag="p">@Contact.Mansione</MudText>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="contact-right-section">
|
||||
<MudIcon Color="Color.Success" Disabled="@(Contact.NumCellulare.IsNullOrEmpty())" Size="Size.Large" Icon="@Icons.Material.Outlined.Phone" />
|
||||
<MudIcon Color="Color.Info" Disabled="@(Contact.EMail.IsNullOrEmpty())" Size="Size.Large" Icon="@Icons.Material.Filled.MailOutline" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public VtbCliePersRif Contact { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
.contact-card {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: .5rem .5rem;
|
||||
border-radius: 16px;
|
||||
line-height: normal;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.contact-card.memo { border-left: 5px solid var(--mud-palette-info-darken); }
|
||||
|
||||
.contact-card.interna { border-left: 5px solid var(--mud-palette-success-darken); }
|
||||
|
||||
.contact-card.commessa { border-left: 5px solid var(--mud-palette-warning); }
|
||||
|
||||
.contact-left-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.title-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.contact-hours { font-weight: 700; }
|
||||
|
||||
.contact-hours-section ::deep .mud-chip { margin: 5px 0 0 !important; }
|
||||
|
||||
.contact-body-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.title-section ::deep > .contact-title {
|
||||
font-weight: 800 !important;
|
||||
margin: 0 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.contact-body-section ::deep > .contact-subtitle {
|
||||
color: var(--mud-palette-gray-darker);
|
||||
margin: .2rem 0 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.contact-info-section {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.contact-right-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 1rem;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
@using Template.Shared.Core.Entity
|
||||
@using Template.Shared.Core.Interface
|
||||
@inject IManageDataService ManageData
|
||||
|
||||
<div class="user-card-card">
|
||||
<div class="user-card-left-section">
|
||||
<div class="user-card-body-section">
|
||||
<div class="title-section">
|
||||
<MudIcon @onclick="OpenUser" Color="Color.Primary" Icon="@Icons.Material.Filled.Person" Size="Size.Large" />
|
||||
|
||||
<div class="user-card-right-section">
|
||||
<div class="user-card-title">
|
||||
<MudText Typo="Typo.body1" @onclick="OpenUser" HtmlTag="h3">@User.RagSoc</MudText>
|
||||
<MudIcon @onclick="ShowCommesse" Color="Color.Info" Icon="@Icons.Material.Outlined.Info" Size="Size.Medium"/>
|
||||
</div>
|
||||
|
||||
<div class="user-card-subtitle @(ShowSectionCommesse ? "show" : "")">
|
||||
@if (ShowSectionCommesse && IsLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7" />
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (!Commesse.IsNullOrEmpty())
|
||||
{
|
||||
<div @onclick="OpenUser" class="container-commesse">
|
||||
@foreach (var commessa in Commesse!)
|
||||
{
|
||||
<div class="commessa">
|
||||
<span>@($"{commessa.CodAnag} - {commessa.Descrizione}")</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>Nessuna commessa presente</span>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public AnagClie User { get; set; } = new();
|
||||
|
||||
private List<JtbComt>? Commesse { get; set; }
|
||||
private bool IsLoading { get; set; } = true;
|
||||
private bool ShowSectionCommesse { get; set; }
|
||||
|
||||
private void OpenUser() =>
|
||||
NavigationManager.NavigateTo($"/User/{User.CodAnag}");
|
||||
|
||||
private async Task ShowCommesse()
|
||||
{
|
||||
ShowSectionCommesse = !ShowSectionCommesse;
|
||||
|
||||
if (ShowSectionCommesse)
|
||||
{
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag.Equals(User.CodAnag));
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
IsLoading = true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
.user-card-card { width: 100%; }
|
||||
|
||||
.user-card-card.memo { border-left: 5px solid var(--mud-palette-info-darken); }
|
||||
|
||||
.user-card-card.interna { border-left: 5px solid var(--mud-palette-success-darken); }
|
||||
|
||||
.user-card-card.commessa { border-left: 5px solid var(--mud-palette-warning); }
|
||||
|
||||
.user-card-left-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
gap: .75rem;
|
||||
}
|
||||
|
||||
.user-card-hours { font-weight: 700; }
|
||||
|
||||
.user-card-hours-section ::deep .mud-chip { margin: 5px 0 0 !important; }
|
||||
|
||||
.user-card-body-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.user-card-right-section {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid var(--card-border-color);
|
||||
}
|
||||
|
||||
.user-card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 32px;
|
||||
padding-left: .25rem;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.user-card-title ::deep > h3 {
|
||||
font-weight: 700 !important;
|
||||
margin: 0 !important;
|
||||
line-height: normal !important;
|
||||
font-size: .85rem;
|
||||
}
|
||||
|
||||
.user-card-body-section ::deep > .user-card-subtitle {
|
||||
color: var(--mud-palette-gray-darker);
|
||||
margin: .2rem 0 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.user-card-info-section {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.title-section ::deep > .mud-icon-root {
|
||||
background: var(--gray-for-shadow);
|
||||
padding: .25rem;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-card-subtitle {
|
||||
overflow: hidden;
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
transition: max-height 0.4s ease, opacity 0.4s ease;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.user-card-subtitle.show {
|
||||
max-height: 250px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.container-commesse {
|
||||
padding: .5rem;
|
||||
}
|
||||
|
||||
.commessa {
|
||||
color: var(--mud-palette-text-secondary);
|
||||
font-weight: 700;
|
||||
font-size: small;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
@using Template.Shared.Core.Services
|
||||
@inject AppAuthenticationStateProvider AuthenticationStateProvider
|
||||
|
||||
<div class="container container-modal">
|
||||
<div class="c-modal">
|
||||
<div class="exception-header mb-2">
|
||||
<i class="ri-emotion-unhappy-line"></i>
|
||||
<span>Ops</span>
|
||||
</div>
|
||||
<div class="text">
|
||||
@if (Exception != null)
|
||||
{
|
||||
<code>@Message</code>
|
||||
}
|
||||
</div>
|
||||
<div class="button-container">
|
||||
<div @onclick="OnLogoutClick" class="card-button">
|
||||
<span>Logout</span>
|
||||
</div>
|
||||
<div @onclick="OnRetryClick" class="card-button">
|
||||
<span>Riprova</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public Exception? Exception { get; set; }
|
||||
[Parameter] public EventCallback OnRetry { get; set; }
|
||||
[Parameter] public ErrorBoundary? ErrorBoundary { get; set; }
|
||||
|
||||
private string Message { get; set; } = "";
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
if (Exception == null) return;
|
||||
|
||||
if (Exception.Message.Contains("Failed to connect to"))
|
||||
{
|
||||
var ipPort = Exception.Message.Split("to /")[1];
|
||||
|
||||
Message = $"Impossibile collegarsi al server ({ipPort})";
|
||||
}
|
||||
else
|
||||
{
|
||||
Message = Exception.Message;
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnRetryClick()
|
||||
{
|
||||
await OnRetry.InvokeAsync();
|
||||
}
|
||||
|
||||
private async Task OnLogoutClick()
|
||||
{
|
||||
LocalStorage.Remove("last-sync");
|
||||
AuthenticationStateProvider.SignOut();
|
||||
await OnRetry.InvokeAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
.container-modal {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.c-modal {
|
||||
border-radius: 16px;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.button-container {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
margin: 1.5rem 0 0 0;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: medium;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.card-button {
|
||||
text-align: center;
|
||||
background-color: transparent;
|
||||
padding: .3rem 1rem;
|
||||
font-weight: 700;
|
||||
color: var(--bs-primary-text-emphasis);
|
||||
}
|
||||
|
||||
.exception-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.exception-header > i {
|
||||
font-size: 3rem;
|
||||
line-height: normal;
|
||||
color: var(--bs-danger);
|
||||
}
|
||||
|
||||
.exception-header > span {
|
||||
font-size: x-large;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
code {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
color: var(--bs-gray-dark);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
@using Microsoft.VisualBasic
|
||||
@using System.Globalization
|
||||
@using Microsoft.VisualBasic
|
||||
@using Template.Shared.Core.Dto
|
||||
@using Template.Shared.Components.Layout
|
||||
@using Template.Shared.Core.Entity
|
||||
@@ -34,7 +35,7 @@
|
||||
<div class="form-container">
|
||||
<span>Inizio</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView" T="DateTime?" Format="yyyy-MM-ddTHH:mm" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedTime" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue" />
|
||||
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedTime" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue" />
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -42,7 +43,7 @@
|
||||
<div class="form-container">
|
||||
<span>Fine</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView" T="DateTime?" Format="yyyy-MM-ddTHH:mm" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedEndtime" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue" />
|
||||
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedEndtime" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue" />
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -102,7 +103,7 @@
|
||||
|
||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation" />
|
||||
|
||||
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" />
|
||||
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeValue" />
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
||||
@@ -140,6 +141,7 @@
|
||||
{
|
||||
ActivityModel.EstimatedTime = DateTime.Today.Add(TimeSpan.FromHours(DateTime.Now.Hour));
|
||||
ActivityModel.EstimatedEndtime = DateTime.Today.Add(TimeSpan.FromHours(DateTime.Now.Hour) + TimeSpan.FromHours(1));
|
||||
ActivityModel.UserName = UserSession.User.Username;
|
||||
}
|
||||
|
||||
OriginalModel = ActivityModel.Clone();
|
||||
@@ -150,7 +152,13 @@
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
var newActivity = await IntegryApiService.SaveActivity(ActivityModel);
|
||||
var response = await IntegryApiService.SaveActivity(ActivityModel);
|
||||
|
||||
if (response == null)
|
||||
return;
|
||||
|
||||
var newActivity = response.Last();
|
||||
|
||||
await ManageData.InsertOrUpdate(newActivity);
|
||||
|
||||
SuccessAnimation = true;
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
.no-data {
|
||||
margin-top: 2rem;
|
||||
width: calc(100vw - (var(--bs-gutter-x) * .5) * 2);
|
||||
}
|
||||
.no-data { margin-top: 2rem; }
|
||||
|
||||
.no-data img {
|
||||
width: 60%;
|
||||
}
|
||||
.no-data img { width: 60%; }
|
||||
|
||||
.no-data p {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
.no-data p { font-size: 1.2rem; }
|
||||
Reference in New Issue
Block a user