mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Implemented /Home/Location table and delete action
This commit is contained in:
@@ -54,9 +54,21 @@ public class HomeController : Controller
|
||||
}
|
||||
|
||||
[HttpGet("Locations")]
|
||||
public ActionResult Locations()
|
||||
public async Task<ActionResult> LocationsAsync()
|
||||
{
|
||||
return View();
|
||||
IEnumerable<LocationModel> locations = await _ldap.ListLocationsAsync();
|
||||
List<LocationTableViewModel> LocationsTableViewModels = [];
|
||||
foreach (LocationModel location in locations)
|
||||
{
|
||||
LocationsTableViewModels.Add(new()
|
||||
{
|
||||
LocationID = location.Location,
|
||||
LocationName = location.Description?.Location ?? "",
|
||||
RoomNumber = location.Description?.RoomNumber ?? "",
|
||||
Seat = location.Description?.Seat ?? ""
|
||||
});
|
||||
}
|
||||
return View(new LocationsIndexViewModel() { LocationTableViewModels = LocationsTableViewModels });
|
||||
}
|
||||
|
||||
[HttpGet("Users")]
|
||||
|
||||
Reference in New Issue
Block a user