Events on desktop
This commit is contained in:
42
StudentHouseDashboard/Logic/EventManager.cs
Normal file
42
StudentHouseDashboard/Logic/EventManager.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Logic
|
||||
{
|
||||
public class EventManager
|
||||
{
|
||||
private IEventRepository eventRepository;
|
||||
public EventManager(IEventRepository eventRepository)
|
||||
{
|
||||
this.eventRepository = eventRepository;
|
||||
}
|
||||
public List<Event> GetAllEvents()
|
||||
{
|
||||
return eventRepository.GetAllEvents();
|
||||
}
|
||||
public List<Event> GetAllCurrentEvents()
|
||||
{
|
||||
return eventRepository.GetAllCurrentEvents();
|
||||
}
|
||||
public Event GetEventById(int id)
|
||||
{
|
||||
return eventRepository.GetEventById(id);
|
||||
}
|
||||
public Event CreateEvent(string title, string description, User author, DateTime publishDate, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
return eventRepository.CreateEvent(title, description, author, publishDate, startDate, endDate);
|
||||
}
|
||||
public void UpdateEvent(int id, string title, string description, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
eventRepository.UpdateEvent(id, title, description, startDate, endDate);
|
||||
}
|
||||
public void DeleteEvent(int id)
|
||||
{
|
||||
eventRepository.DeleteEvent(id);
|
||||
}
|
||||
}
|
||||
}
|
20
StudentHouseDashboard/Logic/IEventRepository.cs
Normal file
20
StudentHouseDashboard/Logic/IEventRepository.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Logic
|
||||
{
|
||||
public interface IEventRepository
|
||||
{
|
||||
public List<Event> GetAllEvents();
|
||||
public List<Event> GetAllCurrentEvents();
|
||||
public Event GetEventById(int id);
|
||||
public Event CreateEvent(string title, string description, User author, DateTime publishDate, DateTime startDate, DateTime endDate);
|
||||
public void UpdateEvent(int id, string title, string description, DateTime startDate, DateTime endDate);
|
||||
public void DeleteEvent(int id);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user