Moved enums to a dedicated namespace and updated references across the codebase. Renamed the `Info` field in the `Interaction` entity to `Info1`, including necessary migrations and UI adjustments. These changes improve the organization and consistency of the codebase.
48 lines
1.8 KiB
C#
48 lines
1.8 KiB
C#
using FoodsharingSiegen.Contracts.Entity;
|
|
using FoodsharingSiegen.Contracts.Enums;
|
|
|
|
namespace FoodsharingSiegen.Server.Data
|
|
{
|
|
/// <summary>
|
|
/// The audit helper class (a. beging, 31.05.2022)
|
|
/// </summary>
|
|
public static class AuditHelper
|
|
{
|
|
#region Public Method CreateText
|
|
|
|
/// <summary>
|
|
/// Creates the text using the specified audit (a. beging, 31.05.2022)
|
|
/// </summary>
|
|
/// <param name="audit">The audit</param>
|
|
/// <returns>The string</returns>
|
|
public static string CreateText(Audit audit)
|
|
{
|
|
switch (audit.Type)
|
|
{
|
|
case AuditType.SaveProfile:
|
|
return "hat das eigene Profil gespeichert.";
|
|
case AuditType.CreateUser:
|
|
return $"hat den User {audit.Data1} erstellt.";
|
|
case AuditType.UpdateUser:
|
|
return $"hat den User {audit.Data1} gespeichert.";
|
|
case AuditType.RemoveUser:
|
|
return $"hat den User {audit.Data1} gelöscht.";
|
|
case AuditType.SetUserPassword:
|
|
return $"hat das Passwort von {audit.Data1} geändert.";
|
|
case AuditType.CreateProspect:
|
|
return $"hat den Neuling {audit.Data1} erstellt.";
|
|
case AuditType.EditProspect:
|
|
return $"hat den Neuling {audit.Data1} bearbeitet.";
|
|
case AuditType.AddInteraction:
|
|
return $"hat dem Neuling {audit.Data1} folgendes hinzugefügt: {audit.Data2}";
|
|
case AuditType.RemoveInteraction:
|
|
return $"hat eine Interaktion bei {audit.Data1} gelöscht.";
|
|
case AuditType.None:
|
|
default:
|
|
return $"{audit.Data1}, {audit.Data2}";
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |