Completato form attività e filtri
This commit is contained in:
@@ -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
|
||||
];
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Template.Shared.Core.Helpers.Enum;
|
||||
|
||||
public enum ActivityStatusEnum
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user