399 lines
14 KiB
C#
399 lines
14 KiB
C#
using gehGassi.Dto.Common;
|
|
using gehGassiApp.Domain.Common;
|
|
using gehGassiApp.Resources;
|
|
|
|
namespace gehGassiApp.Helper
|
|
{
|
|
/// <summary>
|
|
/// Hilfsmethoden rund um Enums
|
|
/// </summary>
|
|
public class EnumHelper
|
|
{
|
|
/// <summary>
|
|
/// Gibt eine Liste von Geschlechtern für die Auswahl zurück
|
|
/// </summary>
|
|
/// <returns>Liste Geschlechter</returns>
|
|
public static List<SexItem> GetSexList()
|
|
{
|
|
var result = new List<SexItem>
|
|
{
|
|
new() { Value = Sex.Undefined, Text = Text.Enum_Sex_Undefined },
|
|
new() { Value = Sex.Female, Text = Text.Enum_Sex_Female },
|
|
new() { Value = Sex.Male, Text = Text.Enum_Sex_Male },
|
|
new() { Value = Sex.Diverse, Text = Text.Enum_Sex_Diverse },
|
|
new() { Value = Sex.Inter, Text = Text.Enum_Sex_Inter },
|
|
new() { Value = Sex.Open, Text = Text.Enum_Sex_Open }
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Zuständen einer öffentlichen Anfrage für die Auswahl zurück
|
|
/// </summary>
|
|
/// <param name="addAll">True wenn die Auswahl "Alle" hinzugefügt werden soll. Dann ist der Wert NULL</param>
|
|
/// <returns>Liste Status öffntliche Anfrage</returns>
|
|
public static List<PublicWalkRequestStatusItem> GetPublicWalkRequestStatusList(bool addAll)
|
|
{
|
|
var result = new List<PublicWalkRequestStatusItem>
|
|
{
|
|
new() { Value = PublicWalkRequestStatus.Open, Text = Text.Enum_PublicWalkRequestStatus_Open },
|
|
new() { Value = PublicWalkRequestStatus.Placed, Text = Text.Enum_PublicWalkRequestStatus_Placed },
|
|
new() { Value = PublicWalkRequestStatus.TimedOut, Text = Text.Enum_PublicWalkRequestStatus_TimedOut },
|
|
new() { Value = PublicWalkRequestStatus.Cancelled, Text = Text.Enum_PublicWalkRequestStatus_Cancelled }
|
|
};
|
|
if (addAll)
|
|
{
|
|
result.Insert(0, new PublicWalkRequestStatusItem(){Value = null, Text = Text.Common_All});
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Zuständen eines Walks für die Auswahl zurück
|
|
/// </summary>
|
|
/// <param name="addAll">True wenn die Auswahl "Alle" hinzugefügt werden soll. Dann ist der Wert NULL</param>
|
|
/// <returns>Liste Walkstatus</returns>
|
|
public static List<WalkStatusItem> GetWalkStatusList(bool addAll)
|
|
{
|
|
var result = new List<WalkStatusItem>
|
|
{
|
|
new() { Value = WalkStatus.Requested, Text = Text.Enum_WalkStatus_Requested },
|
|
new() { Value = WalkStatus.Accepted, Text = Text.Enum_WalkStatus_Accepted },
|
|
new() { Value = WalkStatus.Declined, Text = Text.Enum_WalkStatus_Declined },
|
|
new() { Value = WalkStatus.Cancelled, Text = Text.Enum_WalkStatus_Cancelled },
|
|
new() { Value = WalkStatus.Started, Text = Text.Enum_WalkStatus_Started },
|
|
new() { Value = WalkStatus.Completed, Text = Text.Enum_WalkStatus_Completed },
|
|
new() { Value = WalkStatus.Confirmed, Text = Text.Enum_WalkStatus_Confirmed },
|
|
new() { Value = WalkStatus.Complained, Text = Text.Enum_WalkStatus_Complained },
|
|
new() { Value = WalkStatus.ComplainResolved, Text = Text.Enum_WalkStatus_ComplainResolved }
|
|
};
|
|
if (addAll)
|
|
{
|
|
result.Insert(0, new WalkStatusItem() { Value = null, Text = Text.Common_All });
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Servicetypen eines Walks für die Auswahl zurück
|
|
/// </summary>
|
|
/// <param name="addAll">True wenn die Auswahl "Alle" hinzugefügt werden soll. Dann ist der Wert NULL</param>
|
|
/// <returns>Liste Walkstatus</returns>
|
|
public static List<WalkServiceTypeItem> GetWalkServiceTypeList(bool addAll)
|
|
{
|
|
var result = new List<WalkServiceTypeItem>
|
|
{
|
|
new() { Value = WalkServiceType.Walking, Text = Text.Enum_WalkServiceType_Walking },
|
|
new() { Value = WalkServiceType.Sitting, Text = Text.Enum_WalkServiceType_Sitting },
|
|
new() { Value = WalkServiceType.DayCare, Text = Text.Enum_WalkServiceType_DayCare }
|
|
};
|
|
if (addAll)
|
|
{
|
|
result.Insert(0, new WalkServiceTypeItem() { Value = null, Text = Text.Common_All });
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Tagen für die Auswahl zurück
|
|
/// </summary>
|
|
/// <returns>Liste Walkstatus</returns>
|
|
public static List<DayOfWeekItem> GetWeekDayList()
|
|
{
|
|
var result = new List<DayOfWeekItem>
|
|
{
|
|
new() { Value = DayOfWeek.Sunday, Text = Text.Enum_DayOfWeek_Sunday },
|
|
new() { Value = DayOfWeek.Monday, Text = Text.Enum_DayOfWeek_Monday },
|
|
new() { Value = DayOfWeek.Tuesday, Text = Text.Enum_DayOfWeek_Tuesday },
|
|
new() { Value = DayOfWeek.Wednesday, Text = Text.Enum_DayOfWeek_Wednesday },
|
|
new() { Value = DayOfWeek.Thursday, Text = Text.Enum_DayOfWeek_Thursday },
|
|
new() { Value = DayOfWeek.Friday, Text = Text.Enum_DayOfWeek_Friday },
|
|
new() { Value = DayOfWeek.Saturday, Text = Text.Enum_DayOfWeek_Saturday }
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Feedback-Typen für die Auswahl zurück
|
|
/// </summary>
|
|
/// <returns>Liste Feedback-Typen</returns>
|
|
public static List<AppFeedbackTypeItem> GetFeedbackTypeList()
|
|
{
|
|
var result = new List<AppFeedbackTypeItem>
|
|
{
|
|
new() { Value = AppFeedbackType.Problem, Text = Text.Enum_AppFeedbackType_Problem },
|
|
new() { Value = AppFeedbackType.Idea, Text = Text.Enum_AppFeedbackType_Idea },
|
|
new() { Value = AppFeedbackType.Like, Text = Text.Enum_AppFeedbackType_Like },
|
|
new() { Value = AppFeedbackType.DontLike, Text = Text.Enum_AppFeedbackType_DontLike },
|
|
new() { Value = AppFeedbackType.General, Text = Text.Enum_AppFeedbackType_General }
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Reklamations-Typen für die Auswahl zurück
|
|
/// </summary>
|
|
/// <returns>Liste Reklamations-Typen</returns>
|
|
public static List<WalkComplaintTypeItem> GetWalkComplaintTypeList()
|
|
{
|
|
var result = new List<WalkComplaintTypeItem>
|
|
{
|
|
new() { Value = WalkComplaintType.NoWalk, Text = Text.Enum_WalkComplaintType_NoWalk },
|
|
new() { Value = WalkComplaintType.ShortWalk, Text = Text.Enum_WalkComplaintType_ShortWalk },
|
|
new() { Value = WalkComplaintType.Condition, Text = Text.Enum_WalkComplaintType_Condition },
|
|
new() { Value = WalkComplaintType.Other, Text = Text.Enum_WalkComplaintType_Other }
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Hundegeschlechtern für die Auswahl zurück
|
|
/// </summary>
|
|
/// <returns>Liste Hundegeschlechter</returns>
|
|
public static List<DogSexItem> GetDogSexList()
|
|
{
|
|
var result = new List<DogSexItem>
|
|
{
|
|
new() { Value = DogSex.FemaleDog, Text = Text.DogSex_FemaleDog },
|
|
new() { Value = DogSex.MaleDog, Text = Text.DogSex_MaleDog }
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Hundegrößen für die Auswahl zurück
|
|
/// </summary>
|
|
/// <returns>Liste Hundegrößen</returns>
|
|
public static List<DogSizeItem> GetDogSizeList()
|
|
{
|
|
var result = new List<DogSizeItem>
|
|
{
|
|
new() { Value = DogSize.Small, Text = Text.DogSize_Small },
|
|
new() { Value = DogSize.Middle, Text = Text.DogSize_Middle },
|
|
new() { Value = DogSize.Big, Text = Text.DogSize_Big },
|
|
new() { Value = DogSize.Giant, Text = Text.DogSize_Giant },
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Meldungstype für die Auswahl zurück
|
|
/// </summary>
|
|
/// <returns>Liste Meldungstypen</returns>
|
|
public static List<AppUserReportTypeItem> GetAppUserReportTypeItemList()
|
|
{
|
|
var result = new List<AppUserReportTypeItem>
|
|
{
|
|
new() { Value = AppUserReportType.Objectionable, Text = Text.AppUserReportType_Objectionable },
|
|
new() { Value = AppUserReportType.PoliticallyIncorrect, Text = Text.AppUserReportType_PoliticallyIncorrect },
|
|
new() { Value = AppUserReportType.Obscene, Text = Text.AppUserReportType_Obscene },
|
|
new() { Value = AppUserReportType.IncorrectData, Text = Text.AppUserReportType_IncorrectData },
|
|
new() { Value = AppUserReportType.Intrusive, Text = Text.AppUserReportType_Intrusive },
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gibt eine Liste von Meldungstype für die Auswahl zurück
|
|
/// </summary>
|
|
/// <returns>Liste Meldungstypen</returns>
|
|
public static List<AppUserReportBlockTypeItem> GetAppUserReportBlockTypeList()
|
|
{
|
|
var result = new List<AppUserReportBlockTypeItem>
|
|
{
|
|
new() { Value = AppUserReportBlockType.NoBlock, Text = Text.AppUserReportBlockType_NoBlock, },
|
|
new() { Value = AppUserReportBlockType.BlockForTime, Text = Text.AppUserReportBlockType_BlockForTime },
|
|
new() { Value = AppUserReportBlockType.BlockForever, Text = Text.AppUserReportBlockType_BlockForever }
|
|
};
|
|
|
|
return result;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl des Geschlechts
|
|
/// </summary>
|
|
public class SexItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public Sex Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl des Status einer öffentlichen Anfrage
|
|
/// </summary>
|
|
public class PublicWalkRequestStatusItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public PublicWalkRequestStatus? Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl des Status eines Walks
|
|
/// </summary>
|
|
public class WalkStatusItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public WalkStatus? Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl des Service-Typs eines Walks
|
|
/// </summary>
|
|
public class WalkServiceTypeItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public WalkServiceType? Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswalh eines Wochentages
|
|
/// </summary>
|
|
public class DayOfWeekItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public DayOfWeek Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl eines Feedback Typs
|
|
/// </summary>
|
|
public class AppFeedbackTypeItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public AppFeedbackType Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl eines Reklamations Typs
|
|
/// </summary>
|
|
public class WalkComplaintTypeItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public WalkComplaintType Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl des Geschlechts eines Hundes
|
|
/// </summary>
|
|
public class DogSexItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public DogSex Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl der Größe eines Hundes
|
|
/// </summary>
|
|
public class DogSizeItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public DogSize Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl der Meldungsart
|
|
/// </summary>
|
|
public class AppUserReportTypeItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public AppUserReportType Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hilfsklasse für die Auswahl der Blockierungsart bei einer Meldung
|
|
/// </summary>
|
|
public class AppUserReportBlockTypeItem
|
|
{
|
|
/// <summary>
|
|
/// Enum-Wert
|
|
/// </summary>
|
|
public AppUserReportBlockType Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Text der angezeigt werden soll
|
|
/// </summary>
|
|
public string Text { get; set; }
|
|
}
|
|
}
|