public void Add(ScheduledNotificationDto notificationDto) { var userProfile = _userProfileRepository.Get(p => p.UserLogin == notificationDto.UserLogin); if (userProfile == null) return; var notification = notificationDto.ToScheduledNotification(); notification.UserProfileId = userProfile.Id; _scheduledNotificationRepository.UpdateAndCommit(notification); }
public static ScheduledNotificationDto ToScheduledNotificationDto(this ScheduledNotification notification) { var s = new ScheduledNotificationDto { Id = notification.Id, CandidateId = notification.CandidateId, CandidateName = string.Format("{0} {1}", notification.Candidate.FirstName, notification.Candidate.LastName), Message = notification.Message, NotificationDate = notification.NotificationDate, NotificationType = (int)notification.NotificationType, UserProfileId = notification.UserProfileId, IsSent = notification.IsSent, IsShown = notification.IsShown, UserLogin = notification.UserProfile != null ? notification.UserProfile.Alias : string.Empty }; return s; }
public void Update(ScheduledNotificationDto notificationDto) { var notification = _scheduledNotificationRepository.Get(notificationDto.Id); if (notification != null) { notificationDto.ToScheduledNotification(notification); _scheduledNotificationRepository.UpdateAndCommit(notification); } }