Cancellazione attività
This commit is contained in:
@@ -9,6 +9,8 @@ public class ActivityDTO : StbActivity
|
||||
public string? Cliente { get; set; }
|
||||
public ActivityCategoryEnum Category { get; set; }
|
||||
public bool Complete { get; set; }
|
||||
|
||||
public bool Deleted { get; set; }
|
||||
|
||||
public ActivityDTO Clone()
|
||||
{
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
using MudBlazor;
|
||||
using Template.Shared.Components.SingleElements.Modal;
|
||||
using Template.Shared.Core.Dto;
|
||||
|
||||
namespace Template.Shared.Core.Helpers;
|
||||
|
||||
public class ModalHelpers
|
||||
{
|
||||
public static async Task<DialogResult?> OpenActivityForm(IDialogService dialog, string? id = null)
|
||||
public static async Task<DialogResult?> OpenActivityForm(IDialogService dialog, ActivityDTO? activity, string? id)
|
||||
{
|
||||
var modal = await dialog.ShowAsync<ActivityForm>(
|
||||
"Activity form",
|
||||
new DialogParameters<ActivityForm>
|
||||
{
|
||||
{ x => x.Id, id }
|
||||
{ x => x.Id, id },
|
||||
{ x => x.ActivityCopied, activity }
|
||||
},
|
||||
new DialogOptions
|
||||
{
|
||||
|
||||
@@ -11,5 +11,7 @@ public interface IIntegryApiService
|
||||
Task<TaskSyncResponseDTO> RetrieveProspect(string? dateFilter = null);
|
||||
Task<SettingsResponseDTO> RetrieveSettings();
|
||||
|
||||
Task DeleteActivity(string activityId);
|
||||
|
||||
Task<List<StbActivity>?> SaveActivity(ActivityDTO activity);
|
||||
}
|
||||
@@ -11,5 +11,8 @@ public interface IManageDataService
|
||||
|
||||
Task InsertOrUpdate<T>(T objectToSave);
|
||||
|
||||
Task Delete<T>(T objectToDelete);
|
||||
Task DeleteActivity(ActivityDTO activity);
|
||||
|
||||
Task ClearDb();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using Template.Shared.Core.Dto;
|
||||
|
||||
namespace Template.Shared.Core.Messages.Activity.Copy;
|
||||
|
||||
public class CopyActivityMessage(ActivityDTO value) : ValueChangedMessage<ActivityDTO>(value);
|
||||
@@ -0,0 +1,17 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Template.Shared.Core.Dto;
|
||||
|
||||
namespace Template.Shared.Core.Messages.Activity.Copy;
|
||||
|
||||
public class CopyActivityService
|
||||
{
|
||||
public event Action<ActivityDTO>? OnCopyActivity;
|
||||
|
||||
public CopyActivityService(IMessenger messenger)
|
||||
{
|
||||
messenger.Register<CopyActivityMessage>(this, (_, o) =>
|
||||
{
|
||||
OnCopyActivity?.Invoke(o.Value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
|
||||
namespace Template.Shared.Core.Messages.Activity.New;
|
||||
|
||||
public class NewActivityMessage(string value) : ValueChangedMessage<string>(value);
|
||||
@@ -0,0 +1,16 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
|
||||
namespace Template.Shared.Core.Messages.Activity.New;
|
||||
|
||||
public class NewActivityService
|
||||
{
|
||||
public event Action<string>? OnActivityCreated;
|
||||
|
||||
public NewActivityService(IMessenger messenger)
|
||||
{
|
||||
messenger.Register<NewActivityMessage>(this, (_, o) =>
|
||||
{
|
||||
OnActivityCreated?.Invoke(o.Value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
|
||||
namespace Template.Shared.Core.Messages;
|
||||
namespace Template.Shared.Core.Messages.Back;
|
||||
|
||||
public class BackNavigationService
|
||||
{
|
||||
public event Action? OnHardwareBack;
|
||||
|
||||
public BackNavigationService()
|
||||
public BackNavigationService(IMessenger messenger)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Register<HardwareBackMessage>(this, (r, m) =>
|
||||
messenger.Register<HardwareBackMessage>(this, (_, _) =>
|
||||
{
|
||||
OnHardwareBack?.Invoke();
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
|
||||
namespace Template.Shared.Core.Messages;
|
||||
namespace Template.Shared.Core.Messages.Back;
|
||||
|
||||
public class HardwareBackMessage(string value) : ValueChangedMessage<string>(value);
|
||||
@@ -53,7 +53,17 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
}
|
||||
|
||||
public Task<SettingsResponseDTO> RetrieveSettings() =>
|
||||
integryApiRestClient.AuthorizedGet<SettingsResponseDTO>("crm/retrieveSettings", null)!;
|
||||
integryApiRestClient.AuthorizedGet<SettingsResponseDTO>("crm/retrieveSettings")!;
|
||||
|
||||
public Task DeleteActivity(string activityId)
|
||||
{
|
||||
var queryParams = new Dictionary<string, object>
|
||||
{
|
||||
{ "activityId", activityId }
|
||||
};
|
||||
|
||||
return integryApiRestClient.AuthorizedGet<object>($"activity/delete", queryParams);
|
||||
}
|
||||
|
||||
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity) =>
|
||||
integryApiRestClient.AuthorizedPost<List<StbActivity>?>("crm/saveActivity", activity);
|
||||
|
||||
Reference in New Issue
Block a user