public ActionResult ThongBaoDatHang() { var entity = _settingRepo.GetEntry(1); SettingThongBaoDatHangVM vm = new SettingThongBaoDatHangVM(); vm.InjectFrom(entity); return(View(vm)); }
public ActionResult ThongBaoDatHang(SettingThongBaoDatHangVM 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("ThongBaoDatHang")); } return(View(viewmodel)); }