コード例 #1
0
        public ActionResult StatisticsJobsAndCV()
        {
            var entity = _settingRepo.GetEntry(1);
            SettingStatisticsJobsAndCVVM vm = new SettingStatisticsJobsAndCVVM();

            vm.InjectFrom(entity);
            return(View(vm));
        }
コード例 #2
0
 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));
 }