public ActionResult Edit(ContactPageViewModel model) { if (!ModelState.IsValid) return View(model); _contactInfoService.EditInfo(_contactInfoService.Convert(model)); return View(model); }
public ActionResult Edit(ContactPageViewModel model) { if (!ModelState.IsValid) return View(model); var dm = _cIS.EditInfo(_cIS.Convert(model)); _notifier.Add(NotifyType.Information, T(dm == null ? "Contact info saving failed" : "Opslaan gelukt.")); return RedirectToAction("Index"); }
public ContactPageViewModel Convert(ContactPage model) { if (model == null) return null; ContactPageViewModel vm = new ContactPageViewModel() { AddressLine = model.AddressLine, AddressName = model.AddressName, City = model.City, Email = model.Email, ExtraText = model.ExtraText, Link1Name = model.Link1Name, Link1Url = model.Link1Url, Link2Name = model.Link2Name, Link2Url = model.Link2Url, MainText = model.MainText, Phone = model.Phone, PostalCode = model.PostalCode }; return vm; }