Visual fixes

This commit is contained in:
retr0volkov
2025-07-05 20:50:36 +03:00 Unverified
parent de8c487f92
commit bd8b780a39
11 changed files with 52 additions and 7 deletions
+38
View File
@@ -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
};
}
}