public static NotificationTrackingViewModel Create(IRepository repository, string siteId, NotificationTracking notificationTracking = null, Person person = null, MailingList mailingList = null) { Check.Require(repository != null, "Repository is required."); var seminar = SiteService.GetLatestSeminar(siteId); var viewModel = new NotificationTrackingViewModel() { NotificationTracking = notificationTracking ?? new NotificationTracking(), NotificationMethods = repository.OfType <NotificationMethod>().GetAll(), NotificationTypes = repository.OfType <NotificationType>().GetAll(), People = new List <Person>(), AllPeople = SiteService.GetLatestSeminar(siteId).SeminarPeople.Select(a => a.Person).ToList(), //seminarService.GetCurrent().SeminarPeople.Select(a=>a.Person).ToList(), SitePeople = SiteService.LoadSite(siteId).People, Seminar = seminar, MailingLists = seminar.MailingLists, MailingList = mailingList }; if (person != null) { viewModel.People.Add(person); } return(viewModel); }
public static SendNotificationViewModel Create(IRepository repository, NotificationTrackingViewModel notificationTrackingViewModel, EmailQueue emailQueue = null, string email = null) { Check.Require(repository != null, "Repository is required."); Check.Require(notificationTrackingViewModel != null, "notificationTrackingViewModel is required."); var viewModel = new SendNotificationViewModel() { NotificationTrackingViewModel = notificationTrackingViewModel, EmailQueue = emailQueue ?? new EmailQueue() { FromAddress = email } }; return(viewModel); }
public static NotificationTrackingViewModel Create(IRepository repository, string siteId, NotificationTracking notificationTracking = null, Person person = null, MailingList mailingList = null) { Check.Require(repository != null, "Repository is required."); var seminar = SiteService.GetLatestSeminar(siteId); var viewModel = new NotificationTrackingViewModel(){ NotificationTracking = notificationTracking ?? new NotificationTracking(), NotificationMethods = repository.OfType<NotificationMethod>().GetAll(), NotificationTypes = repository.OfType<NotificationType>().GetAll(), People = new List<Person>(), AllPeople = SiteService.GetLatestSeminar(siteId).SeminarPeople.Select(a => a.Person).ToList(),//seminarService.GetCurrent().SeminarPeople.Select(a=>a.Person).ToList(), SitePeople = SiteService.LoadSite(siteId).People, Seminar = seminar, MailingLists = seminar.MailingLists, MailingList = mailingList }; if (person != null) viewModel.People.Add(person); return viewModel; }
public static SendNotificationViewModel Create(IRepository repository, NotificationTrackingViewModel notificationTrackingViewModel, EmailQueue emailQueue = null, string email = null) { Check.Require(repository != null, "Repository is required."); Check.Require(notificationTrackingViewModel != null, "notificationTrackingViewModel is required."); var viewModel = new SendNotificationViewModel() { NotificationTrackingViewModel = notificationTrackingViewModel, EmailQueue = emailQueue ?? new EmailQueue() { FromAddress = email} }; return viewModel; }