Änderungen am Vertretungsmodul

This commit is contained in:
Lyndon
2019-09-27 15:55:01 +02:00
parent 1e5579a338
commit 101b563bd5
66 changed files with 2487 additions and 1380 deletions

View File

@@ -109,6 +109,12 @@ namespace BeWoPlanerMobil.Controllers
}
var myRelatedCustomers = Model.Employee == null ? new List<CustomerEmployeeRelationDC>() : Model.Employee.RelatedCustomers;
var relatedCustomerOids = myRelatedCustomers.Select(employee2customer => employee2customer.Customer.CustomerOid).ToList();
if(Model.Employee?.EmployeeOid != null)
{
relatedCustomerOids.AddRangeIfElementsNotIn(EmployeeService.LoadTeamsRelatedCustomerOids(Model.Employee.EmployeeOid.Value));
}
if (MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees))
{
@@ -129,14 +135,14 @@ namespace BeWoPlanerMobil.Controllers
}
else
{
Model.SupportConcepts = CustomerService.GetAllActiveSupportConceptsByCustomers(myRelatedCustomers.Select(c => c.Customer.CustomerOid));
Model.SupportConcepts = CustomerService.GetAllActiveSupportConceptsByCustomers(relatedCustomerOids);
}
if(!Model.ShowExpiredSupportConcepts)
{
Model.SupportConcepts = Model.SupportConcepts.Where(w =>
Model.SupportConcepts = Model.SupportConcepts.Where(supportConcept =>
{
var endDate = MainModel.GetEndDateOfSupportConcept(w);
var endDate = MainModel.GetEndDateOfSupportConcept(supportConcept);
return endDate == null || endDate.Value >= DateTime.Now;
}).ToList();