feat(dal): В Work добавлена маска имени шаблонов, выполнена миграция БД.
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
namespace PARR.Constants.Shortcode
|
||||
{
|
||||
public static class ShortcodeNames
|
||||
{
|
||||
private static Dictionary<Shortcodes, string> ShortcodeNamesList = new Dictionary<Shortcodes, string>
|
||||
{
|
||||
{Shortcodes.EK, "%ЭК%" }
|
||||
};
|
||||
|
||||
public static string GetShortcodeName(Shortcodes shortcode)
|
||||
{
|
||||
return ShortcodeNamesList[shortcode];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
namespace PARR.Constants.Shortcode
|
||||
namespace PARR.Constants.Shortcodes
|
||||
{
|
||||
public enum Shortcodes
|
||||
public enum ShortcodeEnum
|
||||
{
|
||||
EK
|
||||
EK,
|
||||
ZO
|
||||
//!!!Не забыть добавить в справочник имен (ShortcodeName) строковое значение
|
||||
}
|
||||
}
|
||||
15
PARR.Constants/Shortcodes/ShortcodeItem.cs
Normal file
15
PARR.Constants/Shortcodes/ShortcodeItem.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PARR.Constants.Shortcodes
|
||||
{
|
||||
public class ShortcodeItem
|
||||
{
|
||||
public ShortcodeEnum ShortcodeEnum { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public required string Description { get; set; }
|
||||
}
|
||||
}
|
||||
20
PARR.Constants/Shortcodes/Shortcodes.cs
Normal file
20
PARR.Constants/Shortcodes/Shortcodes.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Data.Common;
|
||||
|
||||
namespace PARR.Constants.Shortcodes
|
||||
{
|
||||
public static class Shortcodes
|
||||
{
|
||||
private static readonly List<ShortcodeItem> ShortcodesList = new List<ShortcodeItem>()
|
||||
{
|
||||
new ShortcodeItem { ShortcodeEnum = ShortcodeEnum.EK, Name = "%ЭК%", Description = "Элемент конфигурации"},
|
||||
new ShortcodeItem { ShortcodeEnum = ShortcodeEnum.ZO, Name = "%ЗО%", Description = "Зона ответственности"}
|
||||
|
||||
};
|
||||
|
||||
public static string GetShortcodeName(ShortcodeEnum shortcode)
|
||||
{
|
||||
return ShortcodesList.First(s => s.ShortcodeEnum == shortcode).Name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user