public ActionResult DeleteConfirmed(int id) { LoaiT loaiT = db.LoaiTS.Find(id); db.LoaiTS.Remove(loaiT); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MaLTS,TenLTS")] LoaiT loaiT) { if (ModelState.IsValid) { db.Entry(loaiT).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(loaiT)); }
public ActionResult Create([Bind(Include = "MaLTS,TenLTS")] LoaiT loaiT) { if (ModelState.IsValid) { db.LoaiTS.Add(loaiT); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(loaiT)); }
// GET: LoaiTS/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LoaiT loaiT = db.LoaiTS.Find(id); if (loaiT == null) { return(HttpNotFound()); } return(View(loaiT)); }