Rename salesbook
This commit is contained in:
24
salesbook.Shared/Core/Helpers/ActivityCategoryHelper.cs
Normal file
24
salesbook.Shared/Core/Helpers/ActivityCategoryHelper.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using salesbook.Shared.Core.Helpers.Enum;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
public static class ActivityCategoryHelper
|
||||
{
|
||||
public static string ConvertToHumanReadable(this ActivityCategoryEnum activityCategory)
|
||||
{
|
||||
return activityCategory switch
|
||||
{
|
||||
ActivityCategoryEnum.Memo => "memo",
|
||||
ActivityCategoryEnum.Interna => "interna",
|
||||
ActivityCategoryEnum.Commessa => "commessa",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(activityCategory), activityCategory, null)
|
||||
};
|
||||
}
|
||||
|
||||
public static List<ActivityCategoryEnum> AllActivityCategory =>
|
||||
[
|
||||
ActivityCategoryEnum.Memo,
|
||||
ActivityCategoryEnum.Interna,
|
||||
ActivityCategoryEnum.Commessa
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace salesbook.Shared.Core.Helpers.Enum;
|
||||
|
||||
public enum ActivityCategoryEnum
|
||||
{
|
||||
Memo = 0,
|
||||
Interna = 1,
|
||||
Commessa = 2
|
||||
}
|
||||
11
salesbook.Shared/Core/Helpers/IconConstants.cs
Normal file
11
salesbook.Shared/Core/Helpers/IconConstants.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
class IconConstants
|
||||
{
|
||||
public class Chip
|
||||
{
|
||||
public const string Stato = "ri-list-check-3 fa-fw fa-chip";
|
||||
public const string User = "ri-user-fill fa-fw fa-chip";
|
||||
public const string Time = "ri-time-line fa-fw fa-chip";
|
||||
}
|
||||
}
|
||||
17
salesbook.Shared/Core/Helpers/KeyGroupHelper.cs
Normal file
17
salesbook.Shared/Core/Helpers/KeyGroupHelper.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using salesbook.Shared.Core.Authorization.Enum;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
public static class KeyGroupHelper
|
||||
{
|
||||
public static string ConvertToHumanReadable(this KeyGroupEnum keyGroup)
|
||||
{
|
||||
return keyGroup switch
|
||||
{
|
||||
KeyGroupEnum.Agenti => "Agenti",
|
||||
KeyGroupEnum.Tecnico => "Tecnico",
|
||||
KeyGroupEnum.UtenteAziendale => "Utente Aziendale",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(keyGroup), keyGroup, null)
|
||||
};
|
||||
}
|
||||
}
|
||||
13
salesbook.Shared/Core/Helpers/MappingProfile.cs
Normal file
13
salesbook.Shared/Core/Helpers/MappingProfile.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using AutoMapper;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
public class MappingProfile : Profile
|
||||
{
|
||||
public MappingProfile()
|
||||
{
|
||||
CreateMap<StbActivity, ActivityDTO>();
|
||||
}
|
||||
}
|
||||
28
salesbook.Shared/Core/Helpers/ModalHelpers.cs
Normal file
28
salesbook.Shared/Core/Helpers/ModalHelpers.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using MudBlazor;
|
||||
using salesbook.Shared.Components.SingleElements.Modal;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
public class ModalHelpers
|
||||
{
|
||||
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.ActivityCopied, activity }
|
||||
},
|
||||
new DialogOptions
|
||||
{
|
||||
FullScreen = true,
|
||||
CloseButton = false,
|
||||
NoHeader = true
|
||||
}
|
||||
);
|
||||
|
||||
return await modal.Result;
|
||||
}
|
||||
}
|
||||
19
salesbook.Shared/Core/Helpers/ObjectExtensions.cs
Normal file
19
salesbook.Shared/Core/Helpers/ObjectExtensions.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
public static class ObjectExtensions
|
||||
{
|
||||
public static bool IsNullOrEmpty(this IEnumerable? obj) =>
|
||||
obj == null || obj.GetEnumerator().MoveNext() == false;
|
||||
|
||||
|
||||
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