public ActionResult Edit(int id, EditVanBanViewModel model) { var data = VanBanRepository.Single(id); data.LinhVucVanBanId = model.LinhVucVanBanId; data.CoQuanBanHanhId = model.CoQuanBanhHanhVanBanId; data.LoaiVanBanId = model.LoaiVanBanId; data.NgayBanHanh = model.NgayBanHanh; data.NoiDung = model.NoiDungVanBan; data.SoVanBan = model.SoVanBan; data.TrichYeu = model.TrichYeuVanBan; data.LastUpdatedBy = UserName; var result = VanBanRepository.Update(data); if (result == Services.SaveResult.SUCCESS) { SaveFiles(id, model.Files); } return(RedirectToRoute(UrlLink.VANBAN)); }
public ActionResult Edit(int id) { return(ExecuteWithErrorHandling(() => { var data = VanBanRepository.Single(id); var init = InitViewModel(); var model = new EditVanBanViewModel { CoQuanBanHanhVanBanInfos = init.CoQuanBanHanhVanBanInfos, LoaiVanBanInfos = init.LoaiVanBanInfos, LinhVucVanBanInfos = init.LinhVucVanBanInfos, LinhVucVanBanId = data.LinhVucVanBanId, CoQuanBanhHanhVanBanId = data.CoQuanBanHanhId, LoaiVanBanId = data.LoaiVanBanId, NgayBanHanh = data.NgayBanHanh, NoiDungVanBan = data.NoiDung, SoVanBan = data.SoVanBan, TrichYeuVanBan = data.TrichYeu, TapTinVanBanResults = data.Files, }; return View(model); })); }
public PartialViewResult Detail(int id) { var model = VanBanRepository.Single(id); return(PartialView("_PartialPageDetail", model)); }