예제 #1
0
        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"));
        }
예제 #2
0
 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));
 }
예제 #3
0
        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));
        }
예제 #4
0
        // 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));
        }