public ActionResult StatisticsJobsAndCV() { var entity = _settingRepo.GetEntry(1); SettingStatisticsJobsAndCVVM vm = new SettingStatisticsJobsAndCVVM(); vm.InjectFrom(entity); return(View(vm)); }
public ActionResult StatisticsJobsAndCV(SettingStatisticsJobsAndCVVM viewmodel) { if (ModelState.IsValid) { var entity = _settingRepo.GetEntry(1); entity.InjectFrom(viewmodel); _settingRepo.Update(entity); _settingRepo.Save(); CacheServ.ClearAll(); TempData["message"] = "Update setting successfully!"; return(RedirectToAction("StatisticsJobsAndCV")); } return(View(viewmodel)); }