public ActionResult DeleteConfirmed(int id) { manhinh manhinh = db.manhinhs.Find(id); db.manhinhs.Remove(manhinh); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,maSp,tensp,congnghemanhinh,dophangiai,manhinhrong,matkinhcamung")] manhinh manhinh) { if (ModelState.IsValid) { db.Entry(manhinh).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(manhinh)); }
public ActionResult Create([Bind(Include = "id,maSp,tensp,congnghemanhinh,dophangiai,manhinhrong,matkinhcamung")] manhinh manhinh) { if (ModelState.IsValid) { db.manhinhs.Add(manhinh); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(manhinh)); }
// GET: admin/manhinhs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } manhinh manhinh = db.manhinhs.Find(id); if (manhinh == null) { return(HttpNotFound()); } return(View(manhinh)); }