Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            LeaveRooms leaveRooms = db.LeaveRooms.Find(id);

            db.LeaveRooms.Remove(leaveRooms);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "ID,NumberRoom,NumberFloor,Count,Chear")] LeaveRooms leaveRooms)
 {
     if (ModelState.IsValid)
     {
         db.Entry(leaveRooms).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(leaveRooms));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "ID,NumberRoom,NumberFloor,Count,Chear")] LeaveRooms leaveRooms)
        {
            if (ModelState.IsValid)
            {
                db.LeaveRooms.Add(leaveRooms);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(leaveRooms));
        }
Example #4
0
        // GET: LeaveRooms/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LeaveRooms leaveRooms = db.LeaveRooms.Find(id);

            if (leaveRooms == null)
            {
                return(HttpNotFound());
            }
            return(View(leaveRooms));
        }