public ActionResult Smtp()
        {
            var           entity = _settingRepo.GetEntry(1);
            SettingSmtpVM vm     = new SettingSmtpVM();

            vm.InjectFrom(entity);
            return(View(vm));
        }
 public ActionResult Smtp(SettingSmtpVM 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("Smtp"));
     }
     return(View(viewmodel));
 }