RoleCheckPoint
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Newtonsoft.Json;
|
||||
using Serilog;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.Web.Services
|
||||
@@ -200,6 +204,24 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public List<SelectListItem> GetCheckStatus()
|
||||
{
|
||||
return Enum.GetValues(typeof(CheckStatus))
|
||||
.Cast<CheckStatus>()
|
||||
.Select(e => new SelectListItem
|
||||
{
|
||||
Value = ((int)e).ToString(),
|
||||
Text = GetEnumDisplayName(e)
|
||||
}).ToList();
|
||||
}
|
||||
private string GetEnumDisplayName(Enum enumValue)
|
||||
{
|
||||
return enumValue.GetType()
|
||||
.GetMember(enumValue.ToString())
|
||||
.First()
|
||||
.GetCustomAttribute<DisplayAttribute>()?.Name ?? enumValue.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user