list.ForEach(o => { o.ViewStage = o.ViewStage.DisplayStageName(); });
public static class EnforceCertExtensions
{
/// <summary>
/// 显示 阶段名称
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static string DisplayStageName(this string id)
{
return EnforceCertHelper.StageList.FirstOrDefault(o => o.Id == id)?.Name;
}
}
/// <summary>
/// 执法凭证单 阶段
/// </summary>
public static class EnforceCertHelper
{
public static readonly IReadOnlyList<EnforceCertStage> StageList;
static EnforceCertHelper()
{
StageList = new List<EnforceCertStage>
{
//new EnforceCertStage {Id = "1", Name = "执法整改后"},
//new EnforceCertStage {Id = "2", Name = "生成巡查单时显示"},
//new EnforceCertStage {Id = "3", Name = "巡查结束显示"}
new EnforceCertStage {Id = "1", Name = "执法整个之后"},
new EnforceCertStage {Id = "2", Name = "巡查进行时"},
new EnforceCertStage {Id = "3", Name = "巡查结束之后"},
new EnforceCertStage {Id = "4", Name = "巡查开始之前"}
};
}
}