RestAPI new methods.
This commit is contained in:
parent
2a1d3bb6fa
commit
3131e7626c
@ -3,6 +3,7 @@ using ComputerStoreContracts.BusinessLogicContracts;
|
|||||||
using ComputerStoreContracts.SearchModels;
|
using ComputerStoreContracts.SearchModels;
|
||||||
using ComputerStoreContracts.ViewModels;
|
using ComputerStoreContracts.ViewModels;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace ComputerStoreRestAPI.Controllers
|
namespace ComputerStoreRestAPI.Controllers
|
||||||
{
|
{
|
||||||
@ -54,7 +55,7 @@ namespace ComputerStoreRestAPI.Controllers
|
|||||||
{
|
{
|
||||||
return _componentLogic.ReadList(null);
|
return _componentLogic.ReadList(null);
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Receiving list of components error.");
|
_logger.LogError(ex, "Receiving list of components error.");
|
||||||
throw;
|
throw;
|
||||||
@ -66,7 +67,7 @@ namespace ComputerStoreRestAPI.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return _componentLogic.ReadElement(new ComponentSearchModel { ID = id } );
|
return _componentLogic.ReadElement(new ComponentSearchModel { ID = id });
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -82,7 +83,7 @@ namespace ComputerStoreRestAPI.Controllers
|
|||||||
{
|
{
|
||||||
return _componentLogic.Delete(new ComponentBindingModel { ID = id });
|
return _componentLogic.Delete(new ComponentBindingModel { ID = id });
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Removing component error.");
|
_logger.LogError(ex, "Removing component error.");
|
||||||
throw;
|
throw;
|
||||||
@ -110,7 +111,7 @@ namespace ComputerStoreRestAPI.Controllers
|
|||||||
{
|
{
|
||||||
return _componentLogic.Create(component);
|
return _componentLogic.Create(component);
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Inserting component error.");
|
_logger.LogError(ex, "Inserting component error.");
|
||||||
throw;
|
throw;
|
||||||
@ -192,7 +193,7 @@ namespace ComputerStoreRestAPI.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return _pcLogic.Delete(new PCBindingModel { ID = id});
|
return _pcLogic.Delete(new PCBindingModel { ID = id });
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -234,7 +235,7 @@ namespace ComputerStoreRestAPI.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return _requestComponentLogic.ReadList(new RequestSearchModel { ID = id});
|
return _requestComponentLogic.ReadList(new RequestSearchModel { ID = id });
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -244,8 +245,11 @@ namespace ComputerStoreRestAPI.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public List<ReportConsignmentsViewModel> GetReportConsignmentsList(ReportComponentsBindingModel model)
|
||||||
|
{
|
||||||
|
return _employeeReportLogic.GetConsignmentsByComponents(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#region Request
|
#region Request
|
||||||
|
Loading…
Reference in New Issue
Block a user