public ActionResult Create([Bind(Include = "ServiceID,Name")] Service service) { if (ModelState.IsValid) { db.Service.Add(service); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(service)); }
public ActionResult Create([Bind(Include = "TypeOfRoomID,Name,SingleBed,TwinBed,DOMBed")] TypeOfRoom typeOfRoom) { if (ModelState.IsValid) { db.TypeOfRoom.Add(typeOfRoom); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(typeOfRoom)); }
public ActionResult Create([Bind(Include = "BookingContactID,PersonName,Address,PhoneNumber,Email,RoomID,RoomCount,Messeger,Status")] BookingContact bookingContact) { if (ModelState.IsValid) { db.BookingContacts.Add(bookingContact); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RoomID = new SelectList(db.Room, "RoomID", "Name", bookingContact.RoomID); return(View(bookingContact)); }
public ActionResult RoomBookingInfo([Bind(Include = "BookingContactID,PersonName,Address,PhoneNumber,Email,RoomID,RoomCount,Messeger,Status")] BookingContact bookingContact) { if (ModelState.IsValid) { db.BookingContacts.Add(bookingContact); db.SaveChanges(); return(RedirectToAction("Success", "Order", new { bookingContactID = bookingContact.BookingContactID })); } var room = db.Room.Find(bookingContact.RoomID); ViewBag.Room = room; ViewBag.HotelCover = db.PictureHouse.Where(a => a.HouseID == room.HouseID && a.IsMainPicture == true).FirstOrDefault().Name; return(View()); }
public ActionResult CreateHouse([Bind(Include = "HouseID,Name,Intro,PhoneNumber,Street,Province,District,Ward,UserID,Payment")] House house) { if (ModelState.IsValid) { var UserID = User.Identity.GetUserId(); house.UserID = UserID; house.Payment = "Cash"; db.House.Add(house); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Province = new SelectList(db.Provinces, "Name", "Name"); return(View()); }
public ActionResult HomeEdit([Bind(Include = "HomepageID,Hotline,Address,Email,FacebookLink,YoutubeLink,GoogleLink")] Homepage homepage) { if (ModelState.IsValid) { db.Entry(homepage).State = EntityState.Modified; db.SaveChanges(); var noti = "Cập Nhật Thành Công!"; return(RedirectToAction("Header", "Admin", new { Noti = noti })); } return(View(homepage)); }