Contracktor: merge
This commit is contained in:
commit
884a3692c9
@ -3,6 +3,7 @@ using ComputerStoreContracts.BusinessLogicContracts;
|
||||
using ComputerStoreContracts.SearchModels;
|
||||
using ComputerStoreContracts.ViewModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Windows;
|
||||
|
||||
namespace ComputerStoreRestAPI.Controllers
|
||||
{
|
||||
@ -24,12 +25,12 @@ namespace ComputerStoreRestAPI.Controllers
|
||||
|
||||
|
||||
public MainController(
|
||||
ILogger<MainController> logger,
|
||||
IComponentLogic componentLogic,
|
||||
IPCLogic pcLogic,
|
||||
IProductLogic productLogic,
|
||||
IEmployeeReportLogic employeeReportLogic,
|
||||
IRequestComponentLogic requestComponentLogic,
|
||||
ILogger<MainController> logger,
|
||||
IComponentLogic componentLogic,
|
||||
IPCLogic pcLogic,
|
||||
IProductLogic productLogic,
|
||||
IEmployeeReportLogic employeeReportLogic,
|
||||
IRequestComponentLogic requestComponentLogic,
|
||||
IRequestLogic requestLogic,
|
||||
IOrderLogic orderLogic,
|
||||
IConsignmentLogic consignmentLogic,
|
||||
@ -54,7 +55,7 @@ namespace ComputerStoreRestAPI.Controllers
|
||||
{
|
||||
return _componentLogic.ReadList(null);
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Receiving list of components error.");
|
||||
throw;
|
||||
@ -66,7 +67,7 @@ namespace ComputerStoreRestAPI.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
return _componentLogic.ReadElement(new ComponentSearchModel { ID = id } );
|
||||
return _componentLogic.ReadElement(new ComponentSearchModel { ID = id });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -82,7 +83,7 @@ namespace ComputerStoreRestAPI.Controllers
|
||||
{
|
||||
return _componentLogic.Delete(new ComponentBindingModel { ID = id });
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Removing component error.");
|
||||
throw;
|
||||
@ -106,11 +107,11 @@ namespace ComputerStoreRestAPI.Controllers
|
||||
[HttpPost]
|
||||
public bool InsertComponent(ComponentBindingModel component)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
return _componentLogic.Create(component);
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Inserting component error.");
|
||||
throw;
|
||||
@ -192,7 +193,7 @@ namespace ComputerStoreRestAPI.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
return _pcLogic.Delete(new PCBindingModel { ID = id});
|
||||
return _pcLogic.Delete(new PCBindingModel { ID = id });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -234,7 +235,7 @@ namespace ComputerStoreRestAPI.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
return _requestComponentLogic.ReadList(new RequestSearchModel { ID = id});
|
||||
return _requestComponentLogic.ReadList(new RequestSearchModel { ID = id });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -316,8 +317,8 @@ namespace ComputerStoreRestAPI.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Request
|
||||
[HttpGet]
|
||||
#region Request
|
||||
[HttpGet]
|
||||
public List<RequestViewModel>? GetRequestList()
|
||||
{
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user