public ActionResult DeleteConfirmed(string id) { NHOMSP nHOMSP = db.NHOMSPs.Find(id); db.NHOMSPs.Remove(nHOMSP); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MaNhomSP,TenNhomSP")] NHOMSP nHOMSP) { if (ModelState.IsValid) { db.Entry(nHOMSP).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(nHOMSP)); }
public ActionResult Create([Bind(Include = "MaNhomSP,TenNhomSP")] NHOMSP nHOMSP) { if (ModelState.IsValid) { db.NHOMSPs.Add(nHOMSP); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(nHOMSP)); }
// GET: Admin/NHOMSPs/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NHOMSP nHOMSP = db.NHOMSPs.Find(id); if (nHOMSP == null) { return(HttpNotFound()); } return(View(nHOMSP)); }