Tidying work tree

This commit is contained in:
TypoMustakes
2023-12-05 14:30:14 +01:00
parent ce9f3e1df6
commit c079af78ad
4 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
using Microsoft.AspNetCore.Mvc;
using WD7UVN_HFT_2023241.Logic;
using System.Linq;
using WD7UVN_HFT_2023241.Models;
namespace WD7UVN_HFT_2023241.Endpoint
{
[ApiController]
[Route("api/database")]
public class CustomerController : ControllerBase
{
public ILogicServices LogicServices { get; set; }
public CustomerController(ILogicServices LogicServices)
{
this.LogicServices = LogicServices;
}
[HttpGet()]
public IActionResult ReadAllCustomers()
{
return View(LogicServices.CRUDOperations.ReadAllCustomers());
}
[HttpGet("{id}")]
public Customer ReadCustomer(int id)
{
return LogicServices.CRUDOperations.ReadCustomer(id);
}
[HttpPut()]
public void PutCustomer([FromBody] Customer e)
{
LogicServices.CRUDOperations.CreateCustomer(e);
}
[HttpPost()]
public void UpdateCustomer([FromBody] Customer e)
{
LogicServices.CRUDOperations.UpdateCustomer(e);
}
[HttpDelete()]
public void DeleteCustomer([FromBody] int id)
{
LogicServices.CRUDOperations.DeleteCustomer(id);
}
}
}

View File

@@ -0,0 +1,55 @@
using Microsoft.AspNetCore.Mvc;
using WD7UVN_HFT_2023241.Logic;
using System.Linq;
using WD7UVN_HFT_2023241.Models;
namespace WD7UVN_HFT_2023241.Endpoint
{
[ApiController]
[Route("api/database")]
public class EmployeeController : ControllerBase
{
public ILogicServices LogicServices { get; set; }
public EmployeeController(ILogicServices LogicServices)
{
this.LogicServices = LogicServices;
}
[HttpGet("GetSubordinates/{id}")]
public IQueryable<Employee> GetSubordinates(int id)
{
return LogicServices.GetSubordinates(id);
}
[HttpGet()]
public IActionResult ReadAllEmployees()
{
return View(LogicServices.CRUDOperations.ReadAllEmployees());
}
[HttpGet("{id}")]
public Employee ReadEmployee(int id)
{
return LogicServices.CRUDOperations.ReadEmployee(id);
}
[HttpPut()]
public void PutEmployee([FromBody] Employee e)
{
LogicServices.CRUDOperations.CreateEmployee(e);
}
[HttpPost()]
public void UpdateEmployee([FromBody] Employee e)
{
LogicServices.CRUDOperations.UpdateEmployee(e);
}
[HttpDelete()]
public void DeleteEmployee([FromBody] int id)
{
LogicServices.CRUDOperations.DeleteEmployee(id);
}
}
}

View File

@@ -0,0 +1,49 @@
using Microsoft.AspNetCore.Mvc;
using WD7UVN_HFT_2023241.Logic;
using System.Linq;
using WD7UVN_HFT_2023241.Models;
namespace WD7UVN_HFT_2023241.Endpoint
{
[ApiController]
[Route("api/database")]
public class MaintainerTeamController : ControllerBase
{
public ILogicServices LogicServices { get; set; }
public MaintainerTeamController(ILogicServices LogicServices)
{
this.LogicServices = LogicServices;
}
[HttpGet()]
public IActionResult ReadAllMaintainerTeams()
{
return View(LogicServices.CRUDOperations.ReadAllMaintainerTeams());
}
[HttpGet("{id}")]
public MaintainerTeam ReadMaintainerTeam(int id)
{
return LogicServices.CRUDOperations.ReadMaintainerTeam(id);
}
[HttpPut()]
public void PutMaintainerTeam([FromBody] MaintainerTeam e)
{
LogicServices.CRUDOperations.CreateMaintainerTeam(e);
}
[HttpPost()]
public void UpdateMaintainerTeam([FromBody] MaintainerTeam e)
{
LogicServices.CRUDOperations.UpdateMaintainerTeam(e);
}
[HttpDelete()]
public void DeleteMaintainerTeam([FromBody] int id)
{
LogicServices.CRUDOperations.DeleteMaintainerTeam(id);
}
}
}

View File

@@ -0,0 +1,49 @@
using Microsoft.AspNetCore.Mvc;
using WD7UVN_HFT_2023241.Logic;
using System.Linq;
using WD7UVN_HFT_2023241.Models;
namespace WD7UVN_HFT_2023241.Endpoint
{
[ApiController]
[Route("api/database")]
public class ServiceController : ControllerBase
{
public ILogicServices LogicServices { get; set; }
public ServiceController(ILogicServices LogicServices)
{
this.LogicServices = LogicServices;
}
[HttpGet()]
public IActionResult ReadAllServices()
{
return View(LogicServices.CRUDOperations.ReadAllServices());
}
[HttpGet("{id}")]
public Service ReadService(int id)
{
return LogicServices.CRUDOperations.ReadService(id);
}
[HttpPut()]
public void PutService([FromBody] Service e)
{
LogicServices.CRUDOperations.CreateService(e);
}
[HttpPost()]
public void UpdateService([FromBody] Service e)
{
LogicServices.CRUDOperations.UpdateService(e);
}
[HttpDelete()]
public void DeleteService([FromBody] int id)
{
LogicServices.CRUDOperations.DeleteService(id);
}
}
}