public ActionResult Create(VanBan vanBan) { if (ModelState.IsValid) { db.VanBan.Add(vanBan); db.SaveChanges(); return RedirectToAction("Index"); } GetViewBag(ViewReport.Create, vanBan.LoaiVanBan_ID); return View(vanBan); }
public ActionResult Edit(VanBan vanBan) { if (ModelState.IsValid) { db.Entry(vanBan).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } GetViewBag(ViewReport.Create, vanBan.LoaiVanBan_ID); return View(vanBan); }