Files
BeWoPlaner/ReportImp/AlphaEv/Service/CustomEmployeeService.cs
2019-10-10 21:43:25 +02:00

28 lines
942 B
C#

using System.Collections.Generic;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.DataContracts.Compact;
using DevExpress.Data.Browsing;
namespace AlphaEv.Service
{
public class CustomEmployeeService : EmployeeService
{
public override List<CompactTeamDC> GetAllTeamsCompact()
{
if (Utils.UserHasRight(LoggedInUserOperationContextExt.Current.User, UserRightType.TeamView_ViewAll))
{
return MapperFactory.CompactTeamDC_Team.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<Team>());
}
var teams = DAOFactory.SearchDAO.FindAllActiveTeamsOfEmployee(LoggedInUserOperationContextExt.Current.User.Employee.Oid.Value);
return MapperFactory.CompactTeamDC_Team.MapToNewDCs(teams);
}
}
}