Ejemplo n.º 1
0
        public ActionResult Form(ContactFormEntryViewModel model)
        {
            if (string.IsNullOrWhiteSpace(model.Subject))
                model.Subject = T("Contact verzoek").Text;

            model.CreatedUtc = DateTime.UtcNow;
            if (!ModelState.IsValid)
                return View(model);

            var dm = _cFS.StoreEntry(_cFS.Convert(model));
            if (dm == null)
            {
                _notifier.Add(NotifyType.Warning, T("Er is iets mis gegenaamn tijdens de verwerking van uw bericht."));
                return RedirectToAction("Failed");
            }

            return RedirectToAction("Confirmation");
        }
Ejemplo n.º 2
0
        public ContactFormEntry Convert(ContactFormEntryViewModel model)
        {
            if (model == null)
                return new ContactFormEntry();

            return new ContactFormEntry()
            {
                Subject = model.Subject,
                Name = model.Name,
                MessageBody = model.MessageBody,
                CreatedUtc = model.CreatedUtc,
                Email = model.Email
            };
        }