Ejemplo n.º 1
0
        private void PrepareHotel1(RoomModel model)
        {
            model.Hotels = context.Hotels.AsQueryable<HolidayPlanner.DAL.Hotel>().Select(x =>
                                                            new SelectListItem()
                                                            {
                                                                Text = x.HotelName,
                                                                Value = x.HotelId.ToString()
                                                            });

        }
Ejemplo n.º 2
0
 public ActionResult AddRoom(RoomModel rmodel)
 {
     try
     {
         HolidayPlanner.DAL.Room rt = new HolidayPlanner.DAL.Room()
         {
             RoomId = rmodel.RoomId,
             RoomType = rmodel.RoomType,
             RoomDetails = rmodel.RoomDetails,
             RoomCapacity=rmodel.RoomCapacity,
             Rate=rmodel.Rate,
             HotelId=rmodel.HotelId
         };
         context.Rooms.InsertOnSubmit(rt);
         context.SubmitChanges();
         return RedirectToAction("Index");
     }
     catch
     {
         return View(rmodel);
     }
 }
Ejemplo n.º 3
0
 public ActionResult AddRoom()
 {
     RoomModel model = new RoomModel();
     PrepareHotel1(model);
     return View(model);
 }