Exemplo n.º 1
0
        // GET: BookingRequest/Create
        public ActionResult Create()
        {
            var roomTypes     = _roomTypeRepo.FindAll();
            var roomTypeItems = roomTypes.Select(q => new SelectListItem {
                Text  = q.RoomName,
                Value = q.RoomTypeId.ToString()
            });
            var model = new CreateBookingRequestViewModel
            {
                RoomType = roomTypeItems
            };

            return(View(model));
        }
Exemplo n.º 2
0
        // GET: RoomType
        public ActionResult Index()
        {
            var roomtypes = _repo.FindAll().ToList();
            var model     = _mapper.Map <List <RoomType>, List <RoomTypeViewModel> >(roomtypes);

            return(View(model));
        }
Exemplo n.º 3
0
        // GET: Booking
        public ActionResult Index()
        {
            var roomtypes       = _roomrepo.FindAll().ToList();
            var mappedRoomTypes = _mapper.Map <List <RoomType>, List <RoomTypeViewModel> >(roomtypes);
            var model           = new CreateBookingViewModel
            {
                RoomTypes     = mappedRoomTypes,
                NumberUpdated = 0
            };

            return(View(model));
        }