public IActionResult ViewCongNhan(string Id) { StoreContext context = HttpContext.RequestServices.GetService(typeof(ontapck.Models.StoreContext)) as StoreContext; congnhan cn = context.ViewCongNhan(Id); ViewData.Model = cn; return(View()); }
public IActionResult UpdateCongNhan(congnhan kh) { int count; StoreContext context = HttpContext.RequestServices.GetService(typeof(ontapck.Models.StoreContext)) as StoreContext; count = context.UpdateCongNhan(kh); if (count > 0) { ViewData["thongbao"] = "Update thành công"; } else { ViewData["thongbao"] = "Update không thành công"; } return(View()); }