Add comments by AI
This commit is contained in:
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by year.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsByYear entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsByYear> GetStats()
|
public IEnumerable<StatsByYear> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsByYearRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsByYearRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -50,6 +54,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the year statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsByYearRepository.Delete(_identityService.ConnectedUser);
|
_statsByYearRepository.Delete(_identityService.ConnectedUser);
|
||||||
@@ -65,4 +72,4 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics for the last month grouped by drop zone.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsForLastMonthByDz entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsForLastMonthByDz> GetStats()
|
public IEnumerable<StatsForLastMonthByDz> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsForLastMonthByDzRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsForLastMonthByDzRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -55,6 +59,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the last month drop zone statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsForLastMonthByDzRepository.Delete(_identityService.ConnectedUser);
|
_statsForLastMonthByDzRepository.Delete(_identityService.ConnectedUser);
|
||||||
@@ -70,4 +77,4 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics for the last month grouped by jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsForLastMonthByJumpType entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsForLastMonthByJumpType> GetStats()
|
public IEnumerable<StatsForLastMonthByJumpType> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsForLastMonthByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsForLastMonthByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -55,6 +59,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the last month jump type statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsForLastMonthByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
_statsForLastMonthByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
||||||
@@ -70,4 +77,4 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics for the last year grouped by drop zone.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsForLastYearByDz entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsForLastYearByDz> GetStats()
|
public IEnumerable<StatsForLastYearByDz> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsForLastYearByDzRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsForLastYearByDzRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -54,6 +58,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the last year drop zone statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsForLastYearByDzRepository.Delete(_identityService.ConnectedUser);
|
_statsForLastYearByDzRepository.Delete(_identityService.ConnectedUser);
|
||||||
@@ -69,4 +76,4 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics for the last year grouped by jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsForLastYearByJumpType entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsForLastYearByJumpType> GetStats()
|
public IEnumerable<StatsForLastYearByJumpType> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsForLastYearByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsForLastYearByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -54,7 +58,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the last year jump type statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsForLastYearByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
_statsForLastYearByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
||||||
@@ -71,4 +77,4 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves a simple summary of all statistics.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A SimpleSummary entity containing the simple summary statistics.</returns>
|
||||||
public SimpleSummary GetSimpleSummary()
|
public SimpleSummary GetSimpleSummary()
|
||||||
{
|
{
|
||||||
var allJumps = _jumpService.GetAllJumps();
|
var allJumps = _jumpService.GetAllJumps();
|
||||||
@@ -58,6 +62,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets all statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsByAircraftService.Reset();
|
_statsByAircraftService.Reset();
|
||||||
@@ -72,6 +79,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
_statsForLastYearByJumpTypeService.Reset();
|
_statsForLastYearByJumpTypeService.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by aircraft.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing aircraft statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsByAircraft()
|
public IEnumerable<Statistic> GetStatsByAircraft()
|
||||||
{
|
{
|
||||||
var tmp = _statsByAircraftService.GetStats();
|
var tmp = _statsByAircraftService.GetStats();
|
||||||
@@ -82,6 +93,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by drop zone.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing drop zone statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsByDz()
|
public IEnumerable<Statistic> GetStatsByDz()
|
||||||
{
|
{
|
||||||
var tmp = _statsByDzService.GetStats();
|
var tmp = _statsByDzService.GetStats();
|
||||||
@@ -92,6 +107,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by gear.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing gear statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsByGear()
|
public IEnumerable<Statistic> GetStatsByGear()
|
||||||
{
|
{
|
||||||
var tmp = _statsByGearService.GetStats();
|
var tmp = _statsByGearService.GetStats();
|
||||||
@@ -102,6 +121,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing jump type statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsByJumpType()
|
public IEnumerable<Statistic> GetStatsByJumpType()
|
||||||
{
|
{
|
||||||
var tmp = _statsByJumpTypeService.GetStats();
|
var tmp = _statsByJumpTypeService.GetStats();
|
||||||
@@ -112,6 +135,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by year.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing year statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsByYear()
|
public IEnumerable<Statistic> GetStatsByYear()
|
||||||
{
|
{
|
||||||
var tmp = _statsByYearService.GetStats();
|
var tmp = _statsByYearService.GetStats();
|
||||||
@@ -122,6 +149,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics for the last month grouped by drop zone.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing last month drop zone statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsForLastMonthByDz()
|
public IEnumerable<Statistic> GetStatsForLastMonthByDz()
|
||||||
{
|
{
|
||||||
var tmp = _statsForLastMonthByDzService.GetStats();
|
var tmp = _statsForLastMonthByDzService.GetStats();
|
||||||
@@ -132,6 +163,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics for the last month grouped by jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing last month jump type statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsForLastMonthByJumpType()
|
public IEnumerable<Statistic> GetStatsForLastMonthByJumpType()
|
||||||
{
|
{
|
||||||
var tmp = _statsForLastMonthByJumpTypeService.GetStats();
|
var tmp = _statsForLastMonthByJumpTypeService.GetStats();
|
||||||
@@ -142,6 +177,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics for the last year grouped by drop zone.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing last year drop zone statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsForLastYearByDz()
|
public IEnumerable<Statistic> GetStatsForLastYearByDz()
|
||||||
{
|
{
|
||||||
var tmp = _statsForLastYearByDzService.GetStats();
|
var tmp = _statsForLastYearByDzService.GetStats();
|
||||||
@@ -152,6 +191,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics for the last year grouped by jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing last year jump type statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsForLastYearByJumpType()
|
public IEnumerable<Statistic> GetStatsForLastYearByJumpType()
|
||||||
{
|
{
|
||||||
var tmp = _statsForLastYearByJumpTypeService.GetStats();
|
var tmp = _statsForLastYearByJumpTypeService.GetStats();
|
||||||
@@ -162,6 +205,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics by year grouped with jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Statistic entities containing yearly jump type statistics.</returns>
|
||||||
public IEnumerable<Statistic> GetStatsByYearByJumpType()
|
public IEnumerable<Statistic> GetStatsByYearByJumpType()
|
||||||
{
|
{
|
||||||
var tmp = _statsByYearByJumpTypeService.GetStats();
|
var tmp = _statsByYearByJumpTypeService.GetStats();
|
||||||
@@ -191,4 +238,4 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
{
|
{
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public TunnelFlightService(IJumpTypeService jumpTypeService,
|
public TunnelFlightService(IJumpTypeService jumpTypeService,
|
||||||
ITunnelFlightRepository tunnelFlightRepository,
|
ITunnelFlightRepository tunnelFlightRepository,
|
||||||
IDropZoneService dropZoneService,
|
IDropZoneService dropZoneService,
|
||||||
IIdentityService identityService)
|
IIdentityService identityService)
|
||||||
@@ -26,26 +26,51 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves all tunnel flights.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of TunnelFlight entities containing all tunnel flights.</returns>
|
||||||
public IEnumerable<TunnelFlight> GetAllTunnelFlights()
|
public IEnumerable<TunnelFlight> GetAllTunnelFlights()
|
||||||
{
|
{
|
||||||
return _tunnelFlightRepository.GetAll(_identityService.ConnectedUser);
|
return _tunnelFlightRepository.GetAll(_identityService.ConnectedUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves a tunnel flight by its ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The tunnel flight ID to retrieve.</param>
|
||||||
|
/// <returns>A TunnelFlight entity containing the tunnel flight details.</returns>
|
||||||
public TunnelFlight GetTunnelFlightById(int id)
|
public TunnelFlight GetTunnelFlightById(int id)
|
||||||
{
|
{
|
||||||
return _tunnelFlightRepository.GetById(id);
|
return _tunnelFlightRepository.GetById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves the total count of tunnel flights.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The total number of tunnel flights.</returns>
|
||||||
public int GetTunnelFlightCount()
|
public int GetTunnelFlightCount()
|
||||||
{
|
{
|
||||||
return _tunnelFlightRepository.GetCount(_identityService.ConnectedUser);
|
return _tunnelFlightRepository.GetCount(_identityService.ConnectedUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves a range of tunnel flights with pagination.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="beginIndex">The starting index for pagination.</param>
|
||||||
|
/// <param name="endIndex">The ending index for pagination.</param>
|
||||||
|
/// <returns>A collection of TunnelFlight entities containing the requested range.</returns>
|
||||||
public IEnumerable<TunnelFlight> GetTunnelFlightsByIndexes(int beginIndex, int endIndex)
|
public IEnumerable<TunnelFlight> GetTunnelFlightsByIndexes(int beginIndex, int endIndex)
|
||||||
{
|
{
|
||||||
return _tunnelFlightRepository.GetBetweenIndex(_identityService.ConnectedUser, beginIndex, endIndex);
|
return _tunnelFlightRepository.GetBetweenIndex(_identityService.ConnectedUser, beginIndex, endIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves tunnel flights grouped by month within a date range.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="beginDate">The start date for grouping.</param>
|
||||||
|
/// <param name="endDate">The end date for grouping.</param>
|
||||||
|
/// <returns>A collection of Statistic entities grouped by month.</returns>
|
||||||
public IEnumerable<Statistic> GetTunnelFlightGroupByMonth(string beginDate, string endDate)
|
public IEnumerable<Statistic> GetTunnelFlightGroupByMonth(string beginDate, string endDate)
|
||||||
{
|
{
|
||||||
var convertedBeginDate = Convert.ToDateTime(beginDate);
|
var convertedBeginDate = Convert.ToDateTime(beginDate);
|
||||||
@@ -69,6 +94,12 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves tunnel flights filtered by date range.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="beginDate">The start date for filtering.</param>
|
||||||
|
/// <param name="endDate">The end date for filtering.</param>
|
||||||
|
/// <returns>A collection of TunnelFlight entities filtered by the specified date range.</returns>
|
||||||
public IEnumerable<TunnelFlight> GetTunnelFlightByDates(string beginDate, string endDate)
|
public IEnumerable<TunnelFlight> GetTunnelFlightByDates(string beginDate, string endDate)
|
||||||
{
|
{
|
||||||
var convertedBeginDate = Convert.ToDateTime(beginDate);
|
var convertedBeginDate = Convert.ToDateTime(beginDate);
|
||||||
@@ -76,7 +107,13 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
return _tunnelFlightRepository.GetBetweenDate(_identityService.ConnectedUser, convertedBeginDate, convertedEndDate);
|
return _tunnelFlightRepository.GetBetweenDate(_identityService.ConnectedUser, convertedBeginDate, convertedEndDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new tunnel flight to the system.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tunnelId">The tunnel ID to add the flight to.</param>
|
||||||
|
/// <param name="jumpTypeId">The jump type ID for the flight.</param>
|
||||||
|
/// <param name="newFlight">TunnelFlight entity containing the new flight data.</param>
|
||||||
public void AddNewFlight(int tunnelId, int jumpTypeId, TunnelFlight newFlight)
|
public void AddNewFlight(int tunnelId, int jumpTypeId, TunnelFlight newFlight)
|
||||||
{
|
{
|
||||||
var tmp = _dropZoneService.GetDzById(tunnelId);
|
var tmp = _dropZoneService.GetDzById(tunnelId);
|
||||||
@@ -93,17 +130,25 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
var selectedJumpType = _jumpTypeService.GetJumpTypeById(jumpTypeId);
|
var selectedJumpType = _jumpTypeService.GetJumpTypeById(jumpTypeId);
|
||||||
|
|
||||||
|
|
||||||
newFlight.Tunnel = selectedTunnel;
|
newFlight.Tunnel = selectedTunnel;
|
||||||
newFlight.JumpType = selectedJumpType;
|
newFlight.JumpType = selectedJumpType;
|
||||||
_tunnelFlightRepository.Add(newFlight);
|
_tunnelFlightRepository.Add(newFlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a tunnel flight by its ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The tunnel flight ID to delete.</param>
|
||||||
public void DeleteTunnelFlightById(int id)
|
public void DeleteTunnelFlightById(int id)
|
||||||
{
|
{
|
||||||
_tunnelFlightRepository.DeleteById(id);
|
_tunnelFlightRepository.DeleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing tunnel flight.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The tunnel flight ID to update.</param>
|
||||||
|
/// <param name="updatedTunnelFlight">TunnelFlight entity containing the updated tunnel flight data.</param>
|
||||||
public void UpdateTunnelFlight(int id, TunnelFlight updatedTunnelFlight)
|
public void UpdateTunnelFlight(int id, TunnelFlight updatedTunnelFlight)
|
||||||
{
|
{
|
||||||
var myTunnelFlight = GetTunnelFlightById(id);
|
var myTunnelFlight = GetTunnelFlightById(id);
|
||||||
@@ -125,4 +170,4 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,27 +21,49 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new image to the system.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newImage">The UserImage entity containing the new image data.</param>
|
||||||
public void AddNewImage(UserImage newImage)
|
public void AddNewImage(UserImage newImage)
|
||||||
{
|
{
|
||||||
newImage.User = _identityService.ConnectedUser;
|
newImage.User = _identityService.ConnectedUser;
|
||||||
_imageRepository.Add(newImage);
|
_imageRepository.Add(newImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes an image by its ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The image ID to delete.</param>
|
||||||
public void DeleteImageById(int id)
|
public void DeleteImageById(int id)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves all images.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of UserImage entities containing all images.</returns>
|
||||||
public IEnumerable<UserImage> GetAllImages()
|
public IEnumerable<UserImage> GetAllImages()
|
||||||
{
|
{
|
||||||
return _imageRepository.GetAll(_identityService.ConnectedUser);
|
return _imageRepository.GetAll(_identityService.ConnectedUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves an image by its ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The image ID to retrieve.</param>
|
||||||
|
/// <returns>A UserImage entity containing the image details.</returns>
|
||||||
public UserImage GetImageById(int id)
|
public UserImage GetImageById(int id)
|
||||||
{
|
{
|
||||||
return _imageRepository.GetById(id);
|
return _imageRepository.GetById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing image.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The image ID to update.</param>
|
||||||
|
/// <param name="Image">UserImage entity containing the updated image data.</param>
|
||||||
public void UpdateImage(int id, UserImage Image)
|
public void UpdateImage(int id, UserImage Image)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
@@ -56,4 +78,4 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user