UI rendberakása
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
using WorkFlowCheck.Common.Helper;
|
||||
|
||||
namespace WorkFlowCheck.Common.DTO
|
||||
{
|
||||
@@ -17,6 +18,8 @@ namespace WorkFlowCheck.Common.DTO
|
||||
[DisplayName("Státusz")]
|
||||
public CheckStatus CheckStatus { get; set; }
|
||||
|
||||
public string StatusName => DisplayNameHelper.GetEnumDisplayName(CheckStatus);
|
||||
|
||||
[DisplayName("Dátum")]
|
||||
public DateTime DateExecution { get; set; }
|
||||
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace WorkFlowCheck.Common.Enums
|
||||
{
|
||||
public enum CheckStatus
|
||||
{
|
||||
|
||||
[Display(Name = "Nyitott")]
|
||||
Open = 0,
|
||||
|
||||
[Display(Name = "Folyamatban")]
|
||||
InProgress = 1,
|
||||
|
||||
[Display(Name = "Blokkolt")]
|
||||
Blocked = 2,
|
||||
|
||||
[Display(Name = "Sztornózva")]
|
||||
Storno = 3,
|
||||
|
||||
[Display(Name = "Beküldött")]
|
||||
Sent = 4,
|
||||
|
||||
[Display(Name = "Jóváhagyva")]
|
||||
Signed = 5,
|
||||
|
||||
[Display(Name = "Lezárva")]
|
||||
Closed = 6
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -17,6 +19,15 @@ namespace WorkFlowCheck.Common.Helper
|
||||
|
||||
return displayNameAttribute?.DisplayName ?? propertyName;
|
||||
}
|
||||
public static string GetEnumDisplayName(this Enum enumValue)
|
||||
{
|
||||
return enumValue
|
||||
.GetType()
|
||||
.GetMember(enumValue.ToString())
|
||||
.First()
|
||||
.GetCustomAttribute<DisplayAttribute>()?
|
||||
.Name ?? enumValue.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user