public ActionResult Detail(String id) { WebBanHang.Models.Order model = null; try { model = new Orderss().GetById(long.Parse(id)); } catch { ViewBag.messagerError = "alert alert-danger"; ModelState.AddModelError("", "Lỗi không đọc được csdl"); } return(View(model)); }
public ActionResult Detail(WebBanHang.Models.Order model) { try { new Orderss().Update(model); // Edit ViewBag.messagerError = "alert alert-success"; ModelState.AddModelError("", "Lưu thành công hóa đơn : " + model.Id); } catch { ViewBag.messagerError = "alert alert-danger"; ModelState.AddModelError("", "Lỗi không lưu được csdl"); } return(View(model)); }