Files
BeWoPlaner/Service/Plugins/EmployeeService.cs
2018-10-08 12:09:48 +02:00

41 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.MessageContracts;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
using Utils = BS.Shared.Core.Utils;
namespace BeWo.Service.Plugins
{
public class EmployeeService : AbstractIDSpecificDefaultClass<EmployeeService>
{
public virtual long InsertNewEmployee(EmployeeDC pEmployeeDC)
{
Employee lEmployee = MapperFactory.EmployeeDC_Employee.MapToNewEntity(pEmployeeDC);
DAOFactory.GenericDAO.Insert(lEmployee);
return lEmployee.Oid.Value;
}
public virtual List<CompactEmployeeDC> GetAllActiveEmployeesCompact()
{
return MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<Employee>());
}
public virtual List<CompactEmployeeDC> GetAllActiveAndArchivedEmployeesCompact()
{
return MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(DAOFactory.GenericDAO.GetAllActiveAndArchived<Employee>());
}
}
}