public ActionResult BookHotel([Bind(Include = "BookingID,RoomID,UserID,Booked_From,Booked_To,No_of_Adults,No_of_Children,Amount")] BookingDetails180625 BookingDetails180625) { if (ModelState.IsValid) { db.BookingDetails180625.Add(BookingDetails180625); db.SaveChanges(); return(RedirectToAction("MainContent")); } ViewBag.UserID = new SelectList(db.Users180625, "UserID", "Password", BookingDetails180625.UserID); ViewBag.RoomID = new SelectList(db.RoomDetails180625, "RoomID", "RoomNo", BookingDetails180625.RoomID); return(View(BookingDetails180625)); }
public ActionResult Register(int UserID, string Password, string Role, string UserName, string MobileNo, string Phone, string Address, string Email) { HotelsEntities db = new HotelsEntities(); Users180625 user = new Users180625(); if (user == null) { ViewBag.Message = " Not Successfully Added"; } user.UserID = UserID; user.Password = Password; user.Role = Role; user.UserName = UserName; user.MobileNo = MobileNo; user.Phone = Phone; user.Address = Address; user.Email = Email; db.Users180625.Add(user); db.SaveChanges(); ViewBag.Message = "Successfully Added"; return(RedirectToAction("Login")); }
public ActionResult Create(string City, string HotelName, string Address, string Description, int Avg_Rate_Per_Night, string PhoneNo1, string PhoneNo2, string Rating, string Email, string Fax) { Hotels180625 hotel = new Hotels180625(); hotel.HotelName = HotelName; hotel.City = City; hotel.Address = Address; hotel.Description = Description; hotel.Avg_Rate_Per_Night = Avg_Rate_Per_Night; hotel.PhoneNo1 = PhoneNo1; hotel.PhoneNo2 = PhoneNo2; hotel.Rating = Rating; hotel.Email = Email; hotel.Fax = Fax; db.Hotels180625.Add(hotel); db.SaveChanges(); ViewBag.Message = "Successfully Added"; return(RedirectToAction("Details")); }