public ActionResult DeleteConfirmed(int id) { LeaveRooms leaveRooms = db.LeaveRooms.Find(id); db.LeaveRooms.Remove(leaveRooms); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }