Gestiti allegati nel form
This commit is contained in:
@@ -11,5 +11,5 @@ public interface ISteupDataService
|
||||
List<PuntoVenditaDto> PuntiVenditaList { get; }
|
||||
InspectionPageState InspectionPageState { get; set; }
|
||||
List<JtbFasiDto> Reparti { get; }
|
||||
List<StbActivityTypeDto> TipiAttività { get; }
|
||||
List<ActivityTypeDto> TipiAttività { get; }
|
||||
}
|
||||
@@ -42,5 +42,5 @@ public class SteupDataService(
|
||||
public InspectionPageState InspectionPageState { get; set; } = new();
|
||||
public List<PuntoVenditaDto> PuntiVenditaList { get; private set; } = [];
|
||||
public List<JtbFasiDto> Reparti { get; private set; } = [];
|
||||
public List<StbActivityTypeDto> TipiAttività { get; private set; } = [];
|
||||
public List<ActivityTypeDto> TipiAttività { get; private set; } = [];
|
||||
}
|
||||
12
SteUp.Shared/Core/Dto/ActivityTypeDto.cs
Normal file
12
SteUp.Shared/Core/Dto/ActivityTypeDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SteUp.Shared.Core.Dto;
|
||||
|
||||
public class ActivityTypeDto
|
||||
{
|
||||
[JsonPropertyName("activityTypeId")]
|
||||
public string ActivityTypeId { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("codJfas")]
|
||||
public string CodJfas { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -10,6 +10,9 @@ public class AttachedDto
|
||||
public string? Path { get; set; }
|
||||
|
||||
public byte[]? FileBytes { get; set; }
|
||||
|
||||
public string? TempPath { get; set; }
|
||||
public string? ThumbPath { get; set; }
|
||||
|
||||
public Stream? FileContent =>
|
||||
FileBytes is null ? null : new MemoryStream(FileBytes);
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SteUp.Shared.Core.Dto;
|
||||
|
||||
public class StbActivityTypeDto
|
||||
{
|
||||
[JsonPropertyName("activityTypeId")]
|
||||
public string? ActivityTypeId { get; set; }
|
||||
}
|
||||
9
SteUp.Shared/Core/Entities/EntityBase.cs
Normal file
9
SteUp.Shared/Core/Entities/EntityBase.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace SteUp.Shared.Core.Entities;
|
||||
|
||||
public class EntityBase<T>
|
||||
{
|
||||
public T Clone()
|
||||
{
|
||||
return (T)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using SteUp.Shared.Core.Enum;
|
||||
|
||||
namespace SteUp.Shared.Core.Entities;
|
||||
|
||||
public class Ispezione
|
||||
public class Ispezione : EntityBase<Ispezione>
|
||||
{
|
||||
[Required]
|
||||
public string CodMdep { get; set; } = string.Empty;
|
||||
|
||||
@@ -4,7 +4,7 @@ using SteUp.Shared.Core.Dto;
|
||||
|
||||
namespace SteUp.Shared.Core.Entities;
|
||||
|
||||
public class Scheda
|
||||
public class Scheda : EntityBase<Scheda>
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
@@ -28,24 +28,24 @@ public class Scheda
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_reparto == null && CodJfas != null)
|
||||
if (field == null && CodJfas != null)
|
||||
{
|
||||
_reparto = new JtbFasiDto
|
||||
field = new JtbFasiDto
|
||||
{
|
||||
CodJfas = CodJfas,
|
||||
Descrizione = DescrizioneReparto
|
||||
};
|
||||
}
|
||||
return _reparto;
|
||||
|
||||
return field;
|
||||
}
|
||||
set
|
||||
{
|
||||
_reparto = value;
|
||||
field = value;
|
||||
if (value == null) return;
|
||||
|
||||
|
||||
CodJfas = value.CodJfas;
|
||||
DescrizioneReparto = value.Descrizione;
|
||||
}
|
||||
}
|
||||
private JtbFasiDto? _reparto;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using SteUp.Shared.Core.Dto;
|
||||
|
||||
namespace SteUp.Shared.Core.Helpers;
|
||||
|
||||
public class ModalHelper
|
||||
public abstract class ModalHelper
|
||||
{
|
||||
public static async Task<DialogResult?> OpenSelectShop(IDialogService dialog)
|
||||
{
|
||||
|
||||
@@ -7,5 +7,5 @@ public interface IIntegrySteupService
|
||||
//Retrieve
|
||||
Task<List<PuntoVenditaDto>> RetrievePuntiVendita();
|
||||
Task<List<JtbFasiDto>> RetrieveReparti();
|
||||
Task<List<StbActivityTypeDto>> RetrieveActivityType();
|
||||
Task<List<ActivityTypeDto>> RetrieveActivityType();
|
||||
}
|
||||
@@ -5,8 +5,11 @@ namespace SteUp.Shared.Core.Interface.System;
|
||||
public interface IAttachedService
|
||||
{
|
||||
Task<AttachedDto?> SelectImageFromCamera();
|
||||
Task<AttachedDto?> SelectImageFromGallery();
|
||||
Task<List<AttachedDto>?> SelectImageFromGallery();
|
||||
|
||||
Task<string> SaveToTempStorage(Stream file, string fileName, CancellationToken ct = default);
|
||||
Task CleanTempStorageAsync(CancellationToken ct = default);
|
||||
Task OpenFile(string fileName, string filePath);
|
||||
|
||||
Task<(string originalUrl, string thumbUrl)> SaveAndCreateThumbAsync(byte[] bytes, string fileName, CancellationToken ct = default);
|
||||
}
|
||||
@@ -16,8 +16,8 @@ public class IntegrySteupService(IIntegryApiRestClient integryApiRestClient) : I
|
||||
public Task<List<JtbFasiDto>> RetrieveReparti() =>
|
||||
integryApiRestClient.AuthorizedGet<List<JtbFasiDto>>($"{BaseRequest}/retrieveReparti")!;
|
||||
|
||||
public Task<List<StbActivityTypeDto>> RetrieveActivityType() =>
|
||||
integryApiRestClient.AuthorizedGet<List<StbActivityTypeDto>>($"{BaseRequest}/retrieveActivityType")!;
|
||||
public Task<List<ActivityTypeDto>> RetrieveActivityType() =>
|
||||
integryApiRestClient.AuthorizedGet<List<ActivityTypeDto>>($"{BaseRequest}/retrieveActivityType")!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user