public ActionResult DeleteConfirmed(int id) { tbRoomType tbRoomType = db.tbRoomTypes.Find(id); db.tbRoomTypes.Remove(tbRoomType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "roomTypeId,roomTypeName,fromDate,toDate,roomPrice")] tbRoomType tbRoomType) { if (ModelState.IsValid) { db.Entry(tbRoomType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbRoomType)); }
public ActionResult Create([Bind(Include = "roomTypeId,roomTypeName,fromDate,toDate,roomPrice")] tbRoomType tbRoomType) { if (ModelState.IsValid) { db.tbRoomTypes.Add(tbRoomType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbRoomType)); }
// GET: RoomTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbRoomType tbRoomType = db.tbRoomTypes.Find(id); if (tbRoomType == null) { return(HttpNotFound()); } return(View(tbRoomType)); }