Added Locations Create CRUD element, Updated Locations LDAP service methods

This commit is contained in:
2025-10-08 21:06:04 +02:00
parent 0ed9397280
commit ba7cde8adb
5 changed files with 82 additions and 54 deletions

View File

@@ -4,15 +4,11 @@ using System.Text.Json;
using Berufsschule_HAM.Exceptions;
public class LocationModel
{
public required string Cn { get; set; }
public required string Location { get; set; }
public LocationsDescription? Description { get; set; }
public string? Location { get; set; }
public string? Street { get; set; }
public LocationModel(Dictionary<string, string> ldapData)
{
Cn = ldapData.GetValueOrDefault("cn") ?? throw new LocationModelConfigurationException();
Location = ldapData.GetValueOrDefault("l");
Street = ldapData.GetValueOrDefault("street");
Location = ldapData.GetValueOrDefault("l") ?? throw new LocationModelConfigurationException();
string? descriptionValue = ldapData.GetValueOrDefault("description");
if (descriptionValue is null)
{
@@ -26,6 +22,7 @@ public class LocationModel
}
public class LocationsDescription
{
public string? Location { get; set; }
public string? RoomNumber { get; set; }
public string? Seat { get; set; }
}