public ActionResult Delete(int id) { HT_ThamSo hT_ThamSo = db.HT_ThamSo.Find(id); db.HT_ThamSo.Remove(hT_ThamSo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Ten,GiaTri")] HT_ThamSo hT_ThamSo) { if (ModelState.IsValid) { db.Entry(hT_ThamSo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hT_ThamSo)); }
public ActionResult Create([Bind(Include = "ID,Ten,GiaTri")] HT_ThamSo hT_ThamSo) { if (ModelState.IsValid) { db.HT_ThamSo.Add(hT_ThamSo); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hT_ThamSo)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HT_ThamSo hT_ThamSo = db.HT_ThamSo.Find(id); if (hT_ThamSo == null) { return(HttpNotFound()); } return(View(hT_ThamSo)); }