Completato form attività e filtri

This commit is contained in:
2025-06-16 11:58:49 +02:00
parent 0032648e76
commit 7ca4de628b
44 changed files with 1241 additions and 924 deletions

View File

@@ -4,14 +4,21 @@ namespace Template.Shared.Core.Helpers;
public static class ActivityCategoryHelper
{
public static string ConvertToHumanReadable(this ActivityCategoryEnum activityType)
public static string ConvertToHumanReadable(this ActivityCategoryEnum activityCategory)
{
return activityType switch
return activityCategory switch
{
ActivityCategoryEnum.Memo => "memo",
ActivityCategoryEnum.Interna => "interna",
ActivityCategoryEnum.Commessa => "commessa",
_ => throw new ArgumentOutOfRangeException(nameof(activityType), activityType, null)
_ => throw new ArgumentOutOfRangeException(nameof(activityCategory), activityCategory, null)
};
}
public static List<ActivityCategoryEnum> AllActivityCategory =>
[
ActivityCategoryEnum.Memo,
ActivityCategoryEnum.Interna,
ActivityCategoryEnum.Commessa
];
}

View File

@@ -1,6 +0,0 @@
namespace Template.Shared.Core.Helpers.Enum;
public enum ActivityStatusEnum
{
}

View File

@@ -1,16 +1,17 @@
using MudBlazor;
using Template.Shared.Components.Pages;
using Template.Shared.Components.SingleElements.Modal;
namespace Template.Shared.Core.Helpers;
public class ModalHelpers
{
public static Task OpenActivityForm(IDialogService dialog ,string? id = null) =>
dialog.ShowAsync<ActivityForm>(
public static async Task<DialogResult?> OpenActivityForm(IDialogService dialog, string? id = null)
{
var modal = await dialog.ShowAsync<ActivityForm>(
"Activity form",
new DialogParameters<ActivityForm>
{
{ x => x.Id, id}
{ x => x.Id, id }
},
new DialogOptions
{
@@ -19,4 +20,7 @@ public class ModalHelpers
NoHeader = true
}
);
return await modal.Result;
}
}

View File

@@ -10,4 +10,10 @@ public static class ObjectExtensions
public static bool IsNullOrEmpty(this string? obj) =>
string.IsNullOrEmpty(obj);
}
public static bool EqualsIgnoreCase(this string obj, string anotherString) =>
string.Equals(obj, anotherString, StringComparison.OrdinalIgnoreCase);
public static bool ContainsIgnoreCase(this string obj, string anotherString) =>
obj.Contains(anotherString, StringComparison.OrdinalIgnoreCase);
}