public ActionResult Create(LuuThong e) { e.Ngay = DateTime.Now; db.LuuThongs.Add(e); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id, LuuThong traffic) { var e = db.LuuThongs.SingleOrDefault(x => x.MaLuuThong == id); e.Ngay = traffic.Ngay; e.Ca = traffic.Ca; e.MaPhuXe = traffic.MaPhuXe; e.MaTaiXe = traffic.MaTaiXe; e.MaTuyenXe = traffic.MaTuyenXe; e.MaXeBuyt = traffic.MaXeBuyt; db.SaveChanges(); return(RedirectToAction("Index")); }