public ActionResult Update(NhaXuatBanViewModel model) { if (ModelState.IsValid) { var nxb = new NhaXuatBan(); nxb.UpdateNhaXuatBan(model); _nhaXuatBanService.Update(nxb); context.SaveChanges(); ViewData["successMsg"] = "Sua thành công"; } return(View(model)); }
public ActionResult Update(ONhaXuatBan model) { if (ModelState.IsValid) { var pro = nxbService.Get(model.MaNXB); if (pro != null) { try { nxbService.Update(model); return(RedirectToAction("Search", "QuanLyNXB")); } catch (Exception e) { } } } ViewBag.IsEdit = true; return(View(model)); }