28 lines
942 B
C#
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);
|
|
|
|
}
|
|
}
|
|
} |