Konflikte gelöst
This commit is contained in:
@@ -12,6 +12,7 @@ using BeWo.Service.Plugins;
|
||||
using BeWo.Service.SBD;
|
||||
using BeWo.Service.Security;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Service.Urlaubsplanung;
|
||||
using BeWo.View.Navigation.Filter;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
@@ -1936,6 +1937,19 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
public UrlaubsplanerRootDC BuildUrlaubsplanerRootObject(AbsenceOverviewFilterDC filter)
|
||||
{
|
||||
try
|
||||
{
|
||||
UrlaubsplanungsManager manager = new UrlaubsplanungsManager();
|
||||
return manager.BuildUrlaubsplanerRootObject(filter);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal CalculateUrlaubstage(DateTime entryDate, DateTime? endDate, int anzahlArbeitstage, int restlicheTageImJahr, decimal? urlaubstageProJahr) // Enddatum in die Parameterliste
|
||||
{
|
||||
try
|
||||
@@ -2122,11 +2136,8 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
try
|
||||
{
|
||||
List<AbwesenheitsInformationPrint> entities = MapperFactory.AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint.MapToNewEntities(dcs);
|
||||
foreach (var e in entities)
|
||||
{
|
||||
DAOFactory.GenericDAO.Delete(e);
|
||||
}
|
||||
UrlaubsplanungsManager manager = new UrlaubsplanungsManager();
|
||||
manager.DeleteAbwesenheitsInformationPrints(dcs);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -2157,6 +2168,103 @@ namespace BeWo.Service.ServiceImplementations
|
||||
throw Utils.CreateBeWoFaultException(ex);
|
||||
}
|
||||
}
|
||||
public decimal CountKrankheitstage(AbwesenheitsInformationDC infoDC)
|
||||
{
|
||||
try
|
||||
{
|
||||
var manager = new UrlaubsplanungsManager();
|
||||
return manager.CountKrankheitstage(infoDC);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(ex);
|
||||
}
|
||||
}
|
||||
public decimal CountUrlaubstage(AbwesenheitsInformationDC infoDC)
|
||||
{
|
||||
try
|
||||
{
|
||||
var manager = new UrlaubsplanungsManager();
|
||||
return manager.CountUrlaubstage(infoDC);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public List<EmployeeDC> GetAbsenceOverview(AbsenceOverviewFilterDC filter)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = new List<EmployeeDC>();
|
||||
var vs = PluginLoader.FindClass<VacationService>();
|
||||
|
||||
var allEmployees = DAOFactory.GenericDAO.GetAllActive<Employee>().ToList();
|
||||
|
||||
List<Team> teams = new List<Team>();
|
||||
if (filter.Teams != null)
|
||||
teams = DAOFactory.GenericDAO.GetActiveByIDs<Team>(filter.Teams) as List<Team>;
|
||||
|
||||
|
||||
//foreach (var emp in allEmployees.OrderBy(x => x.Person.LastNameFirstName))
|
||||
List<Employee> benoetigteMitarbeiter = new List<Employee>();
|
||||
if (teams.Count == 0)
|
||||
benoetigteMitarbeiter = allEmployees;
|
||||
else
|
||||
{
|
||||
foreach (var team in teams)
|
||||
{
|
||||
benoetigteMitarbeiter.AddRange(team.MemberList);
|
||||
}
|
||||
}
|
||||
benoetigteMitarbeiter.OrderBy(x => x.Person.LastNameFirstName).ToList();
|
||||
|
||||
foreach (var emp in benoetigteMitarbeiter)
|
||||
{
|
||||
if (filter.EmploymentType != null)
|
||||
if (!emp.Contracts.Any(x => x.EmploymentType != null && filter.EmploymentType.Contains(x.EmploymentType.Oid.Value)))
|
||||
continue;
|
||||
|
||||
|
||||
var dict = vs.BerechneUrlaubskonto(emp, filter.Year);
|
||||
|
||||
if (filter.AbsenceReasons != null)
|
||||
emp.AbsenceTimes.RemoveRange(x => !filter.AbsenceReasons.Contains(x.AbsenceReason.Oid.Value));
|
||||
|
||||
//if (filter.Teams != null)
|
||||
//{
|
||||
// bool isInTeam = false;
|
||||
// foreach (var team in teams)
|
||||
// {
|
||||
// if (team.MemberList.Contains(emp))
|
||||
// isInTeam = true;
|
||||
// }
|
||||
// if (!isInTeam)
|
||||
// continue;
|
||||
//}
|
||||
|
||||
var empDC = MapperFactory.EmployeeDC_Employee.MapToNewDC(emp);
|
||||
if (dict.ContainsKey(filter.Year))
|
||||
{
|
||||
empDC.Urlaubskonto = dict[filter.Year];
|
||||
}
|
||||
else
|
||||
{
|
||||
int test = 0;
|
||||
}
|
||||
|
||||
res.Add(empDC);
|
||||
}
|
||||
|
||||
return res.OrderBy(e => e.LastNameFirstName).ToList();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void MakeNewContractHistoryEntry(Employee employee, StatementType statementType)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user