Try to use attributes for enum to string conversion
This commit is contained in:
@ -40,11 +40,7 @@
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn TItem="Campaign" Property="Id" Title="ID" SortOrder="SortOrder.Descending" Resizable="false" Width="100px" MaxWidth="100px" />
|
||||
<RadzenDataGridColumn TItem="Campaign" Property="Type" Title="Тип кампании">
|
||||
<Template Context="campaign">
|
||||
@CampaignTypeToString(campaign.Type)
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn TItem="Campaign" Property="Type" Title="Тип кампании" />
|
||||
<RadzenDataGridColumn TItem="Campaign" Property="CreatedAt" Title="Дата создания" Resizable="false" Width="150px" MaxWidth="150px" />
|
||||
<RadzenDataGridColumn TItem="Campaign" Property="StartedAt" Title="Дата начала" Resizable="false" Width="150px" MaxWidth="150px" />
|
||||
<RadzenDataGridColumn TItem="Campaign" Property="StartedAt" Title="Дата окончания" Resizable="false" Width="150px" MaxWidth="150px" />
|
||||
@ -127,17 +123,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
string CampaignTypeToString(Campaign.CampaignType campaignType)
|
||||
{
|
||||
return campaignType switch
|
||||
{
|
||||
Campaign.CampaignType.ExportPrivateRegistryElements_15_7_0_1 => "Экспорт частных справочников",
|
||||
Campaign.CampaignType.ExportCommonRegistryElements_15_7_0_1 => "Экспорт общих справочников",
|
||||
|
||||
_ => "???"
|
||||
};
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
CampaignManagementState.OnCampaignCreated -= OnCampaignCreated;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Hcs.WebApp.Data.Hcs
|
||||
{
|
||||
@ -6,7 +7,10 @@ namespace Hcs.WebApp.Data.Hcs
|
||||
{
|
||||
public enum CampaignType
|
||||
{
|
||||
[Display(Description = "Экспорт общих справочников")]
|
||||
ExportCommonRegistryElements_15_7_0_1,
|
||||
|
||||
[Display(Description = "Экспорт частных справочников")]
|
||||
ExportPrivateRegistryElements_15_7_0_1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user