using System.Collections.Generic; using BeWoPlanerMobil.Models; using BS.Shared.DataContracts; namespace BeWoPlanerMobil.Util { public class GroupBookingSelectionObject { public List SelectedRelations { get; set; } = new List(); public IEnumerable GroupOids { get; set; } public GroupBookingSelectionObject(IEnumerable selectedConceptCostBearerRelations, IEnumerable groupOids) { GroupOids = groupOids ?? new List(); 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); SelectedRelations.Add(listItem); } } } }