DerKarren/Service/UserService.cs - Alle MA sehen auch für UserGroup Teamleitung
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
<Compile Include="ServicesOverviewReport.Designer.cs">
|
||||
<DependentUpon>ServicesOverviewReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Service\UserService.cs" />
|
||||
<Compile Include="Teamstundenkonto.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -8,7 +8,7 @@ using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
|
||||
namespace SozialeDiensteNiederrhein
|
||||
namespace BeWo.DerKarren
|
||||
{
|
||||
class KarrenHomeContentGenerator : HomeContentGenerator
|
||||
{
|
||||
@@ -94,8 +94,6 @@ namespace SozialeDiensteNiederrhein
|
||||
liste.Add(sc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDCs(liste);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
65
ReportImp/DerKarren/Service/UserService.cs
Normal file
65
ReportImp/DerKarren/Service/UserService.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
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 BeWo.Service.Plugins;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
using BS.Shared.Services;
|
||||
using Utils = BS.Shared.Core.Utils;
|
||||
|
||||
namespace BeWo.DerKarren.Service
|
||||
{
|
||||
public class CustomUserService : UserService
|
||||
{
|
||||
public override UserDC LoadUserByLoginName(string pUserName, string password)
|
||||
{
|
||||
var user = base.LoadUserByLoginName(pUserName, password);
|
||||
|
||||
bool isTeamleiter = false;
|
||||
foreach (var group in user.UserGroups)
|
||||
{
|
||||
if (group.Name.Contains("Teamleitung"))
|
||||
{
|
||||
isTeamleiter = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isTeamleiter)
|
||||
{
|
||||
var emp = user.Employee;
|
||||
|
||||
var teams = DAOFactory.SearchDAO.FindAllActiveTeamsOfEmployee(emp.EmployeeOid);
|
||||
emp.TeamOids = new List<long>();
|
||||
foreach (var t in teams)
|
||||
{
|
||||
emp.TeamOids.Add(t.Oid.Value);
|
||||
|
||||
foreach (var member in t.MemberList)
|
||||
{
|
||||
emp.AllTeamMemberOids.Add(member.Oid.Value);
|
||||
}
|
||||
}
|
||||
foreach (var toid in user.Employee.TeamOids)
|
||||
{
|
||||
if (user.Employee.LeadingTeamOids == null)
|
||||
{
|
||||
user.Employee.LeadingTeamOids = new List<long>();
|
||||
}
|
||||
if (!user.Employee.LeadingTeamOids.Contains(toid))
|
||||
{
|
||||
user.Employee.LeadingTeamOids.Add(toid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user