Files
BeWoPlaner/Service/Plugins/HomeContentGenerator.cs

66 lines
2.4 KiB
C#
Raw Permalink Normal View History

2016-06-27 01:45:38 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
2016-06-27 01:45:38 +02:00
using BeWo.Service.DCEntityMapper;
using BS.Shared.Core;
2017-06-07 15:23:30 +02:00
using BS.Shared.DataContracts;
2016-06-27 01:45:38 +02:00
using BS.Shared.DataContracts.Compact;
namespace BeWo.Service.Plugins
{
2017-09-14 19:03:26 +02:00
public class HomeContentGenerator : AbstractIDSpecificDefaultClass<HomeContentGenerator>
{
public virtual IList<HomeViewPanelDC> GetHomeViewPanels()
{
return MapperFactory.HomeViewPanelDC_HomeViewPanel.MapToNewDCs(
DAOFactory.GenericDAO.GetAllActive<HomeViewPanel>());
}
2017-09-14 19:03:26 +02:00
public virtual List<CompactPersonDC> GetPersonsHavingBirthday(DateTime birthdayUntil)
{
return MapperFactory.CompactPersonDC_Person.MapToNewDCs(
DAOFactory.SearchDAO.FindPersonsHavingBirthday(birthdayUntil));
}
2016-06-27 01:45:38 +02:00
2017-09-14 19:03:26 +02:00
public virtual List<CompactSupportConceptDC> GetExpiringSupportConcepts(long? employeeOid,
DateTime expiredUntil)
{
var result = new List<CompactSupportConceptDC>();
var list = DAOFactory.SearchDAO.FindExpiringSupportConcepts(employeeOid, DateTime.Now.Date, expiredUntil);
var cs = new CustomerService();
foreach (var sc in list)
{
foreach (var c2s in sc.CostBearer2SupportConceptList)
{
var fsc = cs.CreateFlatSupportConcept(sc, c2s);
if (fsc.EndDate.HasValue && fsc.EndDate.Value >= DateTime.Now.Date && fsc.EndDate.Value <= expiredUntil)
{
result.Add(fsc);
}
}
}
return result.OrderBy(s => s.EndDate).ToList();
2017-02-01 13:53:59 +01:00
}
2017-06-07 15:23:30 +02:00
2017-09-14 19:03:26 +02:00
public virtual List<TaskDC> GetTasksForEmployee(long employeeOid)
{
2017-06-07 15:23:30 +02:00
return MapperFactory.TaskDC_Task.MapToNewDCs(DAOFactory.SearchDAO.FindTasksForEmployee(employeeOid));
}
2017-09-14 19:03:26 +02:00
public virtual List<CompactSupportConceptDC> GetSupportConceptsWithConferenceDate(long? employeeOid,
DateTime conferenceDateUntil)
{
return MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDCs(
DAOFactory.SearchDAO.FindSupportConceptsWithConferenceDate(employeeOid, conferenceDateUntil));
}
2017-09-14 19:03:26 +02:00
}
2016-06-27 01:45:38 +02:00
}