Ejemplo n.º 1
0
        public ActionResult Reservation(string message, int type = 0)
        {
            List <SelectListItem> billingTypes = new List <SelectListItem>();

            billingTypes.Add(new SelectListItem()
            {
                Text = "Cash", Value = "1"
            });
            billingTypes.Add(new SelectListItem()
            {
                Text = "Card", Value = "2"
            });

            ViewBag.billingTypes = new SelectList(billingTypes, "Value", "Text");

            IList <Roomtype> roomTypes = _hotelReservationService.LoadAllHotelTypes();

            ViewBag.roomTypes    = new SelectList(roomTypes, "Id", "Name");
            ViewBag.roomTypeList = roomTypes;
            IList <Room> rooms = _hotelReservationService.LoadAllRooms();

            ViewBag.roomList = rooms;
            if (!String.IsNullOrEmpty(message) && type == 1)//success
            {
                ViewBag.SuccessMessage = message;
            }
            if (!String.IsNullOrEmpty(message) && type == 2)//failed
            {
                ViewBag.ErrorMessage = message;
            }


            return(View());
        }