Files
BeWoPlaner/ReportImp/AlphaEv/Service/CustomEmployeeService.cs

38 lines
1.2 KiB
C#
Raw Permalink Normal View History

2019-10-10 21:43:25 +02:00
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()
{
ApplicationUser user = null;
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
{
user = LoggedInUserOperationContextExt.Current.User;
}
else
{
user = SessionFacade.LoggedInUser;
}
if (Utils.UserHasRight(user, UserRightType.TeamView_ViewAll))
2019-10-10 21:43:25 +02:00
{
return MapperFactory.CompactTeamDC_Team.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<Team>());
}
var teams = DAOFactory.SearchDAO.FindAllActiveTeamsOfEmployee(user.Employee.Oid.Value);
2019-10-10 21:43:25 +02:00
return MapperFactory.CompactTeamDC_Team.MapToNewDCs(teams);
}
}
}