Visual fixes
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
namespace GazpromApp.Enums;
|
||||
|
||||
public enum PeriodType
|
||||
{
|
||||
Unknown = -1,
|
||||
Day = 0,
|
||||
Week = 1,
|
||||
Month = 2,
|
||||
Year = 3
|
||||
}
|
||||
|
||||
public static class PeriodTypeExtensions
|
||||
{
|
||||
public static string ToDescription(this PeriodType periodType)
|
||||
{
|
||||
return periodType switch
|
||||
{
|
||||
PeriodType.Day => "День",
|
||||
PeriodType.Week => "Неделя",
|
||||
PeriodType.Month => "Месяц",
|
||||
PeriodType.Year => "Год",
|
||||
PeriodType.Unknown => "Неизв.",
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
public static PeriodType ToPeriodType(this string periodType)
|
||||
{
|
||||
return periodType switch
|
||||
{
|
||||
"День" => PeriodType.Day,
|
||||
"Неделя" => PeriodType.Week,
|
||||
"Месяц" => PeriodType.Month,
|
||||
"Год" => PeriodType.Year,
|
||||
_ => PeriodType.Unknown
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user