mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Added Locations Create CRUD element, Updated Locations LDAP service methods
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
namespace Berufsschule_HAM.Models;
|
||||
|
||||
public class LocationsCreateRequestModel
|
||||
{
|
||||
public required LocationsDescription LocationsDescription { get; set; }
|
||||
}
|
||||
|
||||
public class LocationsModifyRequestModel
|
||||
{
|
||||
public required string Cn { get; set; }
|
||||
public string? NewCn { get; set; } = null;
|
||||
public LocationsDescription? Description { get; set; } = null;
|
||||
public string? Location { get; set; } = null;
|
||||
public string? Street { get; set; } = null;
|
||||
public required string Location { get; set; }
|
||||
public required LocationsDescription Description { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user