This commit is contained in:
2025-10-03 16:32:16 +02:00
parent 5016b3ed8d
commit 9f95bb23e6
8 changed files with 64 additions and 31 deletions

View File

@@ -309,19 +309,28 @@ public class ManageDataService(
{
return Task.Run(async () =>
{
if (response.AnagClie != null)
try
{
await localDb.InsertOrUpdate(response.AnagClie);
if (response.AnagClie != null)
{
await localDb.InsertOrUpdate(response.AnagClie);
if (response.VtbDest != null) await localDb.InsertOrUpdate(response.VtbDest);
if (response.VtbCliePersRif != null) await localDb.InsertOrUpdate(response.VtbCliePersRif);
if (response.VtbDest != null) await localDb.InsertOrUpdate(response.VtbDest);
if (response.VtbCliePersRif != null) await localDb.InsertOrUpdate(response.VtbCliePersRif);
}
if (response.PtbPros != null)
{
await localDb.InsertOrUpdate(response.PtbPros);
if (response.PtbProsRif != null) await localDb.InsertOrUpdate(response.PtbProsRif);
}
}
if (response.PtbPros != null)
catch (Exception e)
{
await localDb.InsertOrUpdate(response.PtbPros);
if (response.PtbProsRif != null) await localDb.InsertOrUpdate(response.PtbProsRif);
Console.WriteLine(e.Message);
SentrySdk.CaptureException(e);
throw;
}
});
}

View File

@@ -425,7 +425,7 @@ else
set
{
_filteredActivity = value;
StateHasChanged();
InvokeAsync(StateHasChanged);
}
}

View File

@@ -41,7 +41,7 @@
@if (ActivityModel.CodJcom != null && SelectedComessa == null)
{
<MudSkeleton />
<MudSkeleton/>
}
else
{
@@ -100,7 +100,7 @@
@if (ActivityModel.UserName != null && SelectedUser == null)
{
<MudSkeleton />
<MudSkeleton/>
}
else
{
@@ -128,7 +128,7 @@
@if (ActivityType.IsNullOrEmpty())
{
<MudSkeleton />
<MudSkeleton/>
}
else
{
@@ -400,7 +400,25 @@
SelectedUser = Users.FindLast(x => x.UserName.Equals(ActivityModel.UserName));
if (!IsNew && Id != null)
{
ActivityFileList = await IntegryApiService.GetActivityFile(Id);
if (ActivityModel.IdPosizione != null)
{
ActivityModel.Position = await IntegryApiService.RetrievePosition(ActivityModel.IdPosizione.Value);
CanAddPosition = false;
AttachedList ??= [];
AttachedList.Add(
new AttachedDTO
{
Name = ActivityModel.Position.Description!,
Lat = ActivityModel.Position.Lat,
Lng = ActivityModel.Position.Lng,
Type = AttachedDTO.TypeAttached.Position
}
);
}
}
ActivityResult = await ManageData.GetTable<StbActivityResult>();
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });

View File

@@ -151,28 +151,31 @@
private void OnNewName()
{
switch (Attached.Type)
if (Attached != null)
{
case AttachedDTO.TypeAttached.Position:
switch (Attached.Type)
{
CanAddPosition = false;
case AttachedDTO.TypeAttached.Position:
{
CanAddPosition = false;
Attached.Description = NewName!;
Attached.Description = NewName!;
Attached.Name = NewName!;
break;
}
case AttachedDTO.TypeAttached.Image:
{
var extension = Path.GetExtension(Attached.Name);
Attached.Name = NewName! + extension;
break;
}
case AttachedDTO.TypeAttached.Image:
{
var extension = Path.GetExtension(Attached.Name);
Attached.Name = NewName! + extension;
break;
break;
}
case AttachedDTO.TypeAttached.Document:
break;
default:
throw new ArgumentOutOfRangeException();
}
case AttachedDTO.TypeAttached.Document:
break;
default:
throw new ArgumentOutOfRangeException();
}
MudDialog.Close(Attached);

View File

@@ -7,7 +7,7 @@ namespace salesbook.Shared.Core.Entity;
public class PtbProsRif
{
[PrimaryKey, Column("composite_key")]
public string CompositeKey { get; set; }
public string CompositeKey { get; set; } = null!;
private string? _codPpro;

View File

@@ -173,4 +173,7 @@ public class StbActivity
[Column("plan_id"), JsonPropertyName("planId")]
public long? PlanId { get; set; }
[Column("id_posizione"), JsonPropertyName("idPosizione")]
public long? IdPosizione { get; set; }
}

View File

@@ -33,7 +33,7 @@ public interface IIntegryApiService
//Position
Task<PositionDTO> SavePosition(PositionDTO position);
Task<PositionDTO> RetrievePosition(string id);
Task<PositionDTO> RetrievePosition(long id);
//Google
Task<List<IndirizzoDTO>?> Geocode(string address);

View File

@@ -164,7 +164,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
public Task<PositionDTO> SavePosition(PositionDTO position) =>
integryApiRestClient.Post<PositionDTO>("savePosition", position)!;
public Task<PositionDTO> RetrievePosition(string id)
public Task<PositionDTO> RetrievePosition(long id)
{
var queryParams = new Dictionary<string, object> { { "id", id } };