public ActionResult DeleteConfirmed(int id) { bonho bonho = db.bonhoes.Find(id); db.bonhoes.Remove(bonho); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,maSp,tensp,ram,bonhotrong,bonhokhadung,thenhongoai,hotrothetoida")] bonho bonho) { if (ModelState.IsValid) { db.Entry(bonho).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bonho)); }
public ActionResult Create([Bind(Include = "id,maSp,tensp,ram,bonhotrong,bonhokhadung,thenhongoai,hotrothetoida")] bonho bonho) { if (ModelState.IsValid) { db.bonhoes.Add(bonho); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bonho)); }
// GET: admin/bonhoes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } bonho bonho = db.bonhoes.Find(id); if (bonho == null) { return(HttpNotFound()); } return(View(bonho)); }