Das Mehrfachbuchungsformular hat ebenfalls die Schnittmenge der Leistungen und Kategorien von den ausgewählten Hilfeplänen. Das Caching ist wieder aktiviert. Und lädt pro Post-Aufruf nur noch einmal 13 MB und danach nur noch 300 kb herunter. Überall konsequent geprüft, ob das Model nicht null ist und falls dem so ist, wird ausgeloggt, damit es zu keinen Fehlern mehr kommt.
36 lines
1.5 KiB
C#
36 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using BeWoPlanerMobil.Models;
|
|
using BS.Shared.DataContracts;
|
|
|
|
namespace BeWoPlanerMobil.Util
|
|
{
|
|
public class GroupBookingSelectionObject
|
|
{
|
|
public List<CustomSelectListItem> SelectedRelations { get; set; } = new List<CustomSelectListItem>();
|
|
public IEnumerable<long> GroupOids { get; set; }
|
|
|
|
|
|
public GroupBookingSelectionObject(IEnumerable<SupportConceptCostBearerRelDC> selectedConceptCostBearerRelations, IEnumerable<long> groupOids)
|
|
{
|
|
GroupOids = groupOids ?? new List<long>();
|
|
|
|
foreach(var rel in selectedConceptCostBearerRelations)
|
|
{
|
|
|
|
var text1 = $"{rel.SupportConcept.Customer.LastNameFirstName}";
|
|
var text2 = $"{rel.StartDate?.ToShortDateString() ?? string.Empty} - {rel.EndDate?.ToShortDateString()} {rel.CostBearer.Name}";
|
|
var value = rel.CostBearer2SupportConceptOid.ToString();
|
|
|
|
var textColor = rel.SupportConcept.IsAboutToExpire ?
|
|
"text-bewo-is-about-to-expire" :
|
|
rel.SupportConcept.ExpiresIn3MonthOrLess ?
|
|
"text-bewo-expires-in-three-months" :
|
|
"text-dark";
|
|
|
|
var listItem = new CustomSelectListItem(text1, text2, value, textColor, rel.SupportConcept?.SupportConceptOid, rel.CostBearer2SupportConceptOid);
|
|
|
|
SelectedRelations.Add(listItem);
|
|
}
|
|
}
|
|
}
|
|
} |