38 lines
1.2 KiB
C#
38 lines
1.2 KiB
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()
|
|
{
|
|
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))
|
|
{
|
|
return MapperFactory.CompactTeamDC_Team.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<Team>());
|
|
}
|
|
|
|
var teams = DAOFactory.SearchDAO.FindAllActiveTeamsOfEmployee(user.Employee.Oid.Value);
|
|
return MapperFactory.CompactTeamDC_Team.MapToNewDCs(teams);
|
|
|
|
}
|
|
}
|
|
} |