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