Add the jump type in the tunnel flight
This commit is contained in:
@@ -11,11 +11,13 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public TunnelFlightService(ITunnelFlightRepository tunnelFlightRepository,
|
||||
public TunnelFlightService(IJumpTypeService jumpTypeService,
|
||||
ITunnelFlightRepository tunnelFlightRepository,
|
||||
IDropZoneService dropZoneService,
|
||||
IIdentityService identityService)
|
||||
{
|
||||
_dropZoneService = dropZoneService;
|
||||
_jumpTypeService = jumpTypeService;
|
||||
_identityService = identityService;
|
||||
_tunnelFlightRepository = tunnelFlightRepository;
|
||||
}
|
||||
@@ -73,8 +75,8 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
return _tunnelFlightRepository.GetBetweenDate(_identityService.ConnectedUser, convertedBeginDate, convertedEndDate);
|
||||
}
|
||||
|
||||
public void AddNewFlight(int tunnelId, TunnelFlight newFlight)
|
||||
|
||||
public void AddNewFlight(int tunnelId, int jumpTypeId, TunnelFlight newFlight)
|
||||
{
|
||||
var tmp = _dropZoneService.GetDzById(tunnelId);
|
||||
var selectedTunnel = new Tunnel
|
||||
@@ -88,7 +90,11 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
Longitude = tmp.Longitude
|
||||
};
|
||||
|
||||
var selectedJumpType = _jumpTypeService.GetJumpTypeById(jumpTypeId);
|
||||
|
||||
|
||||
newFlight.Tunnel = selectedTunnel;
|
||||
newFlight.JumpType = selectedJumpType;
|
||||
_tunnelFlightRepository.Add(newFlight);
|
||||
}
|
||||
|
||||
@@ -112,6 +118,7 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
#region Private Fields
|
||||
|
||||
private readonly IDropZoneService _dropZoneService;
|
||||
private readonly IJumpTypeService _jumpTypeService;
|
||||
private readonly ITunnelFlightRepository _tunnelFlightRepository;
|
||||
private readonly IIdentityService _identityService;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user