Пример #1
0
        public ContentItem StoreEntry(ContactFormEntry entry)
        {
            foreach (var filter in _filters)
            {
                filter.Process(entry);
            }

            var contentItem = NewEntry(entry);
            var test        = contentItem.Id;

            var entryCreatingContext = new ContactFormCreatingContext
            {
                ContactFormEntry = contentItem
            };

            _contactFormEventHandler.ContactFormEntryCreating(entryCreatingContext);

            if (entryCreatingContext.Cancel)
            {
                return(null);
            }

            _services.ContentManager.Create(contentItem);

            var entryCreatedContext = new ContactFormCreatedContext
            {
                ContactFormEntry = contentItem
            };

            _contactFormEventHandler.ContactFormEntryCreated(entryCreatedContext);

            _services.Notifier.Information(T("Uw bericht is ontvangen. Dank u voor de reactie!"));
            return(contentItem);
        }
Пример #2
0
        public ContentItem StoreEntry(ContactFormEntry entry)
        {
            foreach (var filter in _filters)
            {
                filter.Process(entry);
            }

            var contentItem = NewEntry(entry);

            var entryCreatingContext = new ContactFormCreatingContext {
                ContactFormEntry = contentItem
            };

            _contactFormEventHandler.ContactFormEntryCreating(entryCreatingContext);

            if (entryCreatingContext.Cancel)
            {
                return(null);
            }

            _services.ContentManager.Create(contentItem);

            var entryCreatedContext = new ContactFormCreatedContext {
                ContactFormEntry = contentItem
            };

            _contactFormEventHandler.ContactFormEntryCreated(entryCreatedContext);

            _services.Notifier.Information(T("Your message has been received. Thanks for contacting us!"));
            return(contentItem);
        }