Files
BeWoPlaner/BeWoPlanerMobil/Views/DevExpressScheduler/OpenEmployee2AppointmentListPartial.cshtml
2026-06-29 13:45:41 +02:00

64 lines
2.0 KiB
Plaintext

@using BS.Shared
@using BS.Shared.DataContracts
@model BeWoPlanerMobil.Models.DevExpressSchedulerModel
@functions
{
string GetInfoString(Employee2SchedulerAppointmentDC employee2AppointmentRel, SchedulerAppointmentDC appointment)
{
var timeAndDateInfo = $"{appointment.StartDate:dd.MM.yyyy}:";
if(employee2AppointmentRel.Employee.Equals(Model.LoggedInCompactEmployee))
{
return $"{timeAndDateInfo} {appointment.Subject}";
}
var employeeName = employee2AppointmentRel.Employee.DetailDescription;
var participationAnswer = employee2AppointmentRel.ParticipationAnswer;
var answer = string.Empty;
switch(participationAnswer)
{
case ParticipationAnswer.Zusage:
answer = "zugesagt";
break;
case ParticipationAnswer.Vorbehalt:
answer = "mit Vorbehalt zugesagt";
break;
case ParticipationAnswer.Absage:
answer = "abgesagt";
break;
}
return $"{timeAndDateInfo} {employeeName} hat {answer}";
}
}
@if(Model.OpenEmployee2AppointmentRels != null)
{
foreach(var employee2AppointmentRel in Model.OpenEmployee2AppointmentRels)
{
var appointment = Model.GetAppointment2AnswerByOid(employee2AppointmentRel.SchedulerAppointmentOid.Value);
if(appointment is null)
{
continue;
}
var active = string.Empty;
if(Model.AppointmentToAnswerOrUpdate?.SchedulerAppointmentOid != null && employee2AppointmentRel.SchedulerAppointmentOid.HasValue)
{
if(Model.AppointmentToAnswerOrUpdate.SchedulerAppointmentOid.Value == employee2AppointmentRel.SchedulerAppointmentOid.Value)
{
active = "active";
}
}
<a href="#" class="list-group-item list-group-item-action open-apt-list-group-item @active" id="open-apt-@employee2AppointmentRel.Employee2SchedulerAppointmentOid" onclick="selectAppointmentToAnswer(@employee2AppointmentRel.Employee2SchedulerAppointmentOid)">
@GetInfoString(employee2AppointmentRel, appointment)
</a>
}
}