コード例 #1
0
 private bool WasAlreadyNotified(RegistrationWithParticipant registrationParticipant)
 {
     return(_notificationService.HasNotified(
                registrationParticipant.Registration.Applicant.PhoneNumber,
                Constants.NotificationIds.ACCOMPLISH_DEMAND_FOR_REGISTRATION,
                NotificationSubject(registrationParticipant)
                ));
 }
コード例 #2
0
ファイル: DemandingCriterias.cs プロジェクト: benwasd/ssah
 public static DemandingCriterias CreateFromRegistration(RegistrationWithParticipant registrationWithParticipant)
 {
     return(new DemandingCriterias
     {
         CourseType = registrationWithParticipant.RegistrationParticipant.CourseType,
         Discipline = registrationWithParticipant.RegistrationParticipant.Discipline,
         NiveauId = registrationWithParticipant.RegistrationParticipant.NiveauId,
         From = registrationWithParticipant.Registration.AvailableFrom.Date,
         To = registrationWithParticipant.Registration.AvailableTo.Date,
         IsCourse = false
     });
 }
コード例 #3
0
 private IEnumerable <GroupCourseDemand> GetDemand(RegistrationWithParticipant participantAffectedFromChange)
 {
     if (participantAffectedFromChange.RegistrationParticipant.CourseType == CourseType.Group)
     {
         return(_demandService.GetGroupCourseDemand(
                    participantAffectedFromChange.RegistrationParticipant.Discipline,
                    participantAffectedFromChange.RegistrationParticipant.NiveauId,
                    participantAffectedFromChange.Registration.AvailableFrom,
                    participantAffectedFromChange.Registration.AvailableTo
                    ));
     }
     else
     {
         return(Enumerable.Empty <GroupCourseDemand>());
     }
 }
コード例 #4
0
            private async Task NotifyAsync(RegistrationWithParticipant registrationParticipant)
            {
                using (var unitOfWork = _notificationUnitOfWork.Begin())
                {
                    string[] messageLines =
                    {
                        $"Hallo {registrationParticipant.Registration.Applicant.Givenname}",
                        $"Für {registrationParticipant.RegistrationParticipant.Name} wurde eine passende Kursdurchführung gefunden. Schauen Sie bei Gelegenheit vorbei:",
                        string.Format(_environmentOptions.Current().RegistrationFrontendUrl, registrationParticipant.Registration.Id)
                    };

                    await unitOfWork.Dependent.SendNotification(
                        registrationParticipant.Registration.Applicant.PhoneNumber,
                        Constants.NotificationIds.ACCOMPLISH_DEMAND_FOR_REGISTRATION,
                        new [] { NotificationSubject(registrationParticipant) },
                        string.Join(Environment.NewLine, messageLines)
                        );

                    unitOfWork.Commit();
                }
            }
コード例 #5
0
 private static string NotificationSubject(RegistrationWithParticipant registrationParticipant)
 {
     return($"reg={registrationParticipant.Registration.Id} par={registrationParticipant.RegistrationParticipant.Id}");
 }
コード例 #6
0
 private static bool HadNoDemandWhenCreatedOrModified(RegistrationWithParticipant participantAffectedFromChange)
 {
     return(participantAffectedFromChange.RegistrationParticipant.HasDemandWhenLastCreatedOrModified == false);
 }