public ActionResult Update([FromBody] VanBan c) { try { vanbanRepo.Update(c); return(Json(c)); } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); } return(View(c)); }
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)); }