65 lines
1.6 KiB
C#
65 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
using skydiveLogs_api.DomainBusiness.Interfaces;
|
|
using skydiveLogs_api.DomainService.Repositories;
|
|
using skydiveLogs_api.Domain;
|
|
|
|
|
|
namespace skydiveLogs_api.DomainBusiness
|
|
{
|
|
public class GearService : IGearService
|
|
{
|
|
public GearService(IGearRepository gearRepository)
|
|
{
|
|
_gearRepository = gearRepository;
|
|
}
|
|
|
|
public void AddNewGear(Gear newGear,
|
|
User connectedUser)
|
|
{
|
|
newGear.User = connectedUser;
|
|
_gearRepository.Add(newGear);
|
|
}
|
|
|
|
public void AddRentalGear(User connectedUser)
|
|
{
|
|
var rentalGear = new Gear
|
|
{
|
|
Name = "Rental gear",
|
|
Manufacturer = "?",
|
|
MainCanopy = "?",
|
|
Aad = "Cypress/Vigil",
|
|
MaxSize = 280,
|
|
MinSize = 190,
|
|
ReserveCanopy = "?",
|
|
User = connectedUser
|
|
};
|
|
|
|
_gearRepository.Add(rentalGear);
|
|
}
|
|
|
|
public void DeleteGearById(int id)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Gear GetGearById(int id)
|
|
{
|
|
return _gearRepository.GetById(id);
|
|
}
|
|
|
|
public IEnumerable<Gear> GetAllGears(User connectedUser)
|
|
{
|
|
return _gearRepository.GetAll(connectedUser);
|
|
}
|
|
|
|
public void UpdateGear(int id, Gear Gear)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
private readonly IGearRepository _gearRepository;
|
|
}
|
|
}
|