public ActionResult Edit(SettingViewModel viewModel) { string errorMessage = _settingsService.EditSetting(viewModel); if (string.IsNullOrEmpty(errorMessage)) return RedirectToActionPermanent("Index"); ViewBag.ErrorMessage = errorMessage; return View(viewModel); }
public string EditSetting(SettingViewModel setting) { Setting entity = _settingMappingService.ToEntity(setting); string errorMessage = _settingRepository.Edit(entity); return errorMessage; }
public Setting ToEntity(SettingViewModel viewModel) { return Mapper.Map<SettingViewModel, Setting>(viewModel); }
public ActionResult Create() { var list = new SettingViewModel(); return View(list); }