Primo sviluppo sincronizzazione e migliorie ui
This commit is contained in:
17
Template.Shared/Core/Helpers/ActivityCategoryHelper.cs
Normal file
17
Template.Shared/Core/Helpers/ActivityCategoryHelper.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Template.Shared.Core.Helpers.Enum;
|
||||
|
||||
namespace Template.Shared.Core.Helpers;
|
||||
|
||||
public static class ActivityCategoryHelper
|
||||
{
|
||||
public static string ConvertToHumanReadable(this ActivityCategoryEnum activityType)
|
||||
{
|
||||
return activityType switch
|
||||
{
|
||||
ActivityCategoryEnum.Memo => "memo",
|
||||
ActivityCategoryEnum.Interna => "inerna",
|
||||
ActivityCategoryEnum.Commessa => "commessa",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(activityType), activityType, null)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Template.Shared.Core.Helpers.Enum;
|
||||
|
||||
public enum ActivityCategoryEnum
|
||||
{
|
||||
Memo = 0,
|
||||
Interna = 1,
|
||||
Commessa = 2
|
||||
}
|
||||
6
Template.Shared/Core/Helpers/Enum/ActivityStatusEnum.cs
Normal file
6
Template.Shared/Core/Helpers/Enum/ActivityStatusEnum.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Template.Shared.Core.Helpers.Enum;
|
||||
|
||||
public enum ActivityStatusEnum
|
||||
{
|
||||
|
||||
}
|
||||
13
Template.Shared/Core/Helpers/MappingProfile.cs
Normal file
13
Template.Shared/Core/Helpers/MappingProfile.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using AutoMapper;
|
||||
using Template.Shared.Core.Dto;
|
||||
using Template.Shared.Core.Entity;
|
||||
|
||||
namespace Template.Shared.Core.Helpers;
|
||||
|
||||
public class MappingProfile : Profile
|
||||
{
|
||||
public MappingProfile()
|
||||
{
|
||||
CreateMap<StbActivity, ActivityDTO>();
|
||||
}
|
||||
}
|
||||
13
Template.Shared/Core/Helpers/ObjectExtensions.cs
Normal file
13
Template.Shared/Core/Helpers/ObjectExtensions.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
|
||||
namespace ConSegna.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);
|
||||
}
|
||||
Reference in New Issue
Block a user