Sistemati caricamenti
This commit is contained in:
@@ -232,7 +232,7 @@ public class ManageDataService(
|
|||||||
return await MapActivity(activities);
|
return await MapActivity(activities);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities)
|
public async Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities)
|
||||||
{
|
{
|
||||||
if (activities == null) return [];
|
if (activities == null) return [];
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ public class ManageDataService(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dto.Commessa = jtbComtList.LastOrDefault();
|
dto.Commessa = jtbComtList.Find(x => x.CodJcom.Equals(dto.CodJcom));
|
||||||
return dto;
|
return dto;
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|||||||
@@ -149,8 +149,7 @@ else
|
|||||||
await Task.Run(async () =>
|
await Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var activities = await IntegryApiService.RetrieveActivity(new CRMRetrieveActivityRequestDTO { CodJcom = CodJcom });
|
var activities = await IntegryApiService.RetrieveActivity(new CRMRetrieveActivityRequestDTO { CodJcom = CodJcom });
|
||||||
ActivityList = Mapper.Map<List<ActivityDTO>>(activities)
|
ActivityList = (await ManageData.MapActivity(activities)).OrderByDescending(x =>
|
||||||
.OrderBy(x =>
|
|
||||||
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
||||||
).ToList();
|
).ToList();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -527,8 +527,7 @@ else
|
|||||||
await Task.Run(async () =>
|
await Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var activities = await IntegryApiService.RetrieveActivity(new CRMRetrieveActivityRequestDTO { CodAnag = Anag.CodContact });
|
var activities = await IntegryApiService.RetrieveActivity(new CRMRetrieveActivityRequestDTO { CodAnag = Anag.CodContact });
|
||||||
ActivityList = Mapper.Map<List<ActivityDTO>>(activities)
|
ActivityList = (await ManageData.MapActivity(activities)).OrderByDescending(x =>
|
||||||
.OrderByDescending(x =>
|
|
||||||
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
||||||
).ToList();
|
).ToList();
|
||||||
});
|
});
|
||||||
@@ -794,4 +793,5 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,12 @@
|
|||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<span class="disable-full-width">Commessa</span>
|
<span class="disable-full-width">Commessa</span>
|
||||||
|
|
||||||
|
@if (ActivityModel.CodJcom != null && SelectedComessa == null)
|
||||||
|
{
|
||||||
|
<MudSkeleton />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
<MudAutocomplete
|
<MudAutocomplete
|
||||||
Disabled="ActivityModel.Cliente.IsNullOrEmpty()"
|
Disabled="ActivityModel.Cliente.IsNullOrEmpty()"
|
||||||
T="JtbComt?" ReadOnly="IsView"
|
T="JtbComt?" ReadOnly="IsView"
|
||||||
@@ -47,10 +53,12 @@
|
|||||||
SearchFunc="SearchCommesseAsync"
|
SearchFunc="SearchCommesseAsync"
|
||||||
ToStringFunc="@(c => c == null ? string.Empty : $"{c.CodJcom} - {c.Descrizione}")"
|
ToStringFunc="@(c => c == null ? string.Empty : $"{c.CodJcom} - {c.Descrizione}")"
|
||||||
Clearable="true"
|
Clearable="true"
|
||||||
|
OnClearButtonClick="OnCommessaClear"
|
||||||
ShowProgressIndicator="true"
|
ShowProgressIndicator="true"
|
||||||
DebounceInterval="300"
|
DebounceInterval="300"
|
||||||
MaxItems="50"
|
MaxItems="50"
|
||||||
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code"/>
|
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code"/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -90,6 +98,12 @@
|
|||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<span class="disable-full-width">Assegnata a</span>
|
<span class="disable-full-width">Assegnata a</span>
|
||||||
|
|
||||||
|
@if (ActivityModel.UserName != null && SelectedUser == null)
|
||||||
|
{
|
||||||
|
<MudSkeleton />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
<MudAutocomplete
|
<MudAutocomplete
|
||||||
Disabled="Users.IsNullOrEmpty()" ReadOnly="IsView"
|
Disabled="Users.IsNullOrEmpty()" ReadOnly="IsView"
|
||||||
T="StbUser"
|
T="StbUser"
|
||||||
@@ -98,11 +112,13 @@
|
|||||||
SearchFunc="SearchUtentiAsync"
|
SearchFunc="SearchUtentiAsync"
|
||||||
ToStringFunc="@(u => u == null ? string.Empty : u.FullName)"
|
ToStringFunc="@(u => u == null ? string.Empty : u.FullName)"
|
||||||
Clearable="true"
|
Clearable="true"
|
||||||
|
OnClearButtonClick="OnUserClear"
|
||||||
ShowProgressIndicator="true"
|
ShowProgressIndicator="true"
|
||||||
DebounceInterval="300"
|
DebounceInterval="300"
|
||||||
MaxItems="50"
|
MaxItems="50"
|
||||||
Class="customIcon-select"
|
Class="customIcon-select"
|
||||||
AdornmentIcon="@Icons.Material.Filled.Code"/>
|
AdornmentIcon="@Icons.Material.Filled.Code"/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
@@ -110,12 +126,19 @@
|
|||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<span class="disable-full-width">Tipo</span>
|
<span class="disable-full-width">Tipo</span>
|
||||||
|
|
||||||
|
@if (ActivityType.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
<MudSkeleton />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityTypeId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityTypeId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||||
@foreach (var type in ActivityType)
|
@foreach (var type in ActivityType)
|
||||||
{
|
{
|
||||||
<MudSelectItemExtended Class="custom-item-select" Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
|
<MudSelectItemExtended Class="custom-item-select" Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
|
||||||
}
|
}
|
||||||
</MudSelectExtended>
|
</MudSelectExtended>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
@@ -370,14 +393,14 @@
|
|||||||
{
|
{
|
||||||
return Task.Run(async () =>
|
return Task.Run(async () =>
|
||||||
{
|
{
|
||||||
if (!IsNew && Id != null)
|
SelectedComessa = ActivityModel.Commessa;
|
||||||
ActivityFileList = await IntegryApiService.GetActivityFile(Id);
|
|
||||||
|
|
||||||
Users = await ManageData.GetTable<StbUser>();
|
Users = await ManageData.GetTable<StbUser>();
|
||||||
if (!ActivityModel.UserName.IsNullOrEmpty())
|
if (!ActivityModel.UserName.IsNullOrEmpty())
|
||||||
SelectedUser = Users.FindLast(x => x.UserName.Equals(ActivityModel.UserName));
|
SelectedUser = Users.FindLast(x => x.UserName.Equals(ActivityModel.UserName));
|
||||||
|
|
||||||
SelectedComessa = ActivityModel.Commessa;
|
if (!IsNew && Id != null)
|
||||||
|
ActivityFileList = await IntegryApiService.GetActivityFile(Id);
|
||||||
|
|
||||||
ActivityResult = await ManageData.GetTable<StbActivityResult>();
|
ActivityResult = await ManageData.GetTable<StbActivityResult>();
|
||||||
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
|
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
|
||||||
@@ -510,6 +533,20 @@
|
|||||||
OnAfterChangeValue();
|
OnAfterChangeValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task OnCommessaClear()
|
||||||
|
{
|
||||||
|
ActivityModel.Commessa = null;
|
||||||
|
ActivityModel.CodJcom = null;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OnUserClear()
|
||||||
|
{
|
||||||
|
ActivityModel.UserName = null;
|
||||||
|
ActivityType = [];
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnAfterChangeTimeBefore()
|
private void OnAfterChangeTimeBefore()
|
||||||
{
|
{
|
||||||
if (ActivityModel.EstimatedTime is not null)
|
if (ActivityModel.EstimatedTime is not null)
|
||||||
|
|||||||
@@ -25,5 +25,7 @@ public interface IManageDataService
|
|||||||
Task Delete<T>(T objectToDelete);
|
Task Delete<T>(T objectToDelete);
|
||||||
Task DeleteActivity(ActivityDTO activity);
|
Task DeleteActivity(ActivityDTO activity);
|
||||||
|
|
||||||
|
Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities);
|
||||||
|
|
||||||
Task ClearDb();
|
Task ClearDb();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user